summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@mariadb.org>2016-03-25 20:51:22 +0400
committerSergey Vojtovich <svoj@mariadb.org>2016-03-31 10:11:16 +0400
commit282497dd6d1049b4fb963641504c2733752845a7 (patch)
tree7288d17c29fbbe9ac47ec51f6988fb954f59a361
parent5052e2479e873461bebfcedbc674bbaf57d3c968 (diff)
downloadmariadb-git-282497dd6d1049b4fb963641504c2733752845a7.tar.gz
MDEV-6720 - enable connection log in mysqltest by default
-rw-r--r--client/mysqltest.cc2
-rw-r--r--mysql-test/extra/binlog_tests/binlog_truncate.test5
-rw-r--r--mysql-test/extra/rpl_tests/rpl_blackhole.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_charset.test18
-rw-r--r--mysql-test/extra/rpl_tests/rpl_conflicts.test10
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ddl.test86
-rw-r--r--mysql-test/extra/rpl_tests/rpl_extra_col_slave.test1
-rw-r--r--mysql-test/extra/rpl_tests/rpl_innodb.test10
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loaddata.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_basic.test15
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_sp007.test9
-rw-r--r--mysql-test/extra/rpl_tests/rpl_row_tabledefs.test12
-rw-r--r--mysql-test/extra/rpl_tests/rpl_start_stop_slave.test10
-rw-r--r--mysql-test/extra/rpl_tests/rpl_stop_slave.test8
-rw-r--r--mysql-test/extra/rpl_tests/rpl_test_framework.inc3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_truncate_helper.test4
-rw-r--r--mysql-test/include/bug38347.inc4
-rw-r--r--mysql-test/include/concurrent.inc62
-rw-r--r--mysql-test/include/deadlock.inc18
-rw-r--r--mysql-test/include/grant_cache.inc9
-rw-r--r--mysql-test/include/mix1.inc21
-rw-r--r--mysql-test/include/query_cache.inc6
-rw-r--r--mysql-test/include/query_cache_sql_prepare.inc23
-rw-r--r--mysql-test/include/rpl_connect.inc2
-rw-r--r--mysql-test/include/rpl_connection.inc2
-rw-r--r--mysql-test/include/rpl_connection_master.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave.inc2
-rw-r--r--mysql-test/include/rpl_connection_slave1.inc2
-rw-r--r--mysql-test/include/rpl_ip_mix.inc7
-rw-r--r--mysql-test/include/rpl_ip_mix2.inc7
-rw-r--r--mysql-test/include/rpl_ipv6.inc7
-rw-r--r--mysql-test/include/rpl_loaddata_charset.inc2
-rw-r--r--mysql-test/include/rpl_stmt_seq.inc18
-rw-r--r--mysql-test/include/rpl_sync.inc8
-rw-r--r--mysql-test/include/rpl_udf.inc16
-rw-r--r--mysql-test/r/aborted_clients.result6
-rw-r--r--mysql-test/r/alias.result4
-rw-r--r--mysql-test/r/alter_table-big.result32
-rw-r--r--mysql-test/r/alter_table.result9
-rw-r--r--mysql-test/r/analyze_format_json.result4
-rw-r--r--mysql-test/r/assign_key_cache-5405.result5
-rw-r--r--mysql-test/r/auth_named_pipe.result3
-rw-r--r--mysql-test/r/auth_rpl.result9
-rw-r--r--mysql-test/r/bug39022.result19
-rw-r--r--mysql-test/r/bug58669.result4
-rw-r--r--mysql-test/r/cache_innodb.result15
-rw-r--r--mysql-test/r/cast.result3
-rw-r--r--mysql-test/r/change_user_notembedded.result4
-rw-r--r--mysql-test/r/check.result13
-rw-r--r--mysql-test/r/commit.result64
-rw-r--r--mysql-test/r/compress.result3
-rw-r--r--mysql-test/r/concurrent_innodb_safelog.result130
-rw-r--r--mysql-test/r/concurrent_innodb_unsafelog.result130
-rw-r--r--mysql-test/r/connect.result69
-rw-r--r--mysql-test/r/connect2.result26
-rw-r--r--mysql-test/r/consistent_snapshot.result22
-rw-r--r--mysql-test/r/create-big.result118
-rw-r--r--mysql-test/r/create.result7
-rw-r--r--mysql-test/r/create_drop_role.result4
-rw-r--r--mysql-test/r/create_or_replace.result7
-rw-r--r--mysql-test/r/create_or_replace2.result2
-rw-r--r--mysql-test/r/create_or_replace_permission.result3
-rw-r--r--mysql-test/r/cte_grant.result11
-rw-r--r--mysql-test/r/ctype_errors.result13
-rw-r--r--mysql-test/r/ddl_i18n_koi8r.result50
-rw-r--r--mysql-test/r/ddl_i18n_utf8.result50
-rw-r--r--mysql-test/r/deadlock_innodb.result38
-rw-r--r--mysql-test/r/debug_sync.result28
-rw-r--r--mysql-test/r/delayed.result66
-rw-r--r--mysql-test/r/delete_returning_grant.result11
-rw-r--r--mysql-test/r/derived.result5
-rw-r--r--mysql-test/r/dirty_close.result17
-rw-r--r--mysql-test/r/drop.result15
-rw-r--r--mysql-test/r/empty_user_table.result1
-rw-r--r--mysql-test/r/enforce_storage_engine.result8
-rw-r--r--mysql-test/r/events_1.result5
-rw-r--r--mysql-test/r/events_bugs.result33
-rw-r--r--mysql-test/r/events_grant.result16
-rw-r--r--mysql-test/r/events_stress.result11
-rw-r--r--mysql-test/r/events_trans_notembedded.result3
-rw-r--r--mysql-test/r/explain_slowquerylog.result3
-rw-r--r--mysql-test/r/failed_auth_3909.result3
-rw-r--r--mysql-test/r/failed_auth_unixsocket.result1
-rw-r--r--mysql-test/r/filesort_debug.result10
-rw-r--r--mysql-test/r/flush-innodb-notembedded.result25
-rw-r--r--mysql-test/r/flush-innodb.result94
-rw-r--r--mysql-test/r/flush.result118
-rw-r--r--mysql-test/r/flush_block_commit.result39
-rw-r--r--mysql-test/r/flush_block_commit_notembedded.result22
-rw-r--r--mysql-test/r/flush_read_lock.result297
-rw-r--r--mysql-test/r/flush_read_lock_kill.result16
-rw-r--r--mysql-test/r/flush_table.result10
-rw-r--r--mysql-test/r/func_compress.result7
-rw-r--r--mysql-test/r/func_group.result4
-rw-r--r--mysql-test/r/func_misc.result43
-rw-r--r--mysql-test/r/func_str.result7
-rw-r--r--mysql-test/r/func_weight_string.result4
-rw-r--r--mysql-test/r/function_defaults_notembedded.result12
-rw-r--r--mysql-test/r/grant.result398
-rw-r--r--mysql-test/r/grant2.result126
-rw-r--r--mysql-test/r/grant3.result15
-rw-r--r--mysql-test/r/grant4.result13
-rw-r--r--mysql-test/r/grant_cache_no_prot.result38
-rw-r--r--mysql-test/r/grant_cache_ps_prot.result38
-rw-r--r--mysql-test/r/grant_explain_non_select.result32
-rw-r--r--mysql-test/r/grant_lowercase.result4
-rw-r--r--mysql-test/r/grant_lowercase_fs.result5
-rw-r--r--mysql-test/r/information_schema.result164
-rw-r--r--mysql-test/r/information_schema_db.result25
-rw-r--r--mysql-test/r/information_schema_linux.result3
-rw-r--r--mysql-test/r/init_connect.result63
-rw-r--r--mysql-test/r/init_connection_query_cache.result4
-rw-r--r--mysql-test/r/innodb_mysql_lock.result75
-rw-r--r--mysql-test/r/innodb_mysql_lock2.result88
-rw-r--r--mysql-test/r/innodb_mysql_sync.result107
-rw-r--r--mysql-test/r/insert_notembedded.result20
-rw-r--r--mysql-test/r/ipv4_and_ipv6.result6
-rw-r--r--mysql-test/r/ipv4_as_ipv6.result18
-rw-r--r--mysql-test/r/ipv6.result9
-rw-r--r--mysql-test/r/kill-2.result2
-rw-r--r--mysql-test/r/kill.result148
-rw-r--r--mysql-test/r/loaddata.result6
-rw-r--r--mysql-test/r/loadxml.result3
-rw-r--r--mysql-test/r/lock.result24
-rw-r--r--mysql-test/r/lock_multi.result289
-rw-r--r--mysql-test/r/lock_multi_bug38499.result9
-rw-r--r--mysql-test/r/lock_multi_bug38691.result7
-rw-r--r--mysql-test/r/lock_sync.result158
-rw-r--r--mysql-test/r/lock_tables_lost_commit.result7
-rw-r--r--mysql-test/r/locked_temporary-5955.result2
-rw-r--r--mysql-test/r/log_state.result16
-rw-r--r--mysql-test/r/log_tables.result33
-rw-r--r--mysql-test/r/lowercase_fs_off.result18
-rw-r--r--mysql-test/r/mdev-504.result1
-rw-r--r--mysql-test/r/mdev375.result3
-rw-r--r--mysql-test/r/mdl_sync.result1143
-rw-r--r--mysql-test/r/merge-big.result9
-rw-r--r--mysql-test/r/merge.result39
-rw-r--r--mysql-test/r/mix2_myisam.result26
-rw-r--r--mysql-test/r/multi_update.result21
-rw-r--r--mysql-test/r/myisam-big.result6
-rw-r--r--mysql-test/r/myisam-optimize.result14
-rw-r--r--mysql-test/r/myisam.result19
-rw-r--r--mysql-test/r/myisam_debug.result6
-rw-r--r--mysql-test/r/myisam_icp_notembedded.result3
-rw-r--r--mysql-test/r/myisam_optimize.result7
-rw-r--r--mysql-test/r/myisam_recover.result21
-rw-r--r--mysql-test/r/mysql-bug41486.result3
-rw-r--r--mysql-test/r/mysql-bug45236.result3
-rw-r--r--mysql-test/r/mysql_upgrade-6984.result1
-rw-r--r--mysql-test/r/mysql_upgrade.result1
-rw-r--r--mysql-test/r/mysqlbinlog.result8
-rw-r--r--mysql-test/r/mysqlbinlog_row_big.result5
-rw-r--r--mysql-test/r/mysqldump-max.result21
-rw-r--r--mysql-test/r/mysqldump.result18
-rw-r--r--mysql-test/r/mysqltest.result22
-rw-r--r--mysql-test/r/named_pipe.result3
-rw-r--r--mysql-test/r/non_blocking_api.result4
-rw-r--r--mysql-test/r/not_embedded_server.result8
-rw-r--r--mysql-test/r/openssl_1.result18
-rw-r--r--mysql-test/r/outfile.resultbin2139 -> 2323 bytes
-rw-r--r--mysql-test/r/overflow.result4
-rw-r--r--mysql-test/r/packet.result8
-rw-r--r--mysql-test/r/parser_not_embedded.result10
-rw-r--r--mysql-test/r/partition_cache.result15
-rw-r--r--mysql-test/r/partition_csv.result3
-rw-r--r--mysql-test/r/partition_debug_sync.result28
-rw-r--r--mysql-test/r/partition_grant.result16
-rw-r--r--mysql-test/r/partition_innodb.result25
-rw-r--r--mysql-test/r/partition_innodb_plugin.result21
-rw-r--r--mysql-test/r/partition_innodb_semi_consistent.result39
-rw-r--r--mysql-test/r/partition_innodb_stmt.result10
-rw-r--r--mysql-test/r/partition_symlink.result5
-rw-r--r--mysql-test/r/partition_sync.result26
-rw-r--r--mysql-test/r/plugin_auth.result59
-rw-r--r--mysql-test/r/plugin_auth_qa_1.result35
-rw-r--r--mysql-test/r/plugin_not_embedded.result5
-rw-r--r--mysql-test/r/plugin_vars.result10
-rw-r--r--mysql-test/r/pool_of_threads.result13
-rw-r--r--mysql-test/r/processlist.result8
-rw-r--r--mysql-test/r/ps.result15
-rw-r--r--mysql-test/r/ps_ddl.result12
-rw-r--r--mysql-test/r/ps_grant.result8
-rw-r--r--mysql-test/r/query_cache_28249.result25
-rw-r--r--mysql-test/r/query_cache_debug.result71
-rw-r--r--mysql-test/r/query_cache_notembedded.result24
-rw-r--r--mysql-test/r/query_cache_ps_no_prot.result46
-rw-r--r--mysql-test/r/query_cache_ps_ps_prot.result46
-rw-r--r--mysql-test/r/quick_select_4161.result5
-rw-r--r--mysql-test/r/read_only.result13
-rw-r--r--mysql-test/r/read_only_innodb.result18
-rw-r--r--mysql-test/r/rename.result11
-rw-r--r--mysql-test/r/rpl_mysqldump_slave.result6
-rw-r--r--mysql-test/r/schema.result52
-rw-r--r--mysql-test/r/shm.result3
-rw-r--r--mysql-test/r/show_check.result52
-rw-r--r--mysql-test/r/show_explain.result129
-rw-r--r--mysql-test/r/show_explain_non_select.result11
-rw-r--r--mysql-test/r/show_explain_ps.result6
-rw-r--r--mysql-test/r/shutdown.result5
-rw-r--r--mysql-test/r/skip_name_resolve.result3
-rw-r--r--mysql-test/r/sp-innodb.result3
-rw-r--r--mysql-test/r/sp-lock.result254
-rw-r--r--mysql-test/r/sp-security.result151
-rw-r--r--mysql-test/r/sp-threads.result28
-rw-r--r--mysql-test/r/sp.result4
-rw-r--r--mysql-test/r/sp_notembedded.result49
-rw-r--r--mysql-test/r/sp_sync.result36
-rw-r--r--mysql-test/r/sql_mode.result5
-rw-r--r--mysql-test/r/ssl-big.result5
-rw-r--r--mysql-test/r/ssl.result3
-rw-r--r--mysql-test/r/ssl_cipher.result3
-rw-r--r--mysql-test/r/ssl_compress.result3
-rw-r--r--mysql-test/r/ssl_timeout.result3
-rw-r--r--mysql-test/r/stat_tables_par.result40
-rw-r--r--mysql-test/r/stat_tables_par_innodb.result40
-rw-r--r--mysql-test/r/stat_tables_rbr.result3
-rw-r--r--mysql-test/r/stat_tables_repl.result10
-rw-r--r--mysql-test/r/status.result41
-rw-r--r--mysql-test/r/status2.result4
-rw-r--r--mysql-test/r/status_bug17954.result1
-rw-r--r--mysql-test/r/subselect.result4
-rw-r--r--mysql-test/r/subselect_no_exists_to_in.result4
-rw-r--r--mysql-test/r/subselect_no_mat.result4
-rw-r--r--mysql-test/r/subselect_no_opts.result4
-rw-r--r--mysql-test/r/subselect_no_scache.result4
-rw-r--r--mysql-test/r/subselect_no_semijoin.result4
-rw-r--r--mysql-test/r/subselect_sj.result4
-rw-r--r--mysql-test/r/subselect_sj_jcl6.result4
-rw-r--r--mysql-test/r/symlink.result10
-rw-r--r--mysql-test/r/synchronization.result55
-rw-r--r--mysql-test/r/temp_table.result3
-rw-r--r--mysql-test/r/timezone_grant.result12
-rw-r--r--mysql-test/r/trans_read_only.result6
-rw-r--r--mysql-test/r/trigger-compat.result6
-rw-r--r--mysql-test/r/trigger-trans.result9
-rw-r--r--mysql-test/r/trigger.result23
-rw-r--r--mysql-test/r/trigger_notembedded.result176
-rw-r--r--mysql-test/r/truncate_coverage.result71
-rw-r--r--mysql-test/r/udf_debug_sync.result8
-rw-r--r--mysql-test/r/union.result3
-rw-r--r--mysql-test/r/unsafe_binlog_innodb.result66
-rw-r--r--mysql-test/r/update.result4
-rw-r--r--mysql-test/r/user_limits.result60
-rw-r--r--mysql-test/r/userstat-badlogin-4824.result5
-rw-r--r--mysql-test/r/userstat.result3
-rw-r--r--mysql-test/r/variables-notembedded.result3
-rw-r--r--mysql-test/r/variables.result6
-rw-r--r--mysql-test/r/view.result30
-rw-r--r--mysql-test/r/view_debug.result5
-rw-r--r--mysql-test/r/view_grant.result253
-rw-r--r--mysql-test/r/wait_timeout.result10
-rw-r--r--mysql-test/r/xa.result48
-rw-r--r--mysql-test/r/xa_sync.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_bug23533.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_checkpoint.result18
-rw-r--r--mysql-test/suite/binlog/r/binlog_commit_wait.result34
-rw-r--r--mysql-test/suite/binlog/r/binlog_grant.result14
-rw-r--r--mysql-test/suite/binlog/r/binlog_killed.result32
-rw-r--r--mysql-test/suite/binlog/r/binlog_mdev342.result7
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_binlog.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_drop_tbl.result9
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result19
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_binlog.result3
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result9
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result8
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result19
-rw-r--r--mysql-test/suite/binlog/r/binlog_stm_row.result30
-rw-r--r--mysql-test/suite/binlog/r/binlog_tmp_table.result25
-rw-r--r--mysql-test/suite/binlog/r/binlog_truncate_kill.result4
-rw-r--r--mysql-test/suite/binlog/r/binlog_truncate_myisam.result20
-rw-r--r--mysql-test/suite/binlog/r/binlog_xa_recover.result24
-rw-r--r--mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result3
-rw-r--r--mysql-test/suite/binlog/t/binlog_stm_row.test13
-rw-r--r--mysql-test/suite/binlog/t/binlog_truncate_kill.test2
-rw-r--r--mysql-test/suite/csv/csv.result12
-rw-r--r--mysql-test/suite/encryption/r/create_or_replace.result5
-rw-r--r--mysql-test/suite/encryption/r/tempfiles.result5
-rw-r--r--mysql-test/suite/federated/assisted_discovery.result9
-rw-r--r--mysql-test/suite/federated/error_on_close-8313.result4
-rw-r--r--mysql-test/suite/federated/error_on_close-8313.test2
-rw-r--r--mysql-test/suite/federated/federated.result7
-rw-r--r--mysql-test/suite/federated/federated_archive.result9
-rw-r--r--mysql-test/suite/federated/federated_bug_13118.result9
-rw-r--r--mysql-test/suite/federated/federated_bug_25714.result10
-rw-r--r--mysql-test/suite/federated/federated_bug_32426.result10
-rw-r--r--mysql-test/suite/federated/federated_bug_35333.result6
-rw-r--r--mysql-test/suite/federated/federated_bug_585688.result24
-rw-r--r--mysql-test/suite/federated/federated_debug.result12
-rw-r--r--mysql-test/suite/federated/federated_debug.test2
-rw-r--r--mysql-test/suite/federated/federated_innodb.result11
-rw-r--r--mysql-test/suite/federated/federated_maybe_16324629.result10
-rw-r--r--mysql-test/suite/federated/federated_partition.result11
-rw-r--r--mysql-test/suite/federated/federated_server.result33
-rw-r--r--mysql-test/suite/federated/federated_transactions.result8
-rw-r--r--mysql-test/suite/federated/federatedx.result119
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_routines.inc4
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_schemata.inc4
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_tables.inc5
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_triggers.inc5
-rw-r--r--mysql-test/suite/funcs_1/datadict/is_views.inc4
-rw-r--r--mysql-test/suite/funcs_1/datadict/processlist_val.inc60
-rw-r--r--mysql-test/suite/funcs_1/datadict/statistics.inc3
-rw-r--r--mysql-test/suite/funcs_1/datadict/table_constraints.inc2
-rw-r--r--mysql-test/suite/funcs_1/datadict/tables.inc2
-rw-r--r--mysql-test/suite/funcs_1/datadict/tables1.inc2
-rw-r--r--mysql-test/suite/funcs_1/r/charset_collation.result5
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_06.result40
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_storedproc_10.result9
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03.result92
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_03e.result145
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_0407.result27
-rw-r--r--mysql-test/suite/funcs_1/r/innodb_trig_08.result15
-rw-r--r--mysql-test/suite/funcs_1/r/is_basics_mixed.result27
-rw-r--r--mysql-test/suite/funcs_1/r/is_column_privileges.result38
-rw-r--r--mysql-test/suite/funcs_1/r/is_column_privileges_is_mysql_test.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_key_column_usage.result8
-rw-r--r--mysql-test/suite/funcs_1/r/is_routines.result11
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges.result35
-rw-r--r--mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata.result11
-rw-r--r--mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result4
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics.result18
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_is.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_is.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_table_privileges.result11
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables.result12
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_innodb.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_is_embedded.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_memory.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result5
-rw-r--r--mysql-test/suite/funcs_1/r/is_triggers.result14
-rw-r--r--mysql-test/suite/funcs_1/r/is_user_privileges.result27
-rw-r--r--mysql-test/suite/funcs_1/r/is_views.result11
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_06.result40
-rw-r--r--mysql-test/suite/funcs_1/r/memory_storedproc_10.result9
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03.result92
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_03e.result139
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_0407.result27
-rw-r--r--mysql-test/suite/funcs_1/r/memory_trig_08.result15
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_06.result40
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_storedproc_10.result9
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03.result92
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_03e.result139
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_0407.result27
-rw-r--r--mysql-test/suite/funcs_1/r/myisam_trig_08.result15
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result42
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_priv_ps.result42
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_no_prot.result61
-rw-r--r--mysql-test/suite/funcs_1/r/processlist_val_ps.result61
-rw-r--r--mysql-test/suite/funcs_1/r/storedproc.result5
-rw-r--r--mysql-test/suite/funcs_1/storedproc/storedproc_10.inc2
-rw-r--r--mysql-test/suite/funcs_1/t/charset_collation.test3
-rw-r--r--mysql-test/suite/funcs_1/t/is_basics_mixed.test11
-rw-r--r--mysql-test/suite/funcs_1/t/is_column_privileges.test17
-rw-r--r--mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test2
-rw-r--r--mysql-test/suite/funcs_1/t/is_columns.test3
-rw-r--r--mysql-test/suite/funcs_1/t/is_schema_privileges.test21
-rw-r--r--mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test3
-rw-r--r--mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test3
-rw-r--r--mysql-test/suite/funcs_1/t/is_statistics.test8
-rw-r--r--mysql-test/suite/funcs_1/t/is_table_constraints.test2
-rw-r--r--mysql-test/suite/funcs_1/t/is_table_privileges.test4
-rw-r--r--mysql-test/suite/funcs_1/t/is_user_privileges.test12
-rw-r--r--mysql-test/suite/handler/aria.result185
-rw-r--r--mysql-test/suite/handler/disconnect_4480.result2
-rw-r--r--mysql-test/suite/handler/handler.inc95
-rw-r--r--mysql-test/suite/handler/heap.result196
-rw-r--r--mysql-test/suite/handler/innodb.result185
-rw-r--r--mysql-test/suite/handler/interface.result44
-rw-r--r--mysql-test/suite/handler/interface.test10
-rw-r--r--mysql-test/suite/handler/myisam.result185
-rw-r--r--mysql-test/suite/innodb/r/auto_increment_dup.result14
-rw-r--r--mysql-test/suite/innodb/r/binlog_consistent.result26
-rw-r--r--mysql-test/suite/innodb/r/group_commit.result22
-rw-r--r--mysql-test/suite/innodb/r/group_commit_binlog_pos.result12
-rw-r--r--mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result12
-rw-r--r--mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result22
-rw-r--r--mysql-test/suite/innodb/r/innodb-autoinc-61209.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-blob.result23
-rw-r--r--mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb-consistent.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb-lock.result27
-rw-r--r--mysql-test/suite/innodb/r/innodb-semi-consistent.result18
-rw-r--r--mysql-test/suite/innodb/r/innodb-timeout.result19
-rw-r--r--mysql-test/suite/innodb/r/innodb.result96
-rw-r--r--mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug12400341.result2
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14007649.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug14704286.result12
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug38231.result1
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug42419.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug47622.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug49164.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug51920.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug52663.result7
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug53756.result43
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59641.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_defrag_concurrent.result19
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result34
-rw-r--r--mysql-test/suite/innodb/r/innodb_mutexes.result14
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql.result110
-rw-r--r--mysql-test/suite/innodb/r/innodb_mysql_rbk.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb_notembedded.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result19
-rw-r--r--mysql-test/suite/innodb/r/innodb_stats_drop_locked.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result10
-rw-r--r--mysql-test/suite/innodb/r/innodb_timeout_rollback.result8
-rw-r--r--mysql-test/suite/innodb/r/innodb_uninstall.result12
-rw-r--r--mysql-test/suite/innodb/r/mdev-117.result5
-rw-r--r--mysql-test/suite/innodb/r/row_lock.result8
-rw-r--r--mysql-test/suite/innodb/r/snapshot.result2
-rw-r--r--mysql-test/suite/innodb/r/tmpdir.result8
-rw-r--r--mysql-test/suite/innodb/r/xa_recovery.result6
-rw-r--r--mysql-test/suite/innodb/t/auto_increment_dup.test6
-rw-r--r--mysql-test/suite/innodb/t/binlog_consistent.test11
-rw-r--r--mysql-test/suite/innodb/t/innodb-autoinc-61209.test12
-rw-r--r--mysql-test/suite/innodb/t/innodb-lock.test6
-rw-r--r--mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_bug53756.test26
-rw-r--r--mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb_mysql.test3
-rw-r--r--mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test9
-rw-r--r--mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test5
-rw-r--r--mysql-test/suite/innodb/t/tmpdir.test2
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result15
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result81
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb-fts-stopword.test6
-rw-r--r--mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test33
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb-zip.result9
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_bug56680.result12
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result23
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result44
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test21
-rw-r--r--mysql-test/suite/maria/insert_select-7314.result2
-rw-r--r--mysql-test/suite/maria/insert_select.result3
-rw-r--r--mysql-test/suite/maria/maria-autozerofill.result5
-rw-r--r--mysql-test/suite/maria/maria-big.result2
-rw-r--r--mysql-test/suite/maria/maria-gis-recovery.result17
-rw-r--r--mysql-test/suite/maria/maria-mvcc.result11
-rw-r--r--mysql-test/suite/maria/maria-no-logging.result14
-rw-r--r--mysql-test/suite/maria/maria-purge.result5
-rw-r--r--mysql-test/suite/maria/maria-recovery-big.result11
-rw-r--r--mysql-test/suite/maria/maria-recovery-bitmap.result16
-rw-r--r--mysql-test/suite/maria/maria-recovery-rtree-ft.result29
-rw-r--r--mysql-test/suite/maria/maria-recovery.result55
-rw-r--r--mysql-test/suite/maria/maria-recovery2.result25
-rw-r--r--mysql-test/suite/maria/maria-recovery3.result25
-rw-r--r--mysql-test/suite/maria/maria.result29
-rw-r--r--mysql-test/suite/maria/maria3.result3
-rw-r--r--mysql-test/suite/maria/maria_notembedded.result14
-rw-r--r--mysql-test/suite/maria/maria_showlog_error.result11
-rw-r--r--mysql-test/suite/multi_source/gtid.result31
-rw-r--r--mysql-test/suite/multi_source/gtid_ignore_duplicates.result56
-rw-r--r--mysql-test/suite/multi_source/info_logs.result10
-rw-r--r--mysql-test/suite/multi_source/load_data.result20
-rw-r--r--mysql-test/suite/multi_source/multisource.result23
-rw-r--r--mysql-test/suite/multi_source/relaylog_events.result8
-rw-r--r--mysql-test/suite/multi_source/reset_slave.result6
-rw-r--r--mysql-test/suite/multi_source/simple.result13
-rw-r--r--mysql-test/suite/multi_source/skip_counter.result10
-rw-r--r--mysql-test/suite/multi_source/status_vars.result10
-rw-r--r--mysql-test/suite/multi_source/syntax.result1
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result6
-rw-r--r--mysql-test/suite/parts/inc/part_exch_qa_5.inc8
-rw-r--r--mysql-test/suite/parts/inc/part_exch_qa_7.inc6
-rw-r--r--mysql-test/suite/parts/inc/part_exch_qa_8.inc7
-rw-r--r--mysql-test/suite/parts/inc/partition_auto_increment.inc21
-rw-r--r--mysql-test/suite/parts/inc/partition_exchange.inc7
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_archive.result48
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_blackhole.result48
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_innodb.result48
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_maria.result48
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_memory.result48
-rw-r--r--mysql-test/suite/parts/r/partition_auto_increment_myisam.result48
-rw-r--r--mysql-test/suite/parts/r/partition_debug_sync_innodb.result13
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result6
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result6
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_6.result8
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result2
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result2
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result4
-rw-r--r--[-rwxr-xr-x]mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result4
-rw-r--r--mysql-test/suite/parts/r/partition_exchange_innodb.result11
-rw-r--r--mysql-test/suite/parts/r/partition_exchange_memory.result11
-rw-r--r--mysql-test/suite/parts/r/partition_exchange_myisam.result11
-rw-r--r--mysql-test/suite/parts/r/partition_innodb_status_file.result5
-rw-r--r--mysql-test/suite/parts/r/partition_special_innodb.result37
-rw-r--r--mysql-test/suite/parts/r/partition_special_myisam.result12
-rw-r--r--mysql-test/suite/parts/r/rpl_partition.result9
-rw-r--r--mysql-test/suite/parts/t/partition_debug_sync_innodb.test5
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_6.test13
-rw-r--r--mysql-test/suite/parts/t/partition_innodb_status_file.test2
-rw-r--r--mysql-test/suite/parts/t/partition_special_myisam.test5
-rw-r--r--mysql-test/suite/parts/t/rpl_partition.test3
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.result20
-rw-r--r--mysql-test/suite/percona/percona_innodb_deadlock_count.test10
-rw-r--r--mysql-test/suite/percona/percona_innodb_fake_changes_locks.result4
-rw-r--r--mysql-test/suite/perfschema/include/event_aggregate_load.inc24
-rw-r--r--mysql-test/suite/perfschema/include/table_aggregate_load.inc18
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result3
-rw-r--r--mysql-test/suite/perfschema/r/connect_attrs.result5
-rw-r--r--mysql-test/suite/perfschema/r/connection.result33
-rw-r--r--mysql-test/suite/perfschema/r/connection_3a.result33
-rw-r--r--mysql-test/suite/perfschema/r/connection_3a_3u.result33
-rw-r--r--mysql-test/suite/perfschema/r/connection_3u.result33
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_h.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u.result37
-rw-r--r--mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result37
-rw-r--r--mysql-test/suite/perfschema/r/global_read_lock.result4
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result10
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result18
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_format.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result44
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result15
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result7
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result7
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result10
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result18
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result44
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result15
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result7
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result5
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result9
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result7
-rw-r--r--mysql-test/suite/perfschema/r/hostcache_peer_addr.result5
-rw-r--r--mysql-test/suite/perfschema/r/nesting.result5
-rw-r--r--mysql-test/suite/perfschema/r/one_thread_per_con.result19
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result14
-rw-r--r--mysql-test/suite/perfschema/r/read_only.result6
-rw-r--r--mysql-test/suite/perfschema/r/relaylog.result4
-rw-r--r--mysql-test/suite/perfschema/r/rpl_gtid_func.result12
-rw-r--r--mysql-test/suite/perfschema/r/rpl_statements.result33
-rw-r--r--mysql-test/suite/perfschema/r/setup_actors.result45
-rw-r--r--mysql-test/suite/perfschema/r/socket_connect.result8
-rw-r--r--mysql-test/suite/perfschema/r/socket_instances_func.result21
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result11
-rw-r--r--mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result13
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_function.result8
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_global.result8
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_procedure.result8
-rw-r--r--mysql-test/suite/perfschema/r/stage_mdl_table.result8
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_off.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result33
-rw-r--r--mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result33
-rw-r--r--mysql-test/suite/perfschema/r/thread_cache.result18
-rw-r--r--mysql-test/suite/perfschema/t/global_read_lock.test5
-rw-r--r--mysql-test/suite/perfschema/t/nesting.test4
-rw-r--r--mysql-test/suite/perfschema/t/one_thread_per_con.test9
-rw-r--r--mysql-test/suite/perfschema/t/read_only.test8
-rw-r--r--mysql-test/suite/perfschema/t/relaylog.test1
-rw-r--r--mysql-test/suite/perfschema/t/rpl_gtid_func.test6
-rw-r--r--mysql-test/suite/perfschema/t/rpl_statements.test26
-rw-r--r--mysql-test/suite/perfschema/t/setup_actors.test23
-rw-r--r--mysql-test/suite/perfschema/t/socket_instances_func.test9
-rw-r--r--mysql-test/suite/plugins/r/auth_v0100.result4
-rw-r--r--mysql-test/suite/plugins/r/qc_info_priv.result3
-rw-r--r--mysql-test/suite/plugins/r/server_audit.result9
-rw-r--r--mysql-test/suite/plugins/r/thread_pool_server_audit.result9
-rw-r--r--mysql-test/suite/roles/admin.result2
-rw-r--r--mysql-test/suite/roles/create_and_drop_role.result3
-rw-r--r--mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result1
-rw-r--r--mysql-test/suite/roles/default_create_user_not_role.result2
-rw-r--r--mysql-test/suite/roles/definer.result3
-rw-r--r--mysql-test/suite/roles/drop_current_user-5176.result1
-rw-r--r--mysql-test/suite/roles/drop_routines.result2
-rw-r--r--mysql-test/suite/roles/grant-5771.result2
-rw-r--r--mysql-test/suite/roles/grant_empty.result2
-rw-r--r--mysql-test/suite/roles/grant_role_auto_create_user.result16
-rw-r--r--mysql-test/suite/roles/i_s_applicable_roles_is_default.test1
-rw-r--r--mysql-test/suite/roles/ip-6401.result2
-rw-r--r--mysql-test/suite/roles/rebuild_role_grants.result3
-rw-r--r--mysql-test/suite/roles/recursive.result31
-rw-r--r--mysql-test/suite/roles/recursive_dbug.result31
-rw-r--r--mysql-test/suite/roles/rpl_definer.result3
-rw-r--r--mysql-test/suite/roles/rpl_definer.test2
-rw-r--r--mysql-test/suite/roles/set_and_drop.result11
-rw-r--r--mysql-test/suite/roles/set_default_role_new_connection.result12
-rw-r--r--mysql-test/suite/roles/set_role-5232.result3
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.result1
-rw-r--r--mysql-test/suite/roles/show_grants_replicated.test3
-rw-r--r--mysql-test/suite/rpl/include/rpl_innodb_rows_counters.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_db.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_event.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_select.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_table.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_user.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_check_view.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_ddl.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_mixed_dml.inc2
-rw-r--r--mysql-test/suite/rpl/include/rpl_set_statement.inc5
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_mix.result22
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_row.result22
-rw-r--r--mysql-test/suite/rpl/r/create_or_replace_statement.result22
-rw-r--r--mysql-test/suite/rpl/r/create_select.result7
-rw-r--r--mysql-test/suite/rpl/r/failed_create_view-6409.result3
-rw-r--r--mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result4
-rw-r--r--mysql-test/suite/rpl/r/kill_hard-6290.result1
-rw-r--r--mysql-test/suite/rpl/r/last_insert_id.result4
-rw-r--r--mysql-test/suite/rpl/r/myisam_external_lock.result2
-rw-r--r--mysql-test/suite/rpl/r/mysql-wsrep#110-2.result1
-rw-r--r--mysql-test/suite/rpl/r/replace.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_000010.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_000011.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_000013.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_000017.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_LD_INFILE.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_alter_db.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment.result45
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_11932.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result94
-rw-r--r--mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_corruption.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_errors.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_binlog_index.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_bit_npk.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_blackhole.result56
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug26395.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug31076.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug33931.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug37426.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_bug41902.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_change_master.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_charset_sjis.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_checksum_cache.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result87
-rw-r--r--mysql-test/suite/rpl/r/rpl_colSize.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_commit_after_flush.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_concurrency_error.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_conditional_comments.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_connection.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_corruption.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_database.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_db.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_event.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_function.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_index.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_procedure.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_role.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_trigger.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_udf.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_user.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_drop_view.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_create_if_not_exists.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_cross_version.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_current_user.result34
-rw-r--r--mysql-test/suite/rpl/r/rpl_ddl.result927
-rw-r--r--mysql-test/suite/rpl/r/rpl_deadlock_innodb.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_delete_no_where.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_do_grant.result64
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter.result61
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result34
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_db_fail.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_temp.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_drop_view.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_dual_pos_advance.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_empty_master_host.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_err_ignoredtable.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_events.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result72
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result72
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result122
-rw-r--r--mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result122
-rw-r--r--mysql-test/suite/rpl/r/rpl_failed_optimize.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_flush_logs.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_flushlog_loop.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_free_items.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_function_defaults.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_geometry.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_get_lock.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_grant.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_basic.result77
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash_myisam.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_errorlog.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_ignored.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_master_promote.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_misc.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_reconnect.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_sort.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_startpos.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_stop_start.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_strict.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_until.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_basic.result43
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_debug.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_hrtime_row.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_idempotency.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_grant.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_revoke.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_ignore_table_update.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_incident.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_init_slave_errors.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug28430.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug30888.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_bug68220.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result124
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff21
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_delayed.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_id_pk.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_insert_ignore.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_invoked_features.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_ip_mix2.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_ipv6.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_killed_ddl.result84
-rw-r--r--mysql-test/suite/rpl/r/rpl_known_bugs_detection.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_charset.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_fatal.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_m.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_map.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_s.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_simple.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddata_symlink.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_loaddatalocal.result37
-rw-r--r--mysql-test/suite/rpl/r/rpl_loadfile.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_locale.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_log_pos.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_manual_change_index_file.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_many_optimize.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_master_pos_wait.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev359.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev382.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev6020.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev6386.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_mdev8193.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_misc_functions.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_mix_found_rows.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_delete2.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_engine.result83
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update2.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update3.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_multi_update4.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_mysql_upgrade.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_name_const.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_not_null_innodb.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_not_null_myisam.result35
-rw-r--r--mysql-test/suite/rpl/r/rpl_old_decimal.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_old_master.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_optimize.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_packet.result25
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel.result251
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel2.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_charset.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_multilevel.result44
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_no_log_slave_updates.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic.result63
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_partition.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_retry.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_parallel_temptable.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_partition_innodb.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_partition_memory.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_partition_myisam.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_password_boundaries.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_performance_schema.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_plugin_load.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_ps.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_read_only.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_innodb.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_relay_space_myisam.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayrotate.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_relayspace.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_do.result18
-rw-r--r--mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_report.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_report_port.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_rewrt_db.result59
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_logs.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_001.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_4_bytes.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_NOW.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_USER.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_UUID.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_annotate_do.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_annotate_dont.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result61
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result111
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result114
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_basic_8partition.result98
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_innodb.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_blob_myisam.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_colSize.result82
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_conflicts.result43
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_corruption.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_select.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_create_table.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_delayed_ins.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_find_row.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_find_row_debug.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func001.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func002.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_func003.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_idempotency.result48
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_blobs.result2224
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_eng_min.result1268
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result1268
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_index_choice.result53
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_log_innodb.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_max_relay_size.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_merge_engine.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mixing_engines.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_reset_slave.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result36
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp001.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp003.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp005.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result16
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp008.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp009.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp010.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp011.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_sp012.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result53
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result53
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result38
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_to_stmt.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig001.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig002.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig003.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trig004.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_triggers.result55
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_trunc_temp.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_until.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_utf16.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_utf32.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_view01.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_row_wide_table.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_savepoint.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync.result81
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result81
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result81
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event.result113
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result113
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id1.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id2.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_server_id_ignore.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_session_var.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_charset.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_null_innodb.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_null_myisam.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement_default_master.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_hosts.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_show_slave_running.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_error.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_incident.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_skip_replication.result60
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_grp_exec.result23
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_in.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_skip.result50
-rw-r--r--mysql-test/suite/rpl/r/rpl_slave_status.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_slow_query_log.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp.result93
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp004.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_sp_effects.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_special_charset.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_sporadic_master.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_ssl1.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_start_stop_slave.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_000001.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_EE_err2.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_conflicts.result20
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result4
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_found_rows.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_innodb.result32
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result27
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_loadfile.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_log.result11
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_maria.result3
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_multi_query.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_no_op.result22
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_reset_slave.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_sql_mode.result1
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result46
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result14
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result17
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_user_variables.result33
-rw-r--r--mysql-test/suite/rpl/r/rpl_stop_slave.result57
-rw-r--r--mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result30
-rw-r--r--mysql-test/suite/rpl/r/rpl_sync.result12
-rw-r--r--mysql-test/suite/rpl/r/rpl_table_options.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result24
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result10
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_mysql56.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result6
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary.result44
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_error2.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_temporary_errors.result13
-rw-r--r--mysql-test/suite/rpl/r/rpl_test_framework.result47
-rw-r--r--mysql-test/suite/rpl/r/rpl_timezone.result26
-rw-r--r--mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_trigger.result134
-rw-r--r--mysql-test/suite/rpl/r/rpl_trunc_temp.result7
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_2myisam.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_truncate_3innodb.result28
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_typeconv_innodb.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_udf.result31
-rw-r--r--mysql-test/suite/rpl/r/rpl_unsafe_statements.result8
-rw-r--r--mysql-test/suite/rpl/r/rpl_user.result9
-rw-r--r--mysql-test/suite/rpl/r/rpl_user_variables.result54
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables.result19
-rw-r--r--mysql-test/suite/rpl/r/rpl_variables_stm.result15
-rw-r--r--mysql-test/suite/rpl/r/rpl_view.result37
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_debug.result5
-rw-r--r--mysql-test/suite/rpl/r/rpl_view_multi.result43
-rw-r--r--mysql-test/suite/rpl/r/sec_behind_master-5114.result2
-rw-r--r--mysql-test/suite/rpl/r/semisync_future-7591.result6
-rw-r--r--mysql-test/suite/rpl/r/semisync_memleak_4066.result3
-rw-r--r--mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result3
-rw-r--r--mysql-test/suite/rpl/r/temporal_row-9560.result2
-rw-r--r--mysql-test/suite/rpl/t/create_or_replace2.test2
-rw-r--r--mysql-test/suite/rpl/t/create_select.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_bug26395.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_charset_sjis.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_create_drop_index.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_current_user.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter.test31
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test16
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test25
-rw-r--r--mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_drop_temp.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_events.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_dbs_dynamic.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_function_defaults.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_grant.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_ignore_table.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ip_mix2.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ipv6.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_killed_ddl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddata_map.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_loaddatalocal.test14
-rw-r--r--mysql-test/suite/rpl/t/rpl_mix_found_rows.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_name_const.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_password_boundaries.test15
-rw-r--r--mysql-test/suite/rpl/t/rpl_plugin_load.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_ps.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_replicate_do.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_rewrt_db.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test21
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_basic_8partition.test18
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_conflicts.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_create_table.test6
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_drop.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test34
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp005.test8
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp008.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_sp012.test4
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_triggers.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_row_utf16.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_savepoint.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync.test29
-rw-r--r--mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test12
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_charset.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_skip_error.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_skip.test19
-rw-r--r--mysql-test/suite/rpl/t/rpl_slave_status.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp.test13
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test2
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_found_rows.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_until.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_stm_user_variables.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test23
-rw-r--r--mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_temporary_errors.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_trigger.test11
-rw-r--r--mysql-test/suite/rpl/t/rpl_user_variables.test20
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables.test7
-rw-r--r--mysql-test/suite/rpl/t/rpl_variables_stm.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_view.test9
-rw-r--r--mysql-test/suite/rpl/t/rpl_view_multi.test23
-rw-r--r--mysql-test/suite/storage_engine/delete_low_prio.test2
-rw-r--r--mysql-test/suite/storage_engine/insert_delayed.test2
-rw-r--r--mysql-test/suite/storage_engine/insert_high_prio.test2
-rw-r--r--mysql-test/suite/storage_engine/insert_low_prio.test2
-rw-r--r--mysql-test/suite/storage_engine/lock.test2
-rw-r--r--mysql-test/suite/storage_engine/lock_concurrent.result7
-rw-r--r--mysql-test/suite/storage_engine/select_high_prio.test2
-rw-r--r--mysql-test/suite/storage_engine/trx/consistent_snapshot.inc2
-rw-r--r--mysql-test/suite/storage_engine/trx/select_for_update.test2
-rw-r--r--mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test2
-rw-r--r--mysql-test/suite/storage_engine/trx/transaction_isolation.inc2
-rw-r--r--mysql-test/suite/storage_engine/trx/xa.test2
-rw-r--r--mysql-test/suite/storage_engine/trx/xa_recovery.test2
-rw-r--r--mysql-test/suite/storage_engine/update_low_prio.test2
-rw-r--r--mysql-test/suite/stress/r/ddl_archive.result3
-rw-r--r--mysql-test/suite/stress/r/ddl_csv.result3
-rw-r--r--mysql-test/suite/stress/r/ddl_innodb.result3
-rw-r--r--mysql-test/suite/stress/r/ddl_memory.result3
-rw-r--r--mysql-test/suite/stress/r/ddl_myisam.result3
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_increment_func.result14
-rw-r--r--mysql-test/suite/sys_vars/r/auto_increment_offset_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/autocommit_func.result24
-rw-r--r--mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result21
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_client_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_connection_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_database_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_results_func.result9
-rw-r--r--mysql-test/suite/sys_vars/r/character_set_server_func.result14
-rw-r--r--mysql-test/suite/sys_vars/r/collation_connection_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/collation_database_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/collation_server_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/completion_type_func.result27
-rw-r--r--mysql-test/suite/sys_vars/r/concurrent_insert_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/debug_dbug_func.result25
-rw-r--r--mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result9
-rw-r--r--mysql-test/suite/sys_vars/r/default_regex_flags_basic.result6
-rw-r--r--mysql-test/suite/sys_vars/r/delay_key_write_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result34
-rw-r--r--mysql-test/suite/sys_vars/r/div_precision_increment_func.result10
-rw-r--r--mysql-test/suite/sys_vars/r/foreign_key_checks_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/group_concat_max_len_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/identity_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result10
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result14
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_support_xa_func.result15
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_table_locks_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/insert_id_func.result9
-rw-r--r--mysql-test/suite/sys_vars/r/interactive_timeout_func.result3
-rw-r--r--mysql-test/suite/sys_vars/r/key_buffer_size_func.result13
-rw-r--r--mysql-test/suite/sys_vars/r/last_insert_id_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/lc_time_names_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/local_infile_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/log_output_func.result6
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result2
-rw-r--r--mysql-test/suite/sys_vars/r/max_allowed_packet_func.result5
-rw-r--r--mysql-test/suite/sys_vars/r/max_join_size_func.result9
-rw-r--r--mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/max_sort_length_func.result13
-rw-r--r--mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result13
-rw-r--r--mysql-test/suite/sys_vars/r/max_user_connections_func.result18
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/myisam_stats_method_func.result7
-rw-r--r--mysql-test/suite/sys_vars/r/net_buffer_length_basic.result3
-rw-r--r--mysql-test/suite/sys_vars/r/old_passwords_func.result24
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_type_func.result24
-rw-r--r--mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result60
-rw-r--r--mysql-test/suite/sys_vars/r/query_prealloc_size_func.result9
-rw-r--r--mysql-test/suite/sys_vars/r/read_only_func.result10
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_basename_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/relay_log_index_basic.result1
-rw-r--r--mysql-test/suite/sys_vars/r/rpl_init_slave_func.result2
-rw-r--r--mysql-test/suite/sys_vars/r/secure_auth_func.result24
-rw-r--r--mysql-test/suite/sys_vars/r/slow_launch_time_func.result12
-rw-r--r--mysql-test/suite/sys_vars/r/slow_query_log_func.result9
-rw-r--r--mysql-test/suite/sys_vars/r/sql_big_selects_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_buffer_result_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_log_off_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result60
-rw-r--r--mysql-test/suite/sys_vars/r/sql_mode_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_notes_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_safe_updates_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_select_limit_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/sql_warnings_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/thread_cache_size_func.result22
-rw-r--r--mysql-test/suite/sys_vars/r/time_zone_func.result17
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result11
-rw-r--r--mysql-test/suite/sys_vars/r/tx_isolation_func.result90
-rw-r--r--mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result13
-rw-r--r--mysql-test/suite/sys_vars/r/wait_timeout_func.result9
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_increment_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/auto_increment_offset_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/autocommit_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test10
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_client_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_connection_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_database_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_results_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/character_set_server_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/collation_connection_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/collation_database_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/collation_server_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/completion_type_func.test11
-rw-r--r--mysql-test/suite/sys_vars/t/concurrent_insert_func.test10
-rw-r--r--mysql-test/suite/sys_vars/t/debug_dbug_func.test11
-rw-r--r--mysql-test/suite/sys_vars/t/default_regex_flags_basic.test2
-rw-r--r--mysql-test/suite/sys_vars/t/delay_key_write_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test16
-rw-r--r--mysql-test/suite/sys_vars/t/div_precision_increment_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/foreign_key_checks_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/group_concat_max_len_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/identity_func.test9
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test5
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_support_xa_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/innodb_table_locks_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/insert_id_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/interactive_timeout_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/key_buffer_size_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/last_insert_id_func.test9
-rw-r--r--mysql-test/suite/sys_vars/t/lc_time_names_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/local_infile_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/log_output_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test1
-rw-r--r--mysql-test/suite/sys_vars/t/max_allowed_packet_func.test2
-rw-r--r--mysql-test/suite/sys_vars/t/max_join_size_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/max_sort_length_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/max_user_connections_func.test9
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/myisam_stats_method_func.test4
-rw-r--r--mysql-test/suite/sys_vars/t/old_passwords_func.test11
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_type_func.test12
-rw-r--r--mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test29
-rw-r--r--mysql-test/suite/sys_vars/t/query_prealloc_size_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/read_only_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/rpl_init_slave_func.test1
-rw-r--r--mysql-test/suite/sys_vars/t/secure_auth_func.test11
-rw-r--r--mysql-test/suite/sys_vars/t/slow_launch_time_func.test5
-rw-r--r--mysql-test/suite/sys_vars/t/slow_query_log_func.test3
-rw-r--r--mysql-test/suite/sys_vars/t/sql_big_selects_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_buffer_result_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_log_off_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test29
-rw-r--r--mysql-test/suite/sys_vars/t/sql_mode_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_notes_func.test9
-rw-r--r--mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_safe_updates_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_select_limit_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/sql_warnings_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/thread_cache_size_func.test11
-rw-r--r--mysql-test/suite/sys_vars/t/time_zone_func.test8
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test6
-rw-r--r--mysql-test/suite/sys_vars/t/tx_isolation_func.test44
-rw-r--r--mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test7
-rw-r--r--mysql-test/suite/sys_vars/t/wait_timeout_func.test6
-rw-r--r--mysql-test/suite/vcol/r/not_supported.result3
-rw-r--r--mysql-test/suite/vcol/r/rpl_vcol.result4
-rw-r--r--mysql-test/t/alter_table.test4
-rw-r--r--mysql-test/t/alter_user.test3
-rw-r--r--mysql-test/t/analyze_stmt_privileges.test1
-rw-r--r--mysql-test/t/analyze_stmt_privileges2.test1
-rw-r--r--mysql-test/t/auth_rpl.test3
-rw-r--r--mysql-test/t/bug39022.test7
-rw-r--r--mysql-test/t/check.test2
-rw-r--r--mysql-test/t/commit.test32
-rw-r--r--mysql-test/t/consistent_snapshot.test10
-rw-r--r--mysql-test/t/ctype_errors.test2
-rw-r--r--mysql-test/t/ddl_i18n_koi8r.test32
-rw-r--r--mysql-test/t/ddl_i18n_utf8.test29
-rw-r--r--mysql-test/t/debug_sync.test12
-rw-r--r--mysql-test/t/delayed.test28
-rw-r--r--mysql-test/t/events_bugs.test22
-rw-r--r--mysql-test/t/filesort_debug.test3
-rw-r--r--mysql-test/t/flush-innodb-notembedded.test10
-rw-r--r--mysql-test/t/flush-innodb.test44
-rw-r--r--mysql-test/t/flush.test36
-rw-r--r--mysql-test/t/flush_block_commit.test18
-rw-r--r--mysql-test/t/flush_block_commit_notembedded.test8
-rw-r--r--mysql-test/t/flush_read_lock.test145
-rw-r--r--mysql-test/t/flush_read_lock_kill.test6
-rw-r--r--mysql-test/t/func_misc.test16
-rw-r--r--mysql-test/t/grant.test64
-rw-r--r--mysql-test/t/grant2.test17
-rw-r--r--mysql-test/t/grant4.test2
-rw-r--r--mysql-test/t/information_schema.test52
-rw-r--r--mysql-test/t/innodb_mysql_lock.test28
-rw-r--r--mysql-test/t/innodb_mysql_lock2.test8
-rw-r--r--mysql-test/t/innodb_mysql_sync.test47
-rw-r--r--mysql-test/t/kill.test37
-rw-r--r--mysql-test/t/kill_processlist-6619.test1
-rw-r--r--mysql-test/t/kill_query-6728.test1
-rw-r--r--mysql-test/t/lock.test5
-rw-r--r--mysql-test/t/lock_multi.test78
-rw-r--r--mysql-test/t/lock_sync.test35
-rw-r--r--mysql-test/t/log_state.test6
-rw-r--r--mysql-test/t/mdl_sync.test510
-rw-r--r--mysql-test/t/merge-big.test5
-rw-r--r--mysql-test/t/merge.test8
-rw-r--r--mysql-test/t/myisam_debug.test2
-rw-r--r--mysql-test/t/myisam_recover.test9
-rw-r--r--mysql-test/t/mysqlbinlog_row_big.test3
-rw-r--r--mysql-test/t/mysqldump-max.test9
-rw-r--r--mysql-test/t/mysqltest.test5
-rw-r--r--mysql-test/t/not_embedded_server.test3
-rw-r--r--mysql-test/t/partition_debug_sync.test12
-rw-r--r--mysql-test/t/partition_innodb.test13
-rw-r--r--mysql-test/t/partition_innodb_plugin.test9
-rw-r--r--mysql-test/t/partition_innodb_semi_consistent.test10
-rw-r--r--mysql-test/t/partition_innodb_stmt.test4
-rw-r--r--mysql-test/t/partition_sync.test10
-rw-r--r--mysql-test/t/plugin_auth_qa_1.test52
-rw-r--r--mysql-test/t/query_cache_28249.test11
-rw-r--r--mysql-test/t/query_cache_debug.test23
-rw-r--r--mysql-test/t/read_only.test29
-rw-r--r--mysql-test/t/read_only_innodb.test5
-rw-r--r--mysql-test/t/schema.test21
-rw-r--r--mysql-test/t/show_check.test12
-rw-r--r--mysql-test/t/show_grants_with_plugin-7985.test1
-rw-r--r--mysql-test/t/sp-lock.test119
-rw-r--r--mysql-test/t/sp-security.test34
-rw-r--r--mysql-test/t/sp_notembedded.test4
-rw-r--r--mysql-test/t/sp_sync.test12
-rw-r--r--mysql-test/t/ssl_connect.test2
-rw-r--r--mysql-test/t/status.test6
-rw-r--r--mysql-test/t/trans_read_only.test3
-rw-r--r--mysql-test/t/trigger-compat.test2
-rw-r--r--mysql-test/t/trigger-trans.test3
-rw-r--r--mysql-test/t/trigger_notembedded.test64
-rw-r--r--mysql-test/t/truncate_coverage.test40
-rw-r--r--mysql-test/t/variables.test2
-rw-r--r--mysql-test/t/view.test8
-rw-r--r--mysql-test/t/view_grant.test35
-rw-r--r--mysql-test/t/wait_timeout.test19
-rw-r--r--mysql-test/t/xa.test10
-rw-r--r--storage/connect/mysql-test/connect/r/grant.result58
-rw-r--r--storage/connect/mysql-test/connect/r/grant2.result79
-rw-r--r--storage/connect/mysql-test/connect/r/ini_grant.result8
-rw-r--r--storage/connect/mysql-test/connect/r/mysql_discovery.result9
-rw-r--r--storage/connect/mysql-test/connect/r/mysql_exec.result8
-rw-r--r--storage/connect/mysql-test/connect/r/mysql_grant.result8
-rw-r--r--storage/connect/mysql-test/connect/r/mysql_new.result19
-rw-r--r--storage/connect/mysql-test/connect/r/xml_grant.result10
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result4
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result5
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result5
-rw-r--r--storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result3
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/connections_mdev5748.result3
-rw-r--r--storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result6
-rw-r--r--storage/spider/mysql-test/spider/bg/r/basic_sql.result104
-rw-r--r--storage/spider/mysql-test/spider/bg/r/basic_sql_part.result20
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_aggregate.result9
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result8
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_update.result9
-rw-r--r--storage/spider/mysql-test/spider/bg/r/direct_update_part.result8
-rw-r--r--storage/spider/mysql-test/spider/bg/r/function.result11
-rw-r--r--storage/spider/mysql-test/spider/bg/r/ha.result26
-rw-r--r--storage/spider/mysql-test/spider/bg/r/ha_part.result24
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider3_fixes.result14
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result14
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider_fixes.result49
-rw-r--r--storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result21
-rw-r--r--storage/spider/mysql-test/spider/bg/r/vp_fixes.result13
-rw-r--r--storage/spider/mysql-test/spider/r/basic_sql.result104
-rw-r--r--storage/spider/mysql-test/spider/r/basic_sql_part.result20
-rw-r--r--storage/spider/mysql-test/spider/r/direct_aggregate.result9
-rw-r--r--storage/spider/mysql-test/spider/r/direct_aggregate_part.result8
-rw-r--r--storage/spider/mysql-test/spider/r/direct_update.result9
-rw-r--r--storage/spider/mysql-test/spider/r/direct_update_part.result8
-rw-r--r--storage/spider/mysql-test/spider/r/function.result11
-rw-r--r--storage/spider/mysql-test/spider/r/ha.result26
-rw-r--r--storage/spider/mysql-test/spider/r/ha_part.result24
-rw-r--r--storage/spider/mysql-test/spider/r/spider3_fixes.result14
-rw-r--r--storage/spider/mysql-test/spider/r/spider3_fixes_part.result14
-rw-r--r--storage/spider/mysql-test/spider/r/spider_fixes.result49
-rw-r--r--storage/spider/mysql-test/spider/r/spider_fixes_part.result21
-rw-r--r--storage/spider/mysql-test/spider/r/vp_fixes.result13
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result8
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result72
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result122
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result8
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result35
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result9
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result12
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result13
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result8
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result2
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result114
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result10
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result11
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result12
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result16
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result53
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result12
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result22
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result3
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result2
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result20
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result124
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result9
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result28
-rw-r--r--storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result5
-rw-r--r--storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result3
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-del-0.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-del-1.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-del-fast.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-del-slow.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-insert-0.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-insert-1.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-insert-2.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-insert-bigchar.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-update-0.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/hotindex-update-1.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/lockretry-insert.writelocktable.result4004
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert.result4003
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert2.result4003
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-blocking-row-locks.result399
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-delete-deadlock-1.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-no-read-lock-serializable-autocommit.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-select-update-1.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-select-update-2.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/locks-update-deadlock-1.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-10.result27
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-11.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-12.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-13.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-14.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-15.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-16.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-17.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-18.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-2.result9
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-21.result27
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-22.result27
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-23.result27
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-24.result13
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-25.result16
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-28.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-committed.result11
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-uncommitted.result11
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-29.result9
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-3.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-30.result9
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-31.result9
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-33.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-34.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-35.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-36.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-37.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-38.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-39.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-4.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-40.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-5.result14
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-6.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-7.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-8.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-9.result27
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/mvcc-checksum-locks.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/rows-32m-0.result3
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/rows-32m-1.result3
-rw-r--r--storage/tokudb/mysql-test/tokudb/r/tokudb_support_xa.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_dels.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/1853.result46
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/2494-read-committed.result11
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/2641.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/2952.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/5974-2.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/5974.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/db801.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/fileops-2.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/fileops-4.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/ft-index-40.result10
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/leak172.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_empty.result14
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_left.result14
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_middle.result14
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_right.result14
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/rpl_mixed_replace_into.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/rpl_row_replace_into.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/rpl_stmt_replace_into.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb_bugs/r/xa.result31
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/r/autoinc.result7
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result3
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/r/optimize.result3
-rw-r--r--storage/tokudb/mysql-test/tokudb_mariadb/r/xa.result5
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result48
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result8
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result6
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_7_tokudb.result2
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_8_tokudb.result4
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result11
-rw-r--r--storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result37
1559 files changed, 38534 insertions, 9891 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 8fc8f30a9e4..13c642df932 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -127,7 +127,7 @@ static my_bool parsing_disabled= 0;
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
display_metadata= FALSE, display_result_sorted= FALSE;
static my_bool disable_query_log= 0, disable_result_log= 0;
-static my_bool disable_connect_log= 1;
+static my_bool disable_connect_log= 0;
static my_bool disable_warnings= 0, disable_column_names= 0;
static my_bool prepare_warnings_enabled= 0;
static my_bool disable_info= 1;
diff --git a/mysql-test/extra/binlog_tests/binlog_truncate.test b/mysql-test/extra/binlog_tests/binlog_truncate.test
index d434f792db0..4d297cd2d5c 100644
--- a/mysql-test/extra/binlog_tests/binlog_truncate.test
+++ b/mysql-test/extra/binlog_tests/binlog_truncate.test
@@ -39,29 +39,24 @@ if ($before_truncate) {
eval $before_truncate;
}
---echo # Connection: default
BEGIN;
INSERT INTO t2 SELECT * FROM t1;
connect (truncate,localhost,root,,);
---echo # Connection: truncate
send TRUNCATE TABLE t1;
connection default;
---echo # Connection: default
INSERT INTO t2 SELECT * FROM t1;
SELECT COUNT(*) FROM t2;
COMMIT;
connection truncate;
---echo # Connection: truncate
--echo # Reaping TRUNCATE TABLE
--reap
SELECT COUNT(*) FROM t1;
SELECT COUNT(*) FROM t2;
connection default;
---echo # Connection: default
source include/show_binlog_events.inc;
disconnect truncate;
diff --git a/mysql-test/extra/rpl_tests/rpl_blackhole.test b/mysql-test/extra/rpl_tests/rpl_blackhole.test
index 1a0eeb3cf15..a37d24b4cd6 100644
--- a/mysql-test/extra/rpl_tests/rpl_blackhole.test
+++ b/mysql-test/extra/rpl_tests/rpl_blackhole.test
@@ -14,11 +14,9 @@
connection slave;
let $before = query_get_value("SHOW MASTER STATUS", Position, 1);
---echo [on master]
connection master;
eval $statement;
---echo [on slave]
sync_slave_with_master;
--echo # Expect 0
SELECT COUNT(*) FROM t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_charset.test b/mysql-test/extra/rpl_tests/rpl_charset.test
index 5009dff8d73..37ca2e28eec 100644
--- a/mysql-test/extra/rpl_tests/rpl_charset.test
+++ b/mysql-test/extra/rpl_tests/rpl_charset.test
@@ -7,15 +7,9 @@ set timestamp=1000000000;
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;
@@ -23,14 +17,8 @@ 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;
@@ -45,10 +33,8 @@ 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);
---echo --- --master--
select * from t1 order by a;
sync_slave_with_master;
---echo --- --slave--
select * from mysqltest2.t1 order by a;
connection master;
@@ -59,10 +45,8 @@ 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"));
---echo --- --master--
select * from t1 order by a;
sync_slave_with_master;
---echo --- --slave--
select * from mysqltest2.t1 order by a;
# Presently charset info is not logged with LOAD DATA but it will
@@ -81,10 +65,8 @@ connection master;
set @a= _cp850 'Müller' collate cp850_general_ci;
truncate table t1;
insert into t1 (b) values(collation(@a));
---echo --- --master--
select * from t1 order by a;
sync_slave_with_master;
---echo --- --slave--
select * from mysqltest2.t1 order by a;
connection master;
diff --git a/mysql-test/extra/rpl_tests/rpl_conflicts.test b/mysql-test/extra/rpl_tests/rpl_conflicts.test
index b9bff3993e6..a8c796af50c 100644
--- a/mysql-test/extra/rpl_tests/rpl_conflicts.test
+++ b/mysql-test/extra/rpl_tests/rpl_conflicts.test
@@ -57,10 +57,8 @@
--echo ==== Initialize ====
---echo [on master]
connection master;
CREATE TABLE t1(a INT PRIMARY KEY);
---echo [on slave]
sync_slave_with_master;
@@ -71,14 +69,12 @@ sync_slave_with_master;
INSERT INTO t1 VALUES (1);
--echo ---- Insert rows on master ----
---echo [on master]
connection master;
# Insert the same row on master
INSERT INTO t1 VALUES (1);
save_master_pos;
SELECT * FROM t1;
---echo [on slave]
connection slave;
# If we are statement-logging or if slave_exec_mode=STRICT, we now
@@ -117,23 +113,19 @@ SELECT * FROM t1;
--echo ==== Test: SQL thread sees 'DELETE' of non-existing row ====
--echo ---- On master, insert two rows, the second with binlogging off ----
---echo [on master]
connection master;
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
---echo [on slave]
sync_slave_with_master;
DELETE FROM t1 WHERE a = 1;
--echo ---- On master, remove the row that does not exist on slave ----
---echo [on master]
connection master;
DELETE FROM t1 WHERE a = 1;
SELECT * FROM t1;
save_master_pos;
---echo [on slave]
connection slave;
# If we are row-logging and slave_exec_mode is STRICT, we now expect
@@ -172,9 +164,7 @@ SELECT * FROM t1;
--echo ==== Clean up ====
---echo [on master]
connection master;
DROP TABLE t1;
---echo [on slave]
--sync_slave_with_master
diff --git a/mysql-test/extra/rpl_tests/rpl_ddl.test b/mysql-test/extra/rpl_tests/rpl_ddl.test
index 21778a11df5..e466a08a541 100644
--- a/mysql-test/extra/rpl_tests/rpl_ddl.test
+++ b/mysql-test/extra/rpl_tests/rpl_ddl.test
@@ -133,8 +133,6 @@ set local sql_mode='';
# The sync_slave_with_master is needed to make the xids deterministic.
sync_slave_with_master;
---echo
---echo -------- switch to master -------
connection master;
SET AUTOCOMMIT = 1;
#
@@ -186,13 +184,9 @@ eval CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=$temp_engine_type;
SET AUTOCOMMIT = 0;
use mysqltest1;
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
SET AUTOCOMMIT = 1;
use mysqltest1;
---echo
---echo -------- switch to master -------
connection master;
@@ -260,12 +254,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't2';
---echo
---echo -------- switch to slave --------
connection slave;
SHOW TABLES LIKE 't2';
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= DROP TEMPORARY TABLE mysqltest1.t23;
@@ -273,12 +263,8 @@ let $my_master_commit= false;
let $my_slave_commit= false;
--source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't23';
---echo
---echo -------- switch to slave --------
connection slave;
SHOW TABLES LIKE 't23';
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
@@ -286,12 +272,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TABLES LIKE 't20';
---echo
---echo -------- switch to slave --------
connection slave;
SHOW TABLES LIKE 't20';
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
@@ -299,12 +281,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
describe mysqltest1.t4;
---echo
---echo -------- switch to slave --------
connection slave;
describe mysqltest1.t4;
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= $engine_type;
@@ -326,12 +304,8 @@ let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT * FROM mysqltest1.t7;
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
SELECT * FROM mysqltest1.t7;
---echo
---echo -------- switch to master -------
connection master;
###############################################################
@@ -383,12 +357,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW INDEX FROM mysqltest1.t6;
---echo
---echo -------- switch to slave --------
connection slave;
SHOW INDEX FROM mysqltest1.t6;
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
@@ -396,12 +366,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW INDEX FROM mysqltest1.t5;
---echo
---echo -------- switch to slave --------
connection slave;
SHOW INDEX FROM mysqltest1.t5;
---echo
---echo -------- switch to master -------
connection master;
###############################################################
@@ -413,12 +379,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW DATABASES LIKE "mysqltest2";
---echo
---echo -------- switch to slave --------
connection slave;
SHOW DATABASES LIKE "mysqltest2";
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= CREATE DATABASE mysqltest3;
@@ -426,12 +388,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW DATABASES LIKE "mysqltest3";
---echo
---echo -------- switch to slave --------
connection slave;
SHOW DATABASES LIKE "mysqltest3";
---echo
---echo -------- switch to master -------
connection master;
# End of 4.1 tests
@@ -446,13 +404,9 @@ let $my_slave_commit= true;
--vertical_results
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
---echo
---echo -------- switch to slave --------
connection slave;
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
---echo
---echo -------- switch to master -------
connection master;
--horizontal_results
@@ -463,13 +417,9 @@ let $my_slave_commit= true;
--vertical_results
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
---echo
---echo -------- switch to slave --------
connection slave;
--replace_column 5 # 6 #
SHOW PROCEDURE STATUS LIKE 'p1';
---echo
---echo -------- switch to master -------
connection master;
--horizontal_results
@@ -479,12 +429,8 @@ let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
--vertical_results
SHOW PROCEDURE STATUS LIKE 'p1';
---echo
---echo -------- switch to slave --------
connection slave;
SHOW PROCEDURE STATUS LIKE 'p1';
---echo
---echo -------- switch to master -------
connection master;
--horizontal_results
@@ -496,12 +442,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW CREATE VIEW v1;
---echo
---echo -------- switch to slave --------
connection slave;
SHOW CREATE VIEW v1;
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= ALTER VIEW v1 AS select f1 from t1;
@@ -509,12 +451,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW CREATE VIEW v1;
---echo
---echo -------- switch to slave --------
connection slave;
SHOW CREATE VIEW v1;
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= DROP VIEW IF EXISTS v1;
@@ -523,13 +461,9 @@ let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
--error 1146
SHOW CREATE VIEW v1;
---echo
---echo -------- switch to slave --------
connection slave;
--error 1146
SHOW CREATE VIEW v1;
---echo
---echo -------- switch to master -------
connection master;
###############################################################
@@ -540,12 +474,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TRIGGERS;
---echo
---echo -------- switch to slave --------
connection slave;
SHOW TRIGGERS;
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= DROP TRIGGER trg1;
@@ -553,12 +483,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SHOW TRIGGERS;
---echo
---echo -------- switch to slave --------
connection slave;
SHOW TRIGGERS;
---echo
---echo -------- switch to master -------
connection master;
###############################################################
@@ -569,12 +495,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'user1';
---echo
---echo -------- switch to slave --------
connection slave;
SELECT user FROM mysql.user WHERE user = 'user1';
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= RENAME USER user1@localhost TO rename1@localhost;
@@ -582,12 +504,8 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'rename1';
---echo
---echo -------- switch to slave --------
connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1';
---echo
---echo -------- switch to master -------
connection master;
let $my_stmt= DROP USER rename1@localhost;
@@ -595,8 +513,6 @@ let $my_master_commit= true;
let $my_slave_commit= true;
--source include/rpl_stmt_seq.inc
SELECT user FROM mysql.user WHERE user = 'rename1';
---echo
---echo -------- switch to slave --------
connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1';
@@ -604,8 +520,6 @@ SELECT user FROM mysql.user WHERE user = 'rename1';
# Cleanup
###############################################################
use test;
---echo
---echo -------- switch to master -------
connection master;
DROP TEMPORARY TABLE mysqltest1.t22;
DROP DATABASE mysqltest1;
diff --git a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
index 47d75c0d0b2..a58fa85a72d 100644
--- a/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_extra_col_slave.test
@@ -23,7 +23,6 @@ call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot
### Should Stop Slave ###
##############################################
---echo *** On Slave ***
sync_slave_with_master;
STOP SLAVE;
RESET SLAVE;
diff --git a/mysql-test/extra/rpl_tests/rpl_innodb.test b/mysql-test/extra/rpl_tests/rpl_innodb.test
index 6b3732439b2..2fb1a1c5c79 100644
--- a/mysql-test/extra/rpl_tests/rpl_innodb.test
+++ b/mysql-test/extra/rpl_tests/rpl_innodb.test
@@ -64,7 +64,6 @@ eval CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=$engine_type;
SET AUTOCOMMIT = 0;
sync_slave_with_master;
---echo -------- switch to slave --------
connection slave;
# We want to verify that the following transactions are written to the
@@ -79,7 +78,6 @@ connection slave;
ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
---echo -------- switch to master --------
connection master;
INSERT INTO mysqltest1.t1 SET f1= 1;
DROP TEMPORARY TABLE mysqltest1.tmp;
@@ -98,7 +96,6 @@ SHOW CREATE TABLE mysqltest1.tmp2;
SELECT COUNT(*) FROM mysqltest1.t1;
sync_slave_with_master;
---echo -------- switch to slave --------
connection slave;
--error ER_NO_SUCH_TABLE
SHOW CREATE TABLE mysqltest1.tmp;
@@ -108,7 +105,6 @@ SHOW CREATE TABLE mysqltest1.tmp2;
SELECT COUNT(*) FROM mysqltest1.t1;
FLUSH LOGS;
---echo -------- switch to master --------
connection master;
FLUSH LOGS;
DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
@@ -142,11 +138,9 @@ INSERT INTO t1 (b) VALUES (1),(2),(3);
BEGIN;
INSERT INTO t1(b) VALUES (4);
---echo -------- switch to master1 --------
connection master1;
--send RENAME TABLE t1 TO t3, t2 TO t1;
---echo -------- switch to master --------
connection master;
# Need to wait until RENAME is received
let $wait_condition=
@@ -157,23 +151,19 @@ let $wait_condition=
COMMIT;
---echo -------- switch to master1 --------
connection master1;
--reap
---echo -------- switch to master --------
connection master;
SELECT * FROM t1;
SELECT * FROM t3;
sync_slave_with_master;
---echo -------- switch to slave --------
connection slave;
SELECT * FROM t1;
SELECT * FROM t3;
---echo -------- switch to master --------
connection master;
DROP TABLE t1;
DROP TABLE t3;
diff --git a/mysql-test/extra/rpl_tests/rpl_loaddata.test b/mysql-test/extra/rpl_tests/rpl_loaddata.test
index 67eb137bdf4..e1942dad239 100644
--- a/mysql-test/extra/rpl_tests/rpl_loaddata.test
+++ b/mysql-test/extra/rpl_tests/rpl_loaddata.test
@@ -197,7 +197,6 @@ DROP TABLE t1;
-- eval LOAD DATA $lock_option LOCAL INFILE '$MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1
-- echo ### create connection without default database
--- echo ### connect (conn2,localhost,root,,*NO-ONE*);
connect (conn2,localhost,root,,*NO-ONE*);
-- connection conn2
-- echo ### assertion: works without stating the default database
@@ -216,7 +215,6 @@ connect (conn2,localhost,root,,*NO-ONE*);
-- let $table= $db1.t1
--source include/wait_until_rows_count.inc
--- echo ### disconnect and switch back to master connection
-- disconnect conn2
-- connection master
diff --git a/mysql-test/extra/rpl_tests/rpl_row_basic.test b/mysql-test/extra/rpl_tests/rpl_row_basic.test
index da8787d22f2..f45c8824b10 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_basic.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_basic.test
@@ -216,7 +216,7 @@ if (`select char_length('$bit_field_special') > 0`) {
connection master;
eval CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = $type ;
sync_slave_with_master;
---echo --- on slave: original values ---
+--echo --- original values ---
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
SELECT * FROM t7 ORDER BY C1;
@@ -226,13 +226,13 @@ SELECT * FROM t7 ORDER BY C1;
set @@global.slave_exec_mode= 'IDEMPOTENT';
connection master;
---echo --- on master: new values inserted ---
+--echo --- new values inserted ---
INSERT INTO t7 VALUES (1,2), (2,4), (3,6);
SELECT * FROM t7 ORDER BY C1;
sync_slave_with_master;
set @@global.slave_exec_mode= default;
---echo --- on slave: old values should be overwritten by replicated values ---
+--echo --- old values should be overwritten by replicated values ---
SELECT * FROM t7 ORDER BY C1;
#
@@ -240,7 +240,6 @@ SELECT * FROM t7 ORDER BY C1;
# causing a conflict for a key that is not "last".
#
connection master;
---echo --- on master ---
eval CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = $type ;
# First we make sure that the constraints are correctly set.
@@ -254,7 +253,6 @@ INSERT INTO t8 VALUES (11,22,99);
SELECT * FROM t8 ORDER BY a;
sync_slave_with_master;
---echo --- on slave ---
SELECT * FROM t8 ORDER BY a;
INSERT INTO t8 VALUES (1,2,3), (2,4,6), (3,6,9);
SELECT * FROM t8 ORDER BY a;
@@ -265,14 +263,12 @@ SELECT * FROM t8 ORDER BY a;
set @@global.slave_exec_mode= 'IDEMPOTENT';
connection master;
---echo --- on master ---
# We insert a row that will cause conflict on the primary key but not
# on the other keys.
INSERT INTO t8 VALUES (2,4,8);
sync_slave_with_master;
set @@global.slave_exec_mode= default;
---echo --- on slave ---
SELECT * FROM t8 ORDER BY a;
# BUG#31552: Replication breaks when deleting rows from out-of-sync
@@ -280,7 +276,6 @@ SELECT * FROM t8 ORDER BY a;
--echo **** Test for BUG#31552 ****
---echo **** On Master ****
# Clean up t1 so that we can use it.
connection master;
DELETE FROM t1;
@@ -289,10 +284,8 @@ sync_slave_with_master;
# Just to get a clean binary log
--source include/rpl_reset.inc
---echo **** On Master ****
connection master;
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
---echo **** On Master ****
sync_slave_with_master;
# since bug#31552/31609 idempotency is not default any longer. In order
# the following test DELETE FROM t1 to pass the mode is switched
@@ -313,14 +306,12 @@ query_vertical SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
# (regression test)
--echo **** Test for BUG#37076 ****
---echo **** On Master ****
connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
INSERT INTO t1 VALUES(
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
---echo **** On Slave ****
sync_slave_with_master slave;
SELECT * FROM t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_sp007.test b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
index 492cd2d88f1..4a68dddfdc2 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_sp007.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp007.test
@@ -22,25 +22,16 @@ BEGIN
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
sync_slave_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
sync_slave_with_master;
SELECT * FROM test.t1;
diff --git a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
index 8de2e6974b1..ddff3fa51f7 100644
--- a/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
+++ b/mysql-test/extra/rpl_tests/rpl_row_tabledefs.test
@@ -78,7 +78,6 @@ INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
---echo **** On Master ****
connection master;
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
@@ -89,7 +88,6 @@ INSERT INTO t1_char VALUES (2,5);
SELECT * FROM t1_int ORDER BY a;
SELECT * FROM t1_bit ORDER BY a;
SELECT * FROM t1_char ORDER BY a;
---echo **** On Slave ****
sync_slave_with_master;
set @@global.slave_exec_mode= default;
@@ -97,7 +95,6 @@ SELECT a,b,x FROM t1_int ORDER BY a;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
SELECT a,b,x FROM t1_char ORDER BY a;
---echo **** On Master ****
connection master;
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
@@ -105,7 +102,6 @@ UPDATE t1_bit SET b=2*b WHERE a=2;
SELECT * FROM t1_int ORDER BY a;
SELECT * FROM t1_bit ORDER BY a;
SELECT * FROM t1_char ORDER BY a;
---echo **** On Slave ****
sync_slave_with_master;
SELECT a,b,x FROM t1_int ORDER BY a;
SELECT a,b,HEX(x),HEX(y),HEX(z) FROM t1_bit ORDER BY a;
@@ -132,11 +128,9 @@ INSERT INTO t9 VALUES (2);
sync_slave_with_master;
# Now slave is guaranteed to be running
connection master;
---echo **** On Master ****
INSERT INTO t2 VALUES (2,4);
SELECT * FROM t2;
sync_slave_with_master;
---echo **** On Slave ****
SELECT * FROM t2;
--source include/check_slave_is_running.inc
@@ -200,7 +194,6 @@ SELECT * FROM t8 ORDER BY a;
# update should not generate an error even though there is no default
# for the extra column.
---echo **** On Master ****
connection master;
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
@@ -209,26 +202,21 @@ INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
sync_slave_with_master;
---echo **** On Slave ****
connection slave;
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
---echo **** On Master ****
connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1_nodef ORDER BY a;
---echo **** On Master ****
connection master;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1_nodef ORDER BY a;
diff --git a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
index 40bc7746ccf..32f33b2a31d 100644
--- a/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_start_stop_slave.test
@@ -140,11 +140,11 @@ CREATE TABLE t1 (a INT );
sync_slave_with_master;
--connection slave1
---echo # Slave1: lock table for synchronization
+--echo # lock table for synchronization
LOCK TABLES t1 WRITE;
--connection master
---echo # Master: insert into the table
+--echo # insert into the table
INSERT INTO t1 SELECT SLEEP(4);
--connection slave
@@ -155,11 +155,11 @@ let $wait_condition=
AND INFO = "INSERT INTO t1 SELECT SLEEP(4)";
--source include/wait_condition.inc
---echo # Slave: send slave stop
+--echo # send slave stop
--send STOP SLAVE
--connection slave1
---echo # Slave1: wait for stop slave
+--echo # wait for stop slave
let $wait_condition=
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO = "STOP SLAVE";
@@ -169,7 +169,7 @@ let $wait_condition=
UNLOCK TABLES;
--connection slave
---echo # Slave: wait for the slave to stop
+--echo # wait for the slave to stop
--reap
--source include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/extra/rpl_tests/rpl_stop_slave.test b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
index 0f09faa0301..2ab59f56d7a 100644
--- a/mysql-test/extra/rpl_tests/rpl_stop_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_stop_slave.test
@@ -15,8 +15,6 @@ if (!$tmp_table_stm)
--die $tmp_table_stm is NULL
}
---echo
---echo [ On Master ]
connection master;
BEGIN;
DELETE FROM t1;
@@ -25,8 +23,6 @@ INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE tt1;
COMMIT;
---echo
---echo [ On Slave ]
connection slave;
# To check if slave SQL thread is applying INSERT statement
@@ -37,16 +33,12 @@ source include/wait_show_condition.inc;
send STOP SLAVE SQL_THREAD;
---echo
---echo [ On Slave1 ]
connection slave1;
--echo # To resume slave SQL thread
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
SET DEBUG_SYNC= 'RESET';
---echo
---echo [ On Slave ]
connection slave;
reap;
source include/wait_for_slave_sql_to_stop.inc;
diff --git a/mysql-test/extra/rpl_tests/rpl_test_framework.inc b/mysql-test/extra/rpl_tests/rpl_test_framework.inc
index fb42d2efb9a..9613d31bf1c 100644
--- a/mysql-test/extra/rpl_tests/rpl_test_framework.inc
+++ b/mysql-test/extra/rpl_tests/rpl_test_framework.inc
@@ -62,8 +62,7 @@ while ($masters)
--let $masters= `SELECT SUBSTRING('$masters', LENGTH('$master_i') + 2)`
# Connect to master and execute statement
- --let $rpl_connection_name= server_$master_i
- --source include/rpl_connection.inc
+ connection server_$master_i;
DELETE FROM t1;
--eval INSERT INTO t1 VALUES ($next_number)
}
diff --git a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
index d1d0e06e32f..ddfba6c52c5 100644
--- a/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
+++ b/mysql-test/extra/rpl_tests/rpl_truncate_helper.test
@@ -1,11 +1,9 @@
--source include/rpl_reset.inc
---echo **** On Master ****
connection master;
eval CREATE TABLE t1 (a INT, b LONG) ENGINE=$engine;
INSERT INTO t1 VALUES (1,1), (2,2);
sync_slave_with_master;
---echo **** On Master ****
connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
@@ -14,13 +12,11 @@ let $diff_tables= master:t1, slave:t1;
source include/diff_tables.inc;
--echo ==== Test using a table with delete triggers ====
---echo **** On Master ****
connection master;
SET @count := 1;
eval CREATE TABLE t2 (a INT, b LONG) ENGINE=$engine;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
sync_slave_with_master;
---echo **** On Master ****
connection master;
eval $trunc_stmt t1;
sync_slave_with_master;
diff --git a/mysql-test/include/bug38347.inc b/mysql-test/include/bug38347.inc
index ca1dbfa1bd2..9980084913f 100644
--- a/mysql-test/include/bug38347.inc
+++ b/mysql-test/include/bug38347.inc
@@ -2,16 +2,12 @@
--echo
SHOW GRANTS FOR mysqltest_u1@localhost;
---echo
---echo # connection: con1 (mysqltest_u1@mysqltest_db1)
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
--connection con1
--echo
SHOW CREATE TABLE t1;
---echo
---echo # connection: default
--connection default
--disconnect con1
diff --git a/mysql-test/include/concurrent.inc b/mysql-test/include/concurrent.inc
index 2912287be8e..c6d8775af6b 100644
--- a/mysql-test/include/concurrent.inc
+++ b/mysql-test/include/concurrent.inc
@@ -64,7 +64,6 @@ drop table if exists t1;
--echo **
--echo ** two UPDATE's running and both changing distinct result sets
--echo **
- --echo ** connection thread1
connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -84,7 +83,6 @@ drop table if exists t1;
--echo ** Get user level lock (ULL) for thread 1
select get_lock("hello",10);
- --echo ** connection thread2
connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Start transaction for thread 2
@@ -93,7 +91,6 @@ drop table if exists t1;
--echo ** be created and blocked on the first row where tipo=11.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
- --echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -121,7 +118,6 @@ drop table if exists t1;
--echo ** Table is now updated with a new eta on tipo=22 for thread 1.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Release the lock and collect result from update on thread 2
reap;
@@ -134,7 +130,6 @@ drop table if exists t1;
--echo ** Sending commit on thread 2.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Make sure table reads didn't change yet on thread 1.
select * from t1;
@@ -144,16 +139,13 @@ drop table if exists t1;
--echo ** thread 1,2.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Make sure the output is similar for t1.
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -162,7 +154,6 @@ drop table t1;
--echo **
--echo ** two UPDATE's running and one changing result set
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -182,7 +173,6 @@ drop table t1;
--echo ** Get ULL "hello" on thread 1
select get_lock("hello",10);
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Start transaction on thread 2
@@ -192,7 +182,6 @@ drop table t1;
--echo ** blocking ULL is released.
send update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
---echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -219,7 +208,6 @@ drop table t1;
--echo ** The table should still be updated with updates for thread 1 only:
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Release the lock and collect result from thread 2:
reap;
@@ -231,7 +219,6 @@ drop table t1;
select * from t1;
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Thread 2 has committed but the result should remain the same for
--echo ** thread 1 (updated on three places):
@@ -242,15 +229,12 @@ drop table t1;
--echo ** This select should show both updates:
select * from t1;
- --echo ** connection thread2
connection thread2;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -259,7 +243,6 @@ drop table t1;
--echo **
--echo ** One UPDATE and one INSERT .... Monty's test
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -269,7 +252,6 @@ drop table t1;
--echo ** Create ULL 'hello2'
select get_lock("hello2",10);
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
@@ -278,7 +260,6 @@ drop table t1;
--echo ** this will hang waiting on thread 1.
send update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
- --echo ** connection thread1
connection thread1;
let $wait_condition= select count(*)= 1 from information_schema.processlist where state= 'User lock';
--source include/wait_condition.inc
@@ -292,7 +273,6 @@ drop table t1;
--echo ** ..but thread 1 will still see t1 as if nothing has happend:
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** Collect results from thread 2 and release the lock.
reap;
@@ -305,7 +285,6 @@ drop table t1;
--echo ** Commit changes from thread 2
commit;
---echo ** connection default
connection default;
drop table t1;
@@ -314,7 +293,6 @@ drop table t1;
--echo **
--echo ** one UPDATE changing result set and SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -332,7 +310,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
@@ -340,7 +317,6 @@ drop table t1;
--echo ** Select a range for update.
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
@@ -352,7 +328,6 @@ drop table t1;
--echo ** transaction failed and was rolled back.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** The table should look unmodified from thread 2.
select * from t1;
@@ -360,22 +335,18 @@ drop table t1;
--echo ** thread 1 to complete the transaction.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Commit on thread 1.
commit;
- --echo ** connection thread2
connection thread2;
--echo ** The table should not have been changed.
select * from t1;
- --echo ** connection thread1
connection thread1;
--echo ** Even on thread 1:
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -384,7 +355,6 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -402,7 +372,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Starting new transaction on thread 2.
@@ -410,7 +379,6 @@ drop table t1;
--echo ** Starting SELECT .. FOR UPDATE
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo
--echo ** Starting new transaction on thread 1
@@ -433,28 +401,23 @@ drop table t1;
--echo ** have changed.
select * from t1;
- --echo ** connection thread2
connection thread2;
--echo ** The same thing should hold true for the transaction on
--echo ** thread 2
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
--echo ** Even after committing:
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -463,7 +426,6 @@ drop table t1;
--echo **
--echo ** two SELECT ... FOR UPDATE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -481,14 +443,12 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
--echo ** Begin a new transaction on thread 2
begin;
select * from t1 where tipo=2 FOR UPDATE;
- --echo ** connection thread1
connection thread1;
--echo ** Begin a new transaction on thread 1
begin;
@@ -497,7 +457,6 @@ drop table t1;
--error ER_LOCK_WAIT_TIMEOUT
select * from t1 where tipo=1 FOR UPDATE;
- --echo ** connection thread2
connection thread2;
--echo ** Table will be unchanged and the select command will not be
--echo ** blocked:
@@ -505,22 +464,18 @@ drop table t1;
--echo ** Commit transacton on thread 2.
commit;
- --echo ** connection thread1
connection thread1;
--echo ** Commit transaction on thread 1.
commit;
- --echo ** connection thread2
connection thread2;
--echo ** Make sure table isn't blocked on thread 2:
select * from t1;
- --echo ** connection thread1
connection thread1;
--echo ** Make sure table isn't blocked on thread 1:
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -529,7 +484,6 @@ drop table t1;
--echo **
--echo ** one UPDATE changing result set and DELETE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -547,7 +501,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
begin;
@@ -557,33 +510,27 @@ drop table t1;
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
- --echo ** connection thread1
connection thread1;
begin;
--error ER_LOCK_WAIT_TIMEOUT
update t1 set tipo=1 where tipo=2;
select * from t1;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
---echo ** connection default
connection default;
drop table t1;
@@ -592,7 +539,6 @@ drop table t1;
--echo **
--echo ** one UPDATE not changing result set and DELETE
--echo **
- --echo ** connection thread1
#connect (thread1, localhost, mysqltest,,);
connection thread1;
--echo ** Set up table
@@ -610,7 +556,6 @@ drop table t1;
insert into t1 values (80,22,"jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj");
insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
- --echo ** connection thread2
#connect (thread2, localhost, mysqltest,,);
connection thread2;
begin;
@@ -620,7 +565,6 @@ drop table t1;
# 'innodb_deleted_rows' and infos in processlist where not sucessful.
sleep 1;
- --echo ** connection thread1
connection thread1;
begin;
--echo ** Update on t1 will cause a table scan which will be blocked because
@@ -639,22 +583,18 @@ drop table t1;
}
select * from t1;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
send commit;
- --echo ** connection thread1
connection thread1;
commit;
- --echo ** connection thread2
connection thread2;
reap;
select * from t1;
- --echo ** connection thread1
connection thread1;
select * from t1;
@@ -662,11 +602,9 @@ drop table t1;
connection thread1;
disconnect thread1;
--source include/wait_until_disconnected.inc
---echo ** connection thread2
connection thread2;
disconnect thread2;
--source include/wait_until_disconnected.inc
---echo ** connection default
connection default;
drop table t1;
drop user mysqltest@localhost;
diff --git a/mysql-test/include/deadlock.inc b/mysql-test/include/deadlock.inc
index 84d23b80811..2fa61f48624 100644
--- a/mysql-test/include/deadlock.inc
+++ b/mysql-test/include/deadlock.inc
@@ -10,9 +10,7 @@
# main code went into include/deadlock.inc
#
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--disable_warnings
@@ -23,14 +21,12 @@ drop table if exists t1,t2;
# Testing of FOR UPDATE
#
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = $engine_type;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -39,18 +35,15 @@ set autocommit=0;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
@@ -60,7 +53,6 @@ drop table t1;
# Testing of FOR UPDATE
#
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = $engine_type;
eval create table t2 (b integer, a integer) engine = $engine_type;
@@ -73,7 +65,6 @@ update t2 set a=100 where b=(SELECT x from t1 where id = b FOR UPDATE);
select * from t2;
select * from t1;
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -82,18 +73,15 @@ set autocommit=0;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
@@ -105,13 +93,11 @@ insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30);
commit;
---echo # Switch to connection con1
connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
select * from t2;
select * from t1;
---echo # Switch to connection con2
connection con2;
# The following query should hang because con1 is locking the record
@@ -121,24 +107,20 @@ select * from t2;
update t1 set x=2 where id = 0;
--sleep 2
---echo # Switch to connection con1
connection con1;
update t1 set x=1 where id = 0;
select * from t1;
commit;
---echo # Switch to connection con2
connection con2;
reap;
commit;
---echo # Switch to connection con1
connection con1;
select * from t1;
commit;
# Cleanup
---echo # Switch to connection default + disconnect con1 and con2
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/include/grant_cache.inc b/mysql-test/include/grant_cache.inc
index 111b35d6940..cb495e7feae 100644
--- a/mysql-test/include/grant_cache.inc
+++ b/mysql-test/include/grant_cache.inc
@@ -51,7 +51,6 @@ set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
---echo ----- establish connection root -----
connect (root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root;
show grants for current_user;
@@ -67,7 +66,6 @@ insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
---echo ----- establish connection root2 -----
connect (root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection root2;
# put queries in cache
@@ -86,7 +84,6 @@ grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
# The following queries should be fetched from cache
---echo ----- establish connection user1 (user=mysqltest_1) -----
connect (user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user1;
show grants for current_user();
@@ -112,14 +109,12 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
---echo ----- establish connection unkuser (user=unkuser) -----
# Don't use '' as user because it will pick Unix login
connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK);
connection unkuser;
show grants for current_user();
# The following queries should be fetched from cache
---echo ----- establish connection user2 (user=mysqltest_2) -----
connect (user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user2;
select "user2";
@@ -135,7 +130,6 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# The following queries should not be fetched from cache
---echo ----- establish connection user3 (user=mysqltest_3) -----
connect (user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user3;
select "user3";
@@ -157,7 +151,6 @@ show status like "Qcache_hits";
show status like "Qcache_not_cached";
# Connect without a database
---echo ----- establish connection user4 (user=mysqltest_1) -----
connect (user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection user4;
select "user4";
@@ -175,7 +168,6 @@ show status like "Qcache_not_cached";
# Cleanup
---echo ----- close connections -----
connection root;
disconnect root;
--source include/wait_until_disconnected.inc
@@ -197,7 +189,6 @@ disconnect user4;
connection unkuser;
disconnect unkuser;
--source include/wait_until_disconnected.inc
---echo ----- switch to connection default -----
connection default;
#
diff --git a/mysql-test/include/mix1.inc b/mysql-test/include/mix1.inc
index c837eb7a7ad..bfe1567691d 100644
--- a/mysql-test/include/mix1.inc
+++ b/mysql-test/include/mix1.inc
@@ -647,23 +647,19 @@ CREATE TABLE t2 (a INT) ENGINE=InnoDB;
CONNECT (c1,localhost,root,,);
CONNECT (c2,localhost,root,,);
---echo switch to connection c1
CONNECTION c1;
SET AUTOCOMMIT=0;
INSERT INTO t2 VALUES (1);
---echo switch to connection c2
CONNECTION c2;
SET AUTOCOMMIT=0;
--error ER_LOCK_WAIT_TIMEOUT
LOCK TABLES t1 READ, t2 READ;
---echo switch to connection c1
CONNECTION c1;
COMMIT;
INSERT INTO t1 VALUES (1);
---echo switch to connection default
CONNECTION default;
SET AUTOCOMMIT=default;
DISCONNECT c1;
@@ -1327,7 +1323,6 @@ connect (con2,localhost,root,,);
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
set binlog_format=mixed;
---echo # Switch to connection con1
connection con1;
eval
@@ -1343,7 +1338,6 @@ UPDATE t1 SET b = 12 WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--enable_info
@@ -1352,16 +1346,13 @@ connection con2;
UPDATE t1 SET b = 21 WHERE a = 1;
--disable_info
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
ROLLBACK;
---echo # Switch to connection con2
connection con2;
ROLLBACK;
---echo # Switch to connection con1
connection con1;
--echo # 2. test for serialized update:
@@ -1395,12 +1386,10 @@ UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--send CALL p1;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
COMMIT;
@@ -1413,13 +1402,11 @@ while ($bug31310)
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--reap
SELECT * FROM t1;
COMMIT;
---echo # Switch to connection con1
connection con1;
--echo # 3. test for updated key column:
@@ -1435,12 +1422,10 @@ UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--send CALL p1;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
COMMIT;
@@ -1453,7 +1438,6 @@ while ($bug31310)
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--reap
SELECT * FROM t1;
@@ -1616,23 +1600,18 @@ eval CREATE TABLE t1 (a INT) ENGINE=$engine_type;
INSERT INTO t1 VALUES (1),(2),(3);
BEGIN;
SELECT * FROM t1 ORDER BY a;
---echo # Connection con1
connect (con1, localhost, root,,);
--send TRUNCATE TABLE t1;
---echo # Connection default
connection default;
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for table metadata lock' AND info='TRUNCATE TABLE t1';
--source include/wait_condition.inc
SELECT * FROM t1 ORDER BY a;
ROLLBACK;
---echo # Connection con1
connection con1;
--echo # Reaping TRUNCATE TABLE
--reap
SELECT * FROM t1;
---echo # Disconnect con1
disconnect con1;
---echo # Connection default
connection default;
DROP TABLE t1;
diff --git a/mysql-test/include/query_cache.inc b/mysql-test/include/query_cache.inc
index 56dae83db2f..fcb9c2494d4 100644
--- a/mysql-test/include/query_cache.inc
+++ b/mysql-test/include/query_cache.inc
@@ -124,7 +124,6 @@ eval SET SESSION STORAGE_ENGINE = $engine_type;
SET @@autocommit=1;
connection default;
---echo connection default
# This should be 'YES'.
SHOW VARIABLES LIKE 'have_query_cache';
@@ -142,7 +141,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
---echo connection connection1
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
INSERT INTO t2 VALUES (5,'w');
@@ -153,7 +151,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection default;
---echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
@@ -163,7 +160,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
show status like "Qcache_queries_in_cache";
connection connection1;
---echo connection connection1
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
@@ -172,7 +168,6 @@ INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
connection default;
---echo connection default
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
@@ -181,7 +176,6 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
COMMIT;
connection connection1;
---echo connection connection1
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
diff --git a/mysql-test/include/query_cache_sql_prepare.inc b/mysql-test/include/query_cache_sql_prepare.inc
index 41276ed5a79..1bc7c94a172 100644
--- a/mysql-test/include/query_cache_sql_prepare.inc
+++ b/mysql-test/include/query_cache_sql_prepare.inc
@@ -23,9 +23,7 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
---echo ---- establish connection con1 (root) ----
connect (con1,localhost,root,,test,$MASTER_MYPORT,);
---echo ---- switch to connection default ----
connection default;
set @initial_query_cache_size = @@global.query_cache_size;
@@ -55,7 +53,6 @@ show status like 'Qcache_hits';
execute stmt2;
show status like 'Qcache_hits';
# Another prepared statement (same text, other connection), should hit the QC
---echo ---- switch to connection con1 ----
connection con1;
prepare stmt3 from "select * from t1 where c1=10";
execute stmt3;
@@ -64,7 +61,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# Mixup tests, where statements without PREPARE.../EXECUTE.... meet statements
@@ -89,20 +85,16 @@ execute stmt10;
show status like 'Qcache_hits';
eval $my_stmt;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
eval $my_stmt;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# Statement without PREPARE.../EXECUTE.... first
let $my_stmt= SELECT * FROM t1 WHERE c1 = 1;
eval prepare stmt11 from "$my_stmt";
---echo ---- switch to connection con1 ----
connection con1;
eval prepare stmt12 from "$my_stmt";
---echo ---- switch to connection default ----
connection default;
eval $my_stmt;
show status like 'Qcache_hits';
@@ -110,11 +102,9 @@ eval $my_stmt;
show status like 'Qcache_hits';
execute stmt11;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
execute stmt12;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# Query caching also works when statement has parameters
@@ -127,7 +117,6 @@ execute stmt1 using @a;
show status like 'Qcache_hits';
execute stmt1 using @a;
show status like 'Qcache_hits';
---echo ---- switch to connection con1 ----
connection con1;
set @a=1;
prepare stmt4 from "select * from t1 where c1=?";
@@ -139,7 +128,6 @@ execute stmt4 using @a;
show status like 'Qcache_hits';
execute stmt4 using @a;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
# See if enabling/disabling the query cache between PREPARE and
@@ -168,7 +156,6 @@ execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
# Expect to see no additional Qcache_hits.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -178,7 +165,6 @@ execute stmt3;
show status like 'Qcache_hits';
#
# then QC is re-enabled for more EXECUTE.
---echo ---- switch to connection default ----
connection default;
set global query_cache_size=102400;
# Expect to see additional Qcache_hits.
@@ -193,7 +179,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -201,7 +186,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# then QC is re-disabled for more EXECUTE.
@@ -216,7 +200,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
execute stmt3;
show status like 'Qcache_hits';
@@ -226,15 +209,12 @@ execute stmt3;
show status like 'Qcache_hits';
#
---echo ---- switch to connection default ----
connection default;
# QC is disabled at PREPARE
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=10";
---echo ---- switch to connection con1 ----
connection con1;
prepare stmt3 from "select * from t1 where c1=10";
---echo ---- switch to connection default ----
connection default;
# then QC is enabled at EXECUTE
set global query_cache_size=102400;
@@ -246,7 +226,6 @@ show status like 'Qcache_hits';
execute stmt1;
show status like 'Qcache_hits';
# The QC is global = affects also other connections.
---echo ---- switch to connection con1 ----
connection con1;
show status like 'Qcache_hits';
execute stmt3;
@@ -255,7 +234,6 @@ execute stmt3;
show status like 'Qcache_hits';
execute stmt3;
show status like 'Qcache_hits';
---echo ---- switch to connection default ----
connection default;
#
# QC is disabled at PREPARE
@@ -276,7 +254,6 @@ show status like 'Qcache_hits';
drop table t1;
---echo ---- disconnect connection con1 ----
disconnect con1;
#
diff --git a/mysql-test/include/rpl_connect.inc b/mysql-test/include/rpl_connect.inc
index 11927833f53..e30769eb335 100644
--- a/mysql-test/include/rpl_connect.inc
+++ b/mysql-test/include/rpl_connect.inc
@@ -51,7 +51,9 @@ if ($rpl_debug)
{
--echo connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
}
+disable_connect_log;
--connect ($rpl_connection_name,127.0.0.1,root,,test,$_rpl_port,)
+enable_connect_log;
--let $include_filename= rpl_connect.inc
diff --git a/mysql-test/include/rpl_connection.inc b/mysql-test/include/rpl_connection.inc
index 1988568a4d2..256a4756e3a 100644
--- a/mysql-test/include/rpl_connection.inc
+++ b/mysql-test/include/rpl_connection.inc
@@ -43,5 +43,7 @@ if ($_include_file_depth)
--echo [connection $rpl_connection_name]
}
}
+disable_connect_log;
--connection $rpl_connection_name
+enable_connect_log;
--let $rpl_connection_name=
diff --git a/mysql-test/include/rpl_connection_master.inc b/mysql-test/include/rpl_connection_master.inc
deleted file mode 100644
index fa09cc8a610..00000000000
--- a/mysql-test/include/rpl_connection_master.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= master;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_connection_slave.inc b/mysql-test/include/rpl_connection_slave.inc
deleted file mode 100644
index 8dcfb3b611b..00000000000
--- a/mysql-test/include/rpl_connection_slave.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= slave;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_connection_slave1.inc b/mysql-test/include/rpl_connection_slave1.inc
deleted file mode 100644
index a408d14596b..00000000000
--- a/mysql-test/include/rpl_connection_slave1.inc
+++ /dev/null
@@ -1,2 +0,0 @@
-let $rpl_connection_name= slave1;
-source include/rpl_connection.inc;
diff --git a/mysql-test/include/rpl_ip_mix.inc b/mysql-test/include/rpl_ip_mix.inc
index 96766e7dbdd..d547d77a3cc 100644
--- a/mysql-test/include/rpl_ip_mix.inc
+++ b/mysql-test/include/rpl_ip_mix.inc
@@ -1,13 +1,9 @@
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
@@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_ip_mix2.inc b/mysql-test/include/rpl_ip_mix2.inc
index 390c788a461..72011558d45 100644
--- a/mysql-test/include/rpl_ip_mix2.inc
+++ b/mysql-test/include/rpl_ip_mix2.inc
@@ -1,13 +1,9 @@
---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
@@ -15,10 +11,7 @@ let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_ipv6.inc b/mysql-test/include/rpl_ipv6.inc
index d2d53a4841a..69f282e22d9 100644
--- a/mysql-test/include/rpl_ipv6.inc
+++ b/mysql-test/include/rpl_ipv6.inc
@@ -1,22 +1,15 @@
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
eval change master to master_host='$IPv6';
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
--echo Master-Host: $master_host
---echo disconnect slave;
disconnect slave;
---echo disconnect master;
disconnect master;
---echo connection default;
connection default;
diff --git a/mysql-test/include/rpl_loaddata_charset.inc b/mysql-test/include/rpl_loaddata_charset.inc
index 0e445446a38..46a701aa2f7 100644
--- a/mysql-test/include/rpl_loaddata_charset.inc
+++ b/mysql-test/include/rpl_loaddata_charset.inc
@@ -19,12 +19,10 @@ if ($LOAD_LOCAL)
}
save_master_pos;
-echo ----------content on master----------;
SELECT hex(cl) FROM t;
connection slave;
sync_with_master;
-echo ----------content on slave----------;
USE mysqltest;
SELECT hex(cl) FROM t;
diff --git a/mysql-test/include/rpl_stmt_seq.inc b/mysql-test/include/rpl_stmt_seq.inc
index 08f6e44aba0..b23178ee534 100644
--- a/mysql-test/include/rpl_stmt_seq.inc
+++ b/mysql-test/include/rpl_stmt_seq.inc
@@ -70,8 +70,6 @@ let $_log_num_s= `select @aux`;
###############################################################
# INSERT
###############################################################
---echo
---echo -------- switch to master -------
connection master;
# Maybe it would be smarter to use a table with an autoincrement column.
let $MAX= `SELECT MAX(f1) FROM t1` ;
@@ -85,8 +83,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results before DDL(to be tested)
SELECT MAX(f1) FROM t1;
@@ -99,8 +95,6 @@ if ($show_binlog)
###############################################################
# command to be tested
###############################################################
---echo
---echo -------- switch to master -------
connection master;
eval $my_stmt;
# Devaluate $my_stmt, to detect script bugs
@@ -114,8 +108,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results after DDL(to be tested)
SELECT MAX(f1) FROM t1;
@@ -128,8 +120,6 @@ if ($show_binlog)
###############################################################
# ROLLBACK
###############################################################
---echo
---echo -------- switch to master -------
connection master;
ROLLBACK;
# results after final ROLLBACK
@@ -151,8 +141,6 @@ if ($show_binlog)
}
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# results after final ROLLBACK
SELECT MAX(f1) FROM t1;
@@ -181,16 +169,12 @@ if ($manipulate)
# - flush the master and the slave log
# ---> both start to write into new logs with incremented number
# - increment $_log_num_n
---echo
---echo -------- switch to master -------
connection master;
flush logs;
# sleep 1;
# eval SHOW BINLOG EVENTS IN 'master-bin.$_log_num_s';
sync_slave_with_master;
---echo
---echo -------- switch to slave --------
connection slave;
# the final content of the binary log
flush logs;
@@ -202,6 +186,4 @@ flush logs;
inc $_log_num_n;
}
---echo
---echo -------- switch to master -------
connection master;
diff --git a/mysql-test/include/rpl_sync.inc b/mysql-test/include/rpl_sync.inc
index be2904528ff..83d4a2e4628 100644
--- a/mysql-test/include/rpl_sync.inc
+++ b/mysql-test/include/rpl_sync.inc
@@ -81,7 +81,9 @@ while ($_rpl_i) {
}
if ($rpl_only_running_threads)
{
+ disable_connect_log;
--connection server_$_rpl_server
+ enable_connect_log;
--let $_rpl_slave_io_running= query_get_value(SHOW SLAVE STATUS, Slave_IO_Running, 1)
--let $_rpl_slave_sql_running= query_get_value(SHOW SLAVE STATUS, Slave_SQL_Running, 1)
if ($rpl_debug)
@@ -92,7 +94,9 @@ while ($_rpl_i) {
--let $_rpl_slave_sql_running= `SELECT IF('$_rpl_slave_sql_running' = 'Yes', 1, '')`
if ($_rpl_slave_io_running)
{
+ disable_query_log;
--connection server_$_rpl_prev_server
+ enable_query_log;
if ($_rpl_slave_sql_running)
{
if ($rpl_debug)
@@ -101,7 +105,9 @@ while ($_rpl_i) {
--let $_rpl_master_pos= query_get_value("SHOW MASTER STATUS", Position, 1)
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
}
+ disable_connect_log;
--sync_slave_with_master server_$_rpl_server
+ enable_connect_log;
}
if (!$_rpl_slave_sql_running)
{
@@ -119,6 +125,7 @@ while ($_rpl_i) {
}
if (!$rpl_only_running_threads)
{
+ disable_connect_log;
--connection server_$_rpl_prev_server
if ($rpl_debug)
{
@@ -127,6 +134,7 @@ while ($_rpl_i) {
--echo syncing master_file='$_rpl_master_file' master_pos='$_rpl_master_pos'
}
--sync_slave_with_master server_$_rpl_server
+ enable_connect_log;
}
}
diff --git a/mysql-test/include/rpl_udf.inc b/mysql-test/include/rpl_udf.inc
index 71a6304c303..95b953efc2f 100644
--- a/mysql-test/include/rpl_udf.inc
+++ b/mysql-test/include/rpl_udf.inc
@@ -30,7 +30,6 @@ drop table if exists t1;
# Test 1) Test UDFs via loadable libraries
#
--echo "*** Test 1) Test UDFs via loadable libraries ***
---echo "Running on the master"
--enable_info
--replace_result $UDF_EXAMPLE_SO UDF_EXAMPLE_LIB
eval CREATE FUNCTION myfunc_double RETURNS REAL SONAME "$UDF_EXAMPLE_SO";
@@ -48,7 +47,6 @@ connection slave;
sync_with_master;
# Check to see that UDF CREATE statements were replicated
---echo "Running on the slave"
--enable_info
--replace_column 3 UDF_LIB
SELECT * FROM mysql.func ORDER BY name;
@@ -57,7 +55,6 @@ SELECT * FROM mysql.func ORDER BY name;
connection master;
# Use the UDFs to do something
---echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
--disable_warnings
@@ -72,7 +69,6 @@ SELECT * FROM t1 ORDER BY sum;
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT * FROM t1 ORDER BY sum;
@@ -84,7 +80,6 @@ SELECT myfunc_double(75.00);
connection master;
# Drop the functions
---echo "Running on the master"
--enable_info
DROP FUNCTION myfunc_double;
DROP FUNCTION myfunc_int;
@@ -94,7 +89,6 @@ SELECT * FROM mysql.func ORDER BY name;
sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
---echo "Running on the slave"
--enable_info
SELECT * FROM mysql.func ORDER BY name;
--disable_info
@@ -102,7 +96,6 @@ SELECT * FROM mysql.func ORDER BY name;
connection master;
# Cleanup
---echo "Running on the master"
--enable_info
DROP TABLE t1;
--disable_info
@@ -111,7 +104,6 @@ DROP TABLE t1;
# Test 2) Test UDFs with SQL body
#
--echo "*** Test 2) Test UDFs with SQL body ***
---echo "Running on the master"
--enable_info
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
@@ -121,7 +113,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see that UDF CREATE statements were replicated
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
@@ -129,7 +120,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
connection master;
# Use the UDFs to do something
---echo "Running on the master"
--enable_info
eval CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=$engine_type;
INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
@@ -142,7 +132,6 @@ SELECT * FROM t1 ORDER BY sum;
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT * FROM t1 ORDER BY sum;
--disable_info
@@ -150,7 +139,6 @@ SELECT * FROM t1 ORDER BY sum;
connection master;
# Modify the UDFs to add a comment
---echo "Running on the master"
--enable_info
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
@@ -160,7 +148,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see if data was replicated
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
@@ -172,7 +159,6 @@ SELECT myfuncsql_double(75.00);
connection master;
# Drop the functions
---echo "Running on the master"
--enable_info
DROP FUNCTION myfuncsql_double;
DROP FUNCTION myfuncsql_int;
@@ -182,7 +168,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
sync_slave_with_master;
# Check to see if the UDFs were dropped on the slave
---echo "Running on the slave"
--enable_info
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
--disable_info
@@ -190,7 +175,6 @@ SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'te
connection master;
# Cleanup
---echo "Running on the master"
--enable_info
DROP TABLE t1;
--disable_info
diff --git a/mysql-test/r/aborted_clients.result b/mysql-test/r/aborted_clients.result
index 7111a0c98db..8eb6df59653 100644
--- a/mysql-test/r/aborted_clients.result
+++ b/mysql-test/r/aborted_clients.result
@@ -1,9 +1,15 @@
FLUSH STATUS;
+connect con1,localhost,root,,;
+disconnect con1;
+connection default;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
VARIABLE_VALUE
0
+connect con2,localhost,root,,;
KILL CONNECTION_ID();
ERROR 70100: Connection was killed
+disconnect con2;
+connection default;
SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME='aborted_clients';
VARIABLE_VALUE
1
diff --git a/mysql-test/r/alias.result b/mysql-test/r/alias.result
index 9d826dd9bd7..defd44f2548 100644
--- a/mysql-test/r/alias.result
+++ b/mysql-test/r/alias.result
@@ -212,5 +212,9 @@ drop table t4;
create table t4 select t2.*, d as 'x', d as 'z' from t2;
drop table t4;
drop table t1,t2,t3;
+connect c1,localhost,root,,;
+connection c1;
DELETE ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZROM t1 WHERE 1=1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 't1 WHERE 1=1' at line 1
+connection default;
+disconnect c1;
diff --git a/mysql-test/r/alter_table-big.result b/mysql-test/r/alter_table-big.result
index f7a3ec6502e..32689daa3a6 100644
--- a/mysql-test/r/alter_table-big.result
+++ b/mysql-test/r/alter_table-big.result
@@ -1,5 +1,8 @@
drop table if exists t1, t2;
set debug_sync='RESET';
+connect addconroot, localhost, root,,;
+connect addconroot2, localhost, root,,;
+connection default;
create table t1 (n1 int, n2 int, n3 int,
key (n1, n2, n3),
key (n2, n3, n1),
@@ -10,10 +13,15 @@ insert into t1 values (1, 2, 3);
reset master;
set debug_sync='alter_table_enable_indexes SIGNAL parked WAIT_FOR go';
alter table t1 enable keys;;
+connection addconroot;
set debug_sync='now WAIT_FOR parked';
insert into t2 values (1);
insert into t1 values (1, 1, 1);;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot;
+connection default;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
@@ -25,36 +33,60 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; insert into t1 values (1, 1, 1)
master-bin.000001 # Query # # COMMIT
drop tables t1, t2;
+disconnect addconroot;
+disconnect addconroot2;
set debug_sync='RESET';
End of 5.0 tests
drop table if exists t1, t2, t3;
+connect addconroot, localhost, root,,;
+connect addconroot2, localhost, root,,;
+connection default;
create table t1 (i int);
reset master;
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
alter table t1 change i c char(10) default 'Test1';;
+connection addconroot;
set debug_sync='now WAIT_FOR parked';
insert into t1 values ();;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot;
+connection default;
select * from t1;
c
Test1
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
alter table t1 change c vc varchar(100) default 'Test2';;
+connection addconroot;
set debug_sync='now WAIT_FOR parked';
rename table t1 to t2;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot;
+connection default;
drop table t2;
create table t1 (i int);
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
alter table t1 change i c char(10) default 'Test3', rename to t2;;
+connection addconroot;
set debug_sync='now WAIT_FOR parked';
insert into t2 values();;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot;
+connection default;
select * from t2;
c
Test3
alter table t2 change c vc varchar(100) default 'Test2', rename to t1;;
+connection addconroot;
+connection default;
rename table t1 to t3;
+disconnect addconroot;
+disconnect addconroot2;
drop table t3;
set debug_sync='alter_table_before_main_binlog SIGNAL parked WAIT_FOR go';
set debug_sync='RESET';
diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result
index 9c0a25f6d61..3388e7fcdcd 100644
--- a/mysql-test/r/alter_table.result
+++ b/mysql-test/r/alter_table.result
@@ -1681,16 +1681,17 @@ CREATE TABLE t1(a INT PRIMARY KEY, b INT);
INSERT INTO t1 VALUES (1,1), (2,2);
START TRANSACTION;
INSERT INTO t1 VALUES (3,3);
-# Connection con1
+connect con1, localhost, root;
# Sending:
ALTER TABLE t1 DISABLE KEYS;
-# Connection default
+connection default;
# Waiting until ALTER TABLE is blocked.
UPDATE t1 SET b = 4;
COMMIT;
-# Connection con1
+connection con1;
# Reaping: ALTER TABLE t1 DISABLE KEYS
-# Connection default
+disconnect con1;
+connection default;
DROP TABLE t1;
#
# 7: Which operations require copy and which can be done in-place?
diff --git a/mysql-test/r/analyze_format_json.result b/mysql-test/r/analyze_format_json.result
index 69930bc0215..4f8876a8414 100644
--- a/mysql-test/r/analyze_format_json.result
+++ b/mysql-test/r/analyze_format_json.result
@@ -242,6 +242,8 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select database();
database()
test
+connect con1,localhost,root,,*NO-ONE*;
+connection con1;
select database();
database()
NULL
@@ -265,6 +267,8 @@ ANALYZE
}
}
}
+disconnect con1;
+connection default;
drop table t1;
#
# MDEV-7812: ANALYZE FORMAT=JSON UPDATE/DELETE doesnt print
diff --git a/mysql-test/r/assign_key_cache-5405.result b/mysql-test/r/assign_key_cache-5405.result
index 4a0fc58cd4f..c4cb56f3f72 100644
--- a/mysql-test/r/assign_key_cache-5405.result
+++ b/mysql-test/r/assign_key_cache-5405.result
@@ -1,12 +1,17 @@
create table t1 (f int, key(f)) engine=myisam;
set global kc1.key_buffer_size = 65536;
+connect con1, localhost, root;
set debug_sync='assign_key_cache_op_unlock wait_for op_locked';
cache index t1 in kc1;
+connection default;
set debug_sync='assign_key_cache_op_lock signal op_locked wait_for assigned';
cache index t1 in kc1;
+connection con1;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
set debug_sync='now signal assigned';
+disconnect con1;
+connection default;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
drop table t1;
diff --git a/mysql-test/r/auth_named_pipe.result b/mysql-test/r/auth_named_pipe.result
index 3268b760a22..fb190ccd149 100644
--- a/mysql-test/r/auth_named_pipe.result
+++ b/mysql-test/r/auth_named_pipe.result
@@ -1,8 +1,11 @@
INSTALL SONAME 'auth_named_pipe';
CREATE USER 'USERNAME' IDENTIFIED WITH named_pipe;
+connect pipe_con,localhost,$USERNAME,,,,,PIPE;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
USERNAME@localhost USERNAME@%
+disconnect pipe_con;
+connection default;
DROP USER 'USERNAME';
CREATE USER nosuchuser IDENTIFIED WITH named_pipe;
ERROR 28000: Access denied for user 'nosuchuser'@'localhost'
diff --git a/mysql-test/r/auth_rpl.result b/mysql-test/r/auth_rpl.result
index 70626b02b2b..a3da7985da1 100644
--- a/mysql-test/r/auth_rpl.result
+++ b/mysql-test/r/auth_rpl.result
@@ -1,16 +1,18 @@
include/master-slave.inc
[connection master]
-[connection slave]
+connection slave;
include/stop_slave.inc
-[connection master]
+connection master;
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
GRANT REPLICATION SLAVE ON *.* TO plug_user;
FLUSH PRIVILEGES;
-[connection slave]
+connection slave;
CHANGE MASTER TO
MASTER_USER= 'plug_user',
MASTER_PASSWORD= 'plug_user';
include/start_slave.inc
+connection master;
+connection slave;
# Slave in-sync with master now.
SELECT user, plugin, authentication_string FROM mysql.user WHERE user LIKE 'plug_user';
user plugin authentication_string
@@ -20,5 +22,6 @@ include/stop_slave.inc
CHANGE MASTER TO MASTER_USER='root';
DROP USER 'plug_user';
# Cleanup (on master).
+connection master;
DROP USER 'plug_user';
include/rpl_end.inc
diff --git a/mysql-test/r/bug39022.result b/mysql-test/r/bug39022.result
index 75899ed686b..3cdda9eeca4 100644
--- a/mysql-test/r/bug39022.result
+++ b/mysql-test/r/bug39022.result
@@ -8,25 +8,30 @@ INSERT INTO t1 VALUES (13,0),(8,1),(9,2),(6,3),
(12,13),(7,14);
INSERT INTO t2 VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),
(11),(12),(13),(14);
-# in thread1
+connect thread1, localhost, root,,;
+connect thread2, localhost, root,,;
+connection thread1;
START TRANSACTION;
-# in thread2
+connection thread2;
REPLACE INTO t2 VALUES (-17);
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
d
-# in thread1
+connection thread1;
REPLACE INTO t1(a,b) VALUES (67,20);
-# in thread2
+connection thread2;
COMMIT;
START TRANSACTION;
REPLACE INTO t1(a,b) VALUES (65,-50);
REPLACE INTO t2 VALUES (-91);
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
-# in thread1
+connection thread1;
# should not crash
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
-# in thread2
+connection thread2;
d
-# in thread1;
+disconnect thread2;
+connection thread1;
+disconnect thread1;
+connection default;
DROP TABLE t1,t2;
diff --git a/mysql-test/r/bug58669.result b/mysql-test/r/bug58669.result
index c9bd43e244b..a7d1d7b5581 100644
--- a/mysql-test/r/bug58669.result
+++ b/mysql-test/r/bug58669.result
@@ -5,6 +5,8 @@ CREATE USER user1@localhost;
CREATE DATABASE db1;
GRANT ALL PRIVILEGES ON db1.* TO user1@localhost;
CREATE TABLE db1.t1(a INT);
+connect con1,localhost,user1,,;
+connection con1;
SELECT CURRENT_USER();
CURRENT_USER()
user1@localhost
@@ -13,5 +15,7 @@ Variable_name Value
read_only ON
INSERT INTO db1.t1 VALUES (1);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+connection default;
+disconnect con1;
DROP DATABASE db1;
DROP USER user1@localhost;
diff --git a/mysql-test/r/cache_innodb.result b/mysql-test/r/cache_innodb.result
index 971750e3da2..18ae0ac8a83 100644
--- a/mysql-test/r/cache_innodb.result
+++ b/mysql-test/r/cache_innodb.result
@@ -131,9 +131,10 @@ select t1.* from t1, t2, t3 where t3.state & 1 = 0 and t3.t1_id = t1.id and t3.t
id a
1 me
drop table t3,t2,t1;
+connect connection1,localhost,root,,;
SET SESSION STORAGE_ENGINE = InnoDB;
SET @@autocommit=1;
-connection default
+connection default;
SHOW VARIABLES LIKE 'have_query_cache';
Variable_name Value
have_query_cache YES
@@ -155,7 +156,7 @@ count(*)
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
-connection connection1
+connection connection1;
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
@@ -171,7 +172,7 @@ count(*)
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
-connection default
+connection default;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
@@ -185,7 +186,7 @@ count(*)
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-connection connection1
+connection connection1;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
@@ -197,7 +198,7 @@ INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
3
-connection default
+connection default;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
@@ -210,7 +211,7 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
COMMIT;
-connection connection1
+connection connection1;
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
@@ -221,6 +222,8 @@ Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
+disconnect connection1;
+connection default;
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
SET global query_cache_type=default;
diff --git a/mysql-test/r/cast.result b/mysql-test/r/cast.result
index 4c9f257fdf2..da23f8af40c 100644
--- a/mysql-test/r/cast.result
+++ b/mysql-test/r/cast.result
@@ -713,6 +713,7 @@ DROP TABLE t1;
SET @@GLOBAL.max_allowed_packet=2048;
Warnings:
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+connect newconn, localhost, root,,;
SELECT CONVERT('a', BINARY(2049));
CONVERT('a', BINARY(2049))
a
@@ -728,6 +729,8 @@ length(CONVERT(repeat('a',2048), CHAR(2049)))
2048
Warnings:
Warning 1301 Result of cast_as_char() was larger than max_allowed_packet (2048) - truncated
+connection default;
+disconnect newconn;
SET @@GLOBAL.max_allowed_packet=default;
#
# Bug#13519724 63793: CRASH IN DTCOLLATION::SET(DTCOLLATION &SET)
diff --git a/mysql-test/r/change_user_notembedded.result b/mysql-test/r/change_user_notembedded.result
index 896a6045481..41a154f8d3d 100644
--- a/mysql-test/r/change_user_notembedded.result
+++ b/mysql-test/r/change_user_notembedded.result
@@ -1,6 +1,10 @@
+connect test,localhost,root,,;
+connection test;
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES)
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: NO)
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES)
ERROR 08S01: Unknown command
ERROR 08S01: Unknown command
+disconnect test;
+connection default;
that's all
diff --git a/mysql-test/r/check.result b/mysql-test/r/check.result
index 0ac42272c4f..bc41b95f192 100644
--- a/mysql-test/r/check.result
+++ b/mysql-test/r/check.result
@@ -1,3 +1,6 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
drop table if exists t1,t2;
drop view if exists v1;
create table t1(n int not null, key(n), key(n), key(n), key(n));
@@ -6,9 +9,14 @@ Note 1831 Duplicate index 'n_2' defined on the table 'test.t1'. This is deprecat
Note 1831 Duplicate index 'n_3' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
Note 1831 Duplicate index 'n_4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
check table t1 extended;
+connection con2;
insert into t1 values (200000);
+connection con1;
Table Op Msg_type Msg_text
test.t1 check status OK
+connection default;
+disconnect con1;
+disconnect con2;
drop table t1;
Create table t1(f1 int);
Create table t2(f1 int);
@@ -34,12 +42,13 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
LOCK TABLE t1 WRITE;
-# Connection con1
+connect con1, localhost, root;
SET lock_wait_timeout= 1;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check Error Lock wait timeout exceeded; try restarting transaction
test.t1 check status Operation failed
-# Connection default
+connection default;
UNLOCK TABLES;
DROP TABLE t1;
+disconnect con1;
diff --git a/mysql-test/r/commit.result b/mysql-test/r/commit.result
index a62d2940d85..b501f5a8dd7 100644
--- a/mysql-test/r/commit.result
+++ b/mysql-test/r/commit.result
@@ -1,3 +1,4 @@
+connect con1,localhost,root,,;
#
# Bug#20837 Apparent change of isolation level
# during transaction
@@ -43,11 +44,11 @@ s1
2
-1
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
-connection con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1000);
COMMIT;
-connection default
+connection default;
We should not be able to read the '1000'
SELECT * FROM t1;
s1
@@ -65,23 +66,23 @@ s1
1000
COMMIT;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
-connection default
+connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
-connection con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
-connection default
+connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1001;
COUNT(*)
1
Should be 1
COMMIT AND CHAIN;
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
-connection default
+connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1002;
COUNT(*)
1
@@ -97,23 +98,23 @@ s1
1002
DELETE FROM t1 WHERE s1 >= 1000;
COMMIT;
-connection default
+connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
-connection con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
-connection default
+connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1001;
COUNT(*)
1
Should be 1
ROLLBACK AND CHAIN;
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
-connection default
+connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1002;
COUNT(*)
1
@@ -129,33 +130,33 @@ s1
DELETE FROM t1 WHERE s1 >= 1000;
COMMIT;
SET @@completion_type=1;
-connection default
+connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
-connection con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
s1
1001
Should see 1001
COMMIT AND NO CHAIN;
default transaction is now in REPEATABLE READ
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
s1
1001
1002
Should see 1001 and 1002
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1003);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
s1
1001
@@ -174,35 +175,35 @@ DELETE FROM t1 WHERE s1 >= 1000;
COMMIT AND NO CHAIN;
SET @@completion_type=0;
COMMIT;
-connection default
+connection default;
SET @@completion_type=1;
COMMIT AND NO CHAIN;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
-connection con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
s1
1001
Should see 1001
ROLLBACK AND NO CHAIN;
default transaction is now in REPEATABLE READ
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
s1
1001
1002
Should see 1001 and 1002
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1003);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
s1
1001
@@ -221,7 +222,7 @@ DELETE FROM t1 WHERE s1 >= 1000;
COMMIT AND NO CHAIN;
SET @@completion_type=0;
COMMIT;
-connection default
+connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION;
@@ -230,10 +231,10 @@ s1
1
2
-1
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1000);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1;
s1
1
@@ -253,10 +254,10 @@ SELECT * FROM t1;
s1
1000
Should read '1000'
-connection con1
+connection con1;
INSERT INTO t1 VALUES (1001);
COMMIT;
-connection default
+connection default;
SELECT * FROM t1;
s1
1000
@@ -266,6 +267,7 @@ SET @@completion_type=0;
COMMIT AND NO CHAIN;
SET @@autocommit=1;
COMMIT;
+disconnect con1;
DROP TABLE t1;
#
# End of test cases for Bug#20837
diff --git a/mysql-test/r/compress.result b/mysql-test/r/compress.result
index 83b50351ba9..bd87015bf8f 100644
--- a/mysql-test/r/compress.result
+++ b/mysql-test/r/compress.result
@@ -1,3 +1,4 @@
+connect comp_con,localhost,root,,,,,COMPRESS;
SHOW STATUS LIKE 'Compression';
Variable_name Value
Compression ON
@@ -2163,3 +2164,5 @@ drop table t1;
SHOW STATUS LIKE 'Compression';
Variable_name Value
Compression ON
+connection default;
+disconnect comp_con;
diff --git a/mysql-test/r/concurrent_innodb_safelog.result b/mysql-test/r/concurrent_innodb_safelog.result
index 03d20f40be3..27889777ac1 100644
--- a/mysql-test/r/concurrent_innodb_safelog.result
+++ b/mysql-test/r/concurrent_innodb_safelog.result
@@ -1,4 +1,5 @@
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+connection default;
SET SQL_MODE="";
SELECT @@global.tx_isolation;
@@global.tx_isolation
@@ -13,7 +14,8 @@ drop table if exists t1;
**
** two UPDATE's running and both changing distinct result sets
**
-** connection thread1
+connect thread1, localhost, mysqltest,,;
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -32,13 +34,14 @@ insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
select get_lock("hello",10);
get_lock("hello",10)
1
-** connection thread2
+connect thread2, localhost, mysqltest,,;
+connection thread2;
** Start transaction for thread 2
begin;
** Update will cause a table scan and a new ULL will
** be created and blocked on the first row where tipo=11.
update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
-** connection thread1
+connection thread1;
** Start new transaction for thread 1
begin;
** Update on t1 will cause a table scan which will be blocked because
@@ -65,7 +68,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** Release the lock and collect result from update on thread 2
DO release_lock("hello");
** Table should have eta updates where tipo=11 but updates made by
@@ -85,7 +88,7 @@ eta tipo c
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** Sending commit on thread 2.
commit;
-** connection thread1
+connection thread1;
** Make sure table reads didn't change yet on thread 1.
select * from t1;
eta tipo c
@@ -117,7 +120,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** Make sure the output is similar for t1.
select * from t1;
eta tipo c
@@ -132,7 +135,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -146,13 +149,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** two UPDATE's running and one changing result set
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -171,14 +174,14 @@ insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
select get_lock("hello",10);
get_lock("hello",10)
1
-** connection thread2
+connection thread2;
** Start transaction on thread 2
begin;
** Update will cause a table scan.
** This will cause a hang on the first row where tipo=1 until the
** blocking ULL is released.
update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
-** connection thread1
+connection thread1;
** Start transaction on thread 1
begin;
** Update on t1 will cause a table scan which will be blocked because
@@ -204,7 +207,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** Release the lock and collect result from thread 2:
DO release_lock("hello");
** Seen from thread 2 the table should have been updated on four
@@ -223,7 +226,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
** Thread 2 has committed but the result should remain the same for
** thread 1 (updated on three places):
select * from t1;
@@ -256,7 +259,7 @@ eta tipo c
1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -270,7 +273,7 @@ eta tipo c
1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -284,13 +287,13 @@ eta tipo c
1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** One UPDATE and one INSERT .... Monty's test
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1 (a int not null, b int not null);
@@ -299,13 +302,13 @@ insert into t1 values (1,1),(2,1),(3,1),(4,1);
select get_lock("hello2",10);
get_lock("hello2",10)
1
-** connection thread2
+connection thread2;
** Begin a new transaction on thread 2
begin;
** Update will create a table scan which creates a ULL where a=2;
** this will hang waiting on thread 1.
update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
-** connection thread1
+connection thread1;
** Insert new values to t1 from thread 1; this created an implicit
** commit since there are no on-going transactions.
insert into t1 values (1,1);
@@ -319,7 +322,7 @@ a b
3 1
4 1
1 1
-** connection thread2
+connection thread2;
** Collect results from thread 2 and release the lock.
DO release_lock("hello2");
** The table should look like the original+updates for thread 2,
@@ -333,13 +336,13 @@ a b
1 1
** Commit changes from thread 2
commit;
-** connection default
+connection default;
drop table t1;
**
** one UPDATE changing result set and SELECT ... FOR UPDATE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -354,7 +357,7 @@ 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");
-** connection thread2
+connection thread2;
** Begin a new transaction on thread 2
begin;
** Select a range for update.
@@ -363,7 +366,7 @@ eta tipo c
20 2 ddddddddddddddddddddddddddddddddddddddddddd
40 2 fffffffffffffffffffffffffffffffffffffffffff
60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-** connection thread1
+connection thread1;
** Begin a new transaction on thread 1
begin;
** Update the same range which is marked for update on thread 2; this
@@ -385,7 +388,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** The table should look unmodified from thread 2.
select * from t1;
eta tipo c
@@ -403,10 +406,10 @@ eta tipo c
** Sending a commit should release the row locks and enable
** thread 1 to complete the transaction.
commit;
-** connection thread1
+connection thread1;
** Commit on thread 1.
commit;
-** connection thread2
+connection thread2;
** The table should not have been changed.
select * from t1;
eta tipo c
@@ -421,7 +424,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
** Even on thread 1:
select * from t1;
eta tipo c
@@ -436,13 +439,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** one UPDATE not changing result set and SELECT ... FOR UPDATE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -457,7 +460,7 @@ 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");
-** connection thread2
+connection thread2;
** Starting new transaction on thread 2.
begin;
** Starting SELECT .. FOR UPDATE
@@ -466,7 +469,7 @@ eta tipo c
20 2 ddddddddddddddddddddddddddddddddddddddddddd
40 2 fffffffffffffffffffffffffffffffffffffffffff
60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-** connection thread1
+connection thread1;
** Starting new transaction on thread 1
begin;
@@ -492,7 +495,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** The same thing should hold true for the transaction on
** thread 2
select * from t1;
@@ -509,9 +512,9 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
commit;
-** connection thread2
+connection thread2;
** Even after committing:
select * from t1;
eta tipo c
@@ -526,7 +529,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -540,13 +543,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** two SELECT ... FOR UPDATE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -561,7 +564,7 @@ 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");
-** connection thread2
+connection thread2;
** Begin a new transaction on thread 2
begin;
select * from t1 where tipo=2 FOR UPDATE;
@@ -569,14 +572,14 @@ eta tipo c
20 2 ddddddddddddddddddddddddddddddddddddddddddd
40 2 fffffffffffffffffffffffffffffffffffffffffff
60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-** connection thread1
+connection thread1;
** Begin a new transaction on thread 1
begin;
** Selecting a range for update by table scan will be blocked
** because of on-going transaction on thread 2.
select * from t1 where tipo=1 FOR UPDATE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-** connection thread2
+connection thread2;
** Table will be unchanged and the select command will not be
** blocked:
select * from t1;
@@ -594,10 +597,10 @@ eta tipo c
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** Commit transacton on thread 2.
commit;
-** connection thread1
+connection thread1;
** Commit transaction on thread 1.
commit;
-** connection thread2
+connection thread2;
** Make sure table isn't blocked on thread 2:
select * from t1;
eta tipo c
@@ -612,7 +615,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
** Make sure table isn't blocked on thread 1:
select * from t1;
eta tipo c
@@ -627,13 +630,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** one UPDATE changing result set and DELETE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -648,10 +651,10 @@ 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");
-** connection thread2
+connection thread2;
begin;
delete from t1 where tipo=2;
-** connection thread1
+connection thread1;
begin;
update t1 set tipo=1 where tipo=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -668,7 +671,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -680,9 +683,9 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
commit;
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -693,7 +696,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -704,13 +707,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** one UPDATE not changing result set and DELETE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -725,10 +728,10 @@ 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");
-** connection thread2
+connection thread2;
begin;
delete from t1 where tipo=2;
-** connection thread1
+connection thread1;
begin;
** Update on t1 will cause a table scan which will be blocked because
** the previously initiated table scan applied exclusive key locks on
@@ -750,7 +753,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -762,9 +765,9 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
commit;
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -775,7 +778,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -787,8 +790,11 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** Cleanup
-** connection thread2
-** connection default
+connection thread1;
+disconnect thread1;
+connection thread2;
+disconnect thread2;
+connection default;
drop table t1;
drop user mysqltest@localhost;
SET SQL_MODE=default;
diff --git a/mysql-test/r/concurrent_innodb_unsafelog.result b/mysql-test/r/concurrent_innodb_unsafelog.result
index 4a140d9e610..39e757aeeb1 100644
--- a/mysql-test/r/concurrent_innodb_unsafelog.result
+++ b/mysql-test/r/concurrent_innodb_unsafelog.result
@@ -1,4 +1,5 @@
SET GLOBAL TRANSACTION ISOLATION LEVEL REPEATABLE READ;
+connection default;
SET SQL_MODE="";
SELECT @@global.tx_isolation;
@@global.tx_isolation
@@ -13,7 +14,8 @@ drop table if exists t1;
**
** two UPDATE's running and both changing distinct result sets
**
-** connection thread1
+connect thread1, localhost, mysqltest,,;
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -32,13 +34,14 @@ insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
select get_lock("hello",10);
get_lock("hello",10)
1
-** connection thread2
+connect thread2, localhost, mysqltest,,;
+connection thread2;
** Start transaction for thread 2
begin;
** Update will cause a table scan and a new ULL will
** be created and blocked on the first row where tipo=11.
update t1 set eta=1+get_lock("hello",10)*0 where tipo=11;
-** connection thread1
+connection thread1;
** Start new transaction for thread 1
begin;
** Update on t1 will cause a table scan which will be blocked because
@@ -64,7 +67,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** Release the lock and collect result from update on thread 2
DO release_lock("hello");
** Table should have eta updates where tipo=11 but updates made by
@@ -84,7 +87,7 @@ eta tipo c
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** Sending commit on thread 2.
commit;
-** connection thread1
+connection thread1;
** Make sure table reads didn't change yet on thread 1.
select * from t1;
eta tipo c
@@ -116,7 +119,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** Make sure the output is similar for t1.
select * from t1;
eta tipo c
@@ -131,7 +134,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -145,13 +148,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
2 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
1 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** two UPDATE's running and one changing result set
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -170,14 +173,14 @@ insert into t1 values (90,11,"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
select get_lock("hello",10);
get_lock("hello",10)
1
-** connection thread2
+connection thread2;
** Start transaction on thread 2
begin;
** Update will cause a table scan.
** This will cause a hang on the first row where tipo=1 until the
** blocking ULL is released.
update t1 set eta=1+get_lock("hello",10)*0 where tipo=1;
-** connection thread1
+connection thread1;
** Start transaction on thread 1
begin;
** Update on t1 will cause a table scan which will be blocked because
@@ -202,7 +205,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** Release the lock and collect result from thread 2:
DO release_lock("hello");
** Seen from thread 2 the table should have been updated on four
@@ -221,7 +224,7 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
** Thread 2 has committed but the result should remain the same for
** thread 1 (updated on three places):
select * from t1;
@@ -254,7 +257,7 @@ eta tipo c
1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -268,7 +271,7 @@ eta tipo c
1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -282,13 +285,13 @@ eta tipo c
1 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** One UPDATE and one INSERT .... Monty's test
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1 (a int not null, b int not null);
@@ -297,13 +300,13 @@ insert into t1 values (1,1),(2,1),(3,1),(4,1);
select get_lock("hello2",10);
get_lock("hello2",10)
1
-** connection thread2
+connection thread2;
** Begin a new transaction on thread 2
begin;
** Update will create a table scan which creates a ULL where a=2;
** this will hang waiting on thread 1.
update t1 set b=10+get_lock(concat("hello",a),10)*0 where a=2;
-** connection thread1
+connection thread1;
** Insert new values to t1 from thread 1; this created an implicit
** commit since there are no on-going transactions.
insert into t1 values (1,1);
@@ -317,7 +320,7 @@ a b
3 1
4 1
1 1
-** connection thread2
+connection thread2;
** Collect results from thread 2 and release the lock.
DO release_lock("hello2");
** The table should look like the original+updates for thread 2,
@@ -331,13 +334,13 @@ a b
1 1
** Commit changes from thread 2
commit;
-** connection default
+connection default;
drop table t1;
**
** one UPDATE changing result set and SELECT ... FOR UPDATE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -352,7 +355,7 @@ 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");
-** connection thread2
+connection thread2;
** Begin a new transaction on thread 2
begin;
** Select a range for update.
@@ -361,7 +364,7 @@ eta tipo c
20 2 ddddddddddddddddddddddddddddddddddddddddddd
40 2 fffffffffffffffffffffffffffffffffffffffffff
60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-** connection thread1
+connection thread1;
** Begin a new transaction on thread 1
begin;
** Update the same range which is marked for update on thread 2; this
@@ -383,7 +386,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** The table should look unmodified from thread 2.
select * from t1;
eta tipo c
@@ -401,10 +404,10 @@ eta tipo c
** Sending a commit should release the row locks and enable
** thread 1 to complete the transaction.
commit;
-** connection thread1
+connection thread1;
** Commit on thread 1.
commit;
-** connection thread2
+connection thread2;
** The table should not have been changed.
select * from t1;
eta tipo c
@@ -419,7 +422,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
** Even on thread 1:
select * from t1;
eta tipo c
@@ -434,13 +437,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** one UPDATE not changing result set and SELECT ... FOR UPDATE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -455,7 +458,7 @@ 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");
-** connection thread2
+connection thread2;
** Starting new transaction on thread 2.
begin;
** Starting SELECT .. FOR UPDATE
@@ -464,7 +467,7 @@ eta tipo c
20 2 ddddddddddddddddddddddddddddddddddddddddddd
40 2 fffffffffffffffffffffffffffffffffffffffffff
60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-** connection thread1
+connection thread1;
** Starting new transaction on thread 1
begin;
@@ -489,7 +492,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 11 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
** The same thing should hold true for the transaction on
** thread 2
select * from t1;
@@ -506,9 +509,9 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
commit;
-** connection thread2
+connection thread2;
** Even after committing:
select * from t1;
eta tipo c
@@ -523,7 +526,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 11 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -537,13 +540,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 11 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** two SELECT ... FOR UPDATE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -558,7 +561,7 @@ 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");
-** connection thread2
+connection thread2;
** Begin a new transaction on thread 2
begin;
select * from t1 where tipo=2 FOR UPDATE;
@@ -566,14 +569,14 @@ eta tipo c
20 2 ddddddddddddddddddddddddddddddddddddddddddd
40 2 fffffffffffffffffffffffffffffffffffffffffff
60 2 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
-** connection thread1
+connection thread1;
** Begin a new transaction on thread 1
begin;
** Selecting a range for update by table scan will be blocked
** because of on-going transaction on thread 2.
select * from t1 where tipo=1 FOR UPDATE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-** connection thread2
+connection thread2;
** Table will be unchanged and the select command will not be
** blocked:
select * from t1;
@@ -591,10 +594,10 @@ eta tipo c
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** Commit transacton on thread 2.
commit;
-** connection thread1
+connection thread1;
** Commit transaction on thread 1.
commit;
-** connection thread2
+connection thread2;
** Make sure table isn't blocked on thread 2:
select * from t1;
eta tipo c
@@ -609,7 +612,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
** Make sure table isn't blocked on thread 1:
select * from t1;
eta tipo c
@@ -624,13 +627,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** one UPDATE changing result set and DELETE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -645,10 +648,10 @@ 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");
-** connection thread2
+connection thread2;
begin;
delete from t1 where tipo=2;
-** connection thread1
+connection thread1;
begin;
update t1 set tipo=1 where tipo=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -665,7 +668,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -677,9 +680,9 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
commit;
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -690,7 +693,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -701,13 +704,13 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection default
+connection default;
drop table t1;
**
** one UPDATE not changing result set and DELETE
**
-** connection thread1
+connection thread1;
** Set up table
SET SESSION STORAGE_ENGINE = InnoDB;
create table t1(eta int(11) not null, tipo int(11), c varchar(255));
@@ -722,10 +725,10 @@ 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");
-** connection thread2
+connection thread2;
begin;
delete from t1 where tipo=2;
-** connection thread1
+connection thread1;
begin;
** Update on t1 will cause a table scan which will be blocked because
** the previously initiated table scan applied exclusive key locks on
@@ -746,7 +749,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -758,9 +761,9 @@ eta tipo c
80 22 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
commit;
-** connection thread1
+connection thread1;
commit;
-** connection thread2
+connection thread2;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -771,7 +774,7 @@ eta tipo c
70 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii
80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
-** connection thread1
+connection thread1;
select * from t1;
eta tipo c
7 7 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -783,8 +786,11 @@ eta tipo c
80 1 jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
90 11 kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
** Cleanup
-** connection thread2
-** connection default
+connection thread1;
+disconnect thread1;
+connection thread2;
+disconnect thread2;
+connection default;
drop table t1;
drop user mysqltest@localhost;
SET SQL_MODE=default;
diff --git a/mysql-test/r/connect.result b/mysql-test/r/connect.result
index 315aea0ef46..dfe4406605e 100644
--- a/mysql-test/r/connect.result
+++ b/mysql-test/r/connect.result
@@ -1,5 +1,6 @@
SET global secure_auth=0;
drop table if exists t1,t2;
+connect con1,localhost,root,,mysql;
show tables;
Tables_in_mysql
column_stats
@@ -32,14 +33,21 @@ time_zone_name
time_zone_transition
time_zone_transition_type
user
+connect con2,localhost,root,,test;
show tables;
Tables_in_test
connect(localhost,root,z,test2,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,root,z,test2;
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
connect(localhost,root,z,test,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,root,z,;
ERROR 28000: Access denied for user 'root'@'localhost' (using password: YES)
+connection default;
+disconnect con1;
+disconnect con2;
grant ALL on *.* to test@localhost identified by "gambling";
grant ALL on *.* to test@127.0.0.1 identified by "gambling";
+connect con3,localhost,test,gambling,mysql;
show tables;
Tables_in_mysql
column_stats
@@ -72,18 +80,29 @@ time_zone_name
time_zone_transition
time_zone_transition_type
user
+connect con4,localhost,test,gambling,test;
show tables;
Tables_in_test
+connection default;
+disconnect con3;
+disconnect con4;
connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,,test2;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,,"",MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,,'""';
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,zorro,test2;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,zorro,;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
update mysql.user set password=old_password("gambling2") where user=_binary"test";
flush privileges;
+connect con10,localhost,test,gambling2,;
+connect con5,localhost,test,gambling2,mysql;
+connection con5;
set password="";
set password='gambling3';
ERROR HY000: Password hash should be a 41-digit hexadecimal number
@@ -120,22 +139,35 @@ time_zone_name
time_zone_transition
time_zone_transition_type
user
+connect con6,localhost,test,gambling3,test;
show tables;
Tables_in_test
+connection default;
+disconnect con10;
+disconnect con5;
+disconnect con6;
connect(localhost,test,,test2,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,,test2;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,,test,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,,;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: NO)
connect(localhost,test,zorro,test2,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,zorro,test2;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
connect(localhost,test,zorro,test,MASTER_PORT,MASTER_SOCKET);
+connect fail_con,localhost,test,zorro,;
ERROR 28000: Access denied for user 'test'@'localhost' (using password: YES)
delete from mysql.user where user=_binary"test";
flush privileges;
+connect con7,localhost,root,,test;
+connection con7;
create table t1 (id integer not null auto_increment primary key);
create temporary table t2(id integer not null auto_increment primary key);
set @id := 1;
delete from t1 where id like @id;
+connection default;
+disconnect con7;
drop table t1;
# ------------------------------------------------------------------
# -- End of 4.1 tests
@@ -153,6 +185,7 @@ SET GLOBAL event_scheduler = ON;
# -- Waiting for Event Scheduler to start...
# -- Disconnecting default connection...
+disconnect default;
# -- Check that we allow exactly three user connections, no matter how
# -- many threads are running.
@@ -202,8 +235,13 @@ SET GLOBAL event_scheduler = OFF;
# -- Waiting for Event Scheduler to stop...
# -- That's it. Closing connections...
+disconnect con_1;
+disconnect con_2;
+disconnect con_3;
+disconnect con_super_1;
# -- Restoring default connection...
+connect default,localhost,root,,test;
# -- Waiting for connections to close...
@@ -224,6 +262,7 @@ SET GLOBAL event_scheduler = ON;
# -- Waiting for Event Scheduler to start...
# -- Opening a new connection to check max_used_connections...
+connect con_1,localhost,root;
# -- Check that max_used_connections hasn't changed.
SHOW STATUS LIKE 'max_used_connections';
@@ -231,6 +270,8 @@ Variable_name Value
Max_used_connections 2
# -- Closing new connection...
+disconnect con_1;
+connection default;
# -- Stopping Event Scheduler...
SET GLOBAL event_scheduler = OFF;
@@ -238,9 +279,13 @@ SET GLOBAL event_scheduler = OFF;
# -- End of Bug#35074.
+connect extracon,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,;
+connection extracon;
SELECT 'Connection on extra port ok';
Connection on extra port ok
Connection on extra port ok
+connect extracon2,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,;
+connection extracon2;
SELECT 'Connection on extra port 2 ok';
Connection on extra port 2 ok
Connection on extra port 2 ok
@@ -251,6 +296,9 @@ Connection on extra port 2 ok
#
GRANT ALL ON test.* TO 'O1234567890123456789012345678901234567890123456789012345678901234567890123456789'@'localhost' IDENTIFIED BY 'test123';
FLUSH PRIVILEGES;
+connect con1,localhost,O1234567890123456789012345678901234567890123456789012345678901234567890123456789x,test123,test;
+disconnect con1;
+connection default;
DROP USER 'O1234567890123456789012345678901234567890123456789012345678901234567890123456789'@'localhost';
FLUSH PRIVILEGES;
#
@@ -259,22 +307,36 @@ FLUSH PRIVILEGES;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
+disconnect extracon;
+disconnect extracon2;
+connection default;
CREATE USER mysqltest_up1 IDENTIFIED VIA mysql_native_password using '*E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB';
CREATE USER mysqltest_up2 IDENTIFIED VIA mysql_old_password using '09301740536db389';
connect(localhost,mysqltest_up1,foo,test,MASTER_PORT,MASTER_SOCKET);
+connect pcon1,localhost,mysqltest_up1,foo,,$MASTER_MYPORT,;
ERROR 28000: Access denied for user 'mysqltest_up1'@'localhost' (using password: YES)
+connect pcon2,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,;
+connection pcon2;
select user(), current_user();
user() current_user()
mysqltest_up1@localhost mysqltest_up1@%
+disconnect pcon2;
connect(localhost,mysqltest_up2,newpw,test,MASTER_PORT,MASTER_SOCKET);
+connect pcon3,localhost,mysqltest_up2,newpw,,$MASTER_MYPORT,;
ERROR 28000: Access denied for user 'mysqltest_up2'@'localhost' (using password: YES)
+connect pcon4,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,;
+connection pcon4;
select user(), current_user();
user() current_user()
mysqltest_up2@localhost mysqltest_up2@%
+disconnect pcon4;
connect(localhost,mysqltest_nouser,newpw,test,MASTER_PORT,MASTER_SOCKET);
+connect pcon5,localhost,mysqltest_nouser,newpw,,$MASTER_MYPORT,;
ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: YES)
connect(localhost,mysqltest_nouser,,test,MASTER_PORT,MASTER_SOCKET);
+connect pcon5,localhost,mysqltest_nouser,,,$MASTER_MYPORT,;
ERROR 28000: Access denied for user 'mysqltest_nouser'@'localhost' (using password: NO)
+connection default;
update mysql.user set plugin='mysql_native_password' where user = 'mysqltest_up1';
update mysql.user set plugin='mysql_old_password' where user = 'mysqltest_up2';
select user, password, plugin, authentication_string from mysql.user
@@ -283,12 +345,19 @@ user password plugin authentication_string
mysqltest_up1 *E8D46CE25265E545D225A8A6F1BAF642FEBEE5CB mysql_native_password
mysqltest_up2 09301740536db389 mysql_old_password
flush privileges;
+connect pcon6,localhost,mysqltest_up1,bar,,$MASTER_MYPORT,;
+connection pcon6;
select user(), current_user();
user() current_user()
mysqltest_up1@localhost mysqltest_up1@%
+disconnect pcon6;
+connect pcon7,localhost,mysqltest_up2,oldpw,,$MASTER_MYPORT,;
+connection pcon7;
select user(), current_user();
user() current_user()
mysqltest_up2@localhost mysqltest_up2@%
+disconnect pcon7;
+connection default;
DROP USER mysqltest_up1@'%';
DROP USER mysqltest_up2@'%';
#
diff --git a/mysql-test/r/connect2.result b/mysql-test/r/connect2.result
index eecb6455162..b68f7ae7c43 100644
--- a/mysql-test/r/connect2.result
+++ b/mysql-test/r/connect2.result
@@ -1,44 +1,70 @@
call mtr.add_suppression("Allocation failed");
SET @old_debug= @@session.debug;
set @old_thread_cache_size=@@global.thread_cache_size;
+connect con1,localhost,root,,test,,;
select 1;
1
1
+disconnect con1;
+connection default;
set global debug_dbug='+d,simulate_failed_connection_1';
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,root,,test,,;
Got one of the listed errors
+connection default;
set global debug_dbug=@old_debug;
set global debug_dbug='+d,simulate_failed_connection_2';
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,root,,test,,;
Got one of the listed errors
+connection default;
set global debug_dbug=@old_debug;
+connect con1,localhost,root,,test,,;
select 1;
1
1
+disconnect con1;
+connect con1,localhost,root,,test,$MASTER_EXTRA_PORT,;
select 1;
1
1
+disconnect con1;
+connection default;
set global debug_dbug='+d,simulate_failed_connection_1';
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,root,,test,$MASTER_EXTRA_PORT,;
Got one of the listed errors
+connection default;
set global debug_dbug=@old_debug;
set global debug_dbug='+d,simulate_failed_connection_2';
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,root,,test,$MASTER_EXTRA_PORT,;
Got one of the listed errors
+connection default;
set global debug_dbug=@old_debug;
+connect con1,localhost,root,,test,$MASTER_EXTRA_PORT,;
select 1;
1
1
+disconnect con1;
+connection default;
set @@global.thread_cache_size=2;
+connect con1,localhost,root,,test,$MASTER_EXTRA_PORT,;
select 1;
1
1
+connect con2,localhost,root,,test,$MASTER_EXTRA_PORT,;
select 1;
1
1
+disconnect con1;
+disconnect con2;
+connection default;
set global debug_dbug='+d,simulate_failed_connection_2';
connect(localhost,root,,test,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,root,,test,$MASTER_EXTRA_PORT,;
Got one of the listed errors
+connection default;
show status like "Threads_connected";
Variable_name Value
Threads_connected 1
diff --git a/mysql-test/r/consistent_snapshot.result b/mysql-test/r/consistent_snapshot.result
index 3a0227b1a1a..b978f1dd9d2 100644
--- a/mysql-test/r/consistent_snapshot.result
+++ b/mysql-test/r/consistent_snapshot.result
@@ -1,15 +1,15 @@
DROP TABLE IF EXISTS t1;
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
### Test 1:
### - While a consistent snapshot transaction is executed,
### no external inserts should be visible to the transaction.
-# Switch to connection con1
+connection con1;
CREATE TABLE t1 (a INT) ENGINE=innodb;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
-# Switch to connection con2
+connection con2;
INSERT INTO t1 VALUES(1);
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a
COMMIT;
@@ -18,9 +18,9 @@ COMMIT;
### committed inserts should be visible to the transaction.
DELETE FROM t1;
START TRANSACTION;
-# Switch to connection con2
+connection con2;
INSERT INTO t1 VALUES(1);
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a
1
@@ -31,12 +31,14 @@ COMMIT;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
DELETE FROM t1;
COMMIT WORK AND CHAIN;
-# Switch to connection con2
+connection con2;
INSERT INTO t1 VALUES(1);
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a
1
COMMIT;
-# Switch to connection default + close connections con1 and con2
+connection default;
+disconnect con1;
+disconnect con2;
DROP TABLE t1;
diff --git a/mysql-test/r/create-big.result b/mysql-test/r/create-big.result
index bb8c62bb25c..d041419443e 100644
--- a/mysql-test/r/create-big.result
+++ b/mysql-test/r/create-big.result
@@ -1,11 +1,20 @@
+connect addconroot1, localhost, root,,;
+connect addconroot2, localhost, root,,;
+connect addconroot3, localhost, root,,;
+connection default;
drop table if exists t1,t2,t3,t4,t5;
set debug_sync='RESET';
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
create table t1 (j char(5));;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
ERROR 42S01: Table 't1' already exists
+connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -14,10 +23,15 @@ t1 CREATE TABLE `t1` (
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
create table t1 select 'Test' as j;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
ERROR 42S01: Table 't1' already exists
+connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -27,10 +41,15 @@ drop table t1;
create table t3 (j char(5));
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
create table t1 like t3;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
ERROR 42S01: Table 't1' already exists
+connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -39,10 +58,15 @@ t1 CREATE TABLE `t1` (
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
rename table t3 to t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
ERROR 42S01: Table 't1' already exists
+connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -51,10 +75,15 @@ t1 CREATE TABLE `t1` (
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
alter table t3 rename to t1;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
ERROR 42S01: Table 't1' already exists
+connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -63,10 +92,15 @@ t1 CREATE TABLE `t1` (
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
alter table t3 rename to t1, add k int;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
ERROR 42S01: Table 't1' already exists
+connection default;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -74,30 +108,51 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t3;
set debug_sync='create_table_select_before_open SIGNAL parked WAIT_FOR go';
+connection default;
set debug_sync='create_table_select_before_open SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
drop table t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
rename table t1 to t2;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
drop table t2;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
select * from t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
i
1
+connection default;
drop table t1;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
insert into t1 values (2);;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
select * from t1;
i
1
@@ -106,37 +161,62 @@ drop table t1;
set @a:=0;
set debug_sync='create_table_select_before_create SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
create trigger t1_bi before insert on t1 for each row set @a:=1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
select @a;
@a
0
drop table t1;
set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
drop table t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
rename table t1 to t2;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
drop table t2;
set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
select * from t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
i
1
+connection default;
drop table t1;
set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
insert into t1 values (2);;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
select * from t1;
i
1
@@ -145,27 +225,42 @@ drop table t1;
set @a:=0;
set debug_sync='create_table_select_before_lock SIGNAL parked WAIT_FOR go';
create table t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
create trigger t1_bi before insert on t1 for each row set @a:=1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
select @a;
@a
0
drop table t1;
set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go';
create table if not exists t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
drop table t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
create table t1 (i int);
set @a:=0;
set debug_sync='create_table_select_before_check_if_exists SIGNAL parked WAIT_FOR go';
create table if not exists t1 select 1 as i;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
create trigger t1_bi before insert on t1 for each row set @a:=1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
Warnings:
Note 1050 Table 't1' already exists
+connection addconroot1;
+connection default;
select @a;
@a
0
@@ -178,10 +273,15 @@ create table t1 (i int);
set debug_sync='create_table_like_after_open SIGNAL parked WAIT_FOR go';
reset master;
create table t2 like t1;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
insert into t1 values (1);
drop table t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -203,21 +303,39 @@ create table t1 (i int);
set debug_sync='create_table_like_before_binlog SIGNAL parked WAIT_FOR go';
reset master;
create table t2 like t1;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
insert into t2 values (1);;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
drop table t2;
set debug_sync='create_table_like_before_binlog SIGNAL parked WAIT_FOR go';
create table t2 like t1;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
drop table t2;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
set debug_sync='create_table_like_before_binlog SIGNAL parked WAIT_FOR go';
create table t2 like t1;;
+connection addconroot1;
set debug_sync='now WAIT_FOR parked';
drop table t1;;
+connection addconroot2;
set debug_sync='now SIGNAL go';
+connection default;
+connection addconroot1;
+connection default;
drop table t2;
+disconnect addconroot1;
+disconnect addconroot2;
+disconnect addconroot3;
set debug_sync='RESET';
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index cad46f34c75..7b54f0633b5 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -567,9 +567,13 @@ select database();
database()
NULL
create user mysqltest_1;
+connect user1,localhost,mysqltest_1,,*NO-ONE*;
+connection user1;
select database(), user();
database() user()
NULL mysqltest_1@localhost
+connection default;
+disconnect user1;
drop user mysqltest_1;
use test;
create table t1 (a int, index `primary` (a));
@@ -1813,6 +1817,7 @@ create table t1 (a int, b int) engine=myisam;
create table t2 (a int, b int) engine=myisam;
insert into t1 values (1,1);
lock tables t1 read;
+connect user1,localhost,root,,test;
set @@lock_wait_timeout=5;
create table if not exists t1 (a int, b int);
Warnings:
@@ -1831,6 +1836,8 @@ create table t1 like t2;
ERROR 42S01: Table 't1' already exists
create or replace table t1 (a int, b int) select 2,2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+disconnect user1;
+connection default;
select * from t1;
a b
1 1
diff --git a/mysql-test/r/create_drop_role.result b/mysql-test/r/create_drop_role.result
index 6e05900264d..498dd4c1c02 100644
--- a/mysql-test/r/create_drop_role.result
+++ b/mysql-test/r/create_drop_role.result
@@ -43,6 +43,8 @@ CREATE USER u1@localhost;
REVOKE SHOW DATABASES ON *.* FROM 'u1'@'localhost';
GRANT SHOW DATABASES ON *.* TO role_1;
GRANT role_1 TO u1@localhost;
+connect user_a, localhost, u1,,;
+connection user_a;
SELECT CURRENT_USER;
CURRENT_USER
u1@localhost
@@ -65,6 +67,8 @@ mysql
performance_schema
test
SET ROLE NONE;
+connect user_b, localhost, root,,;
+connection user_b;
# Clearing up
DROP ROLE role_1;
DROP ROLE IF EXISTS role_1;
diff --git a/mysql-test/r/create_or_replace.result b/mysql-test/r/create_or_replace.result
index ed25fbadf45..dc3d00aacc8 100644
--- a/mysql-test/r/create_or_replace.result
+++ b/mysql-test/r/create_or_replace.result
@@ -432,11 +432,18 @@ unlock tables;
CREATE TABLE t1 (col_int_nokey INT) ENGINE=InnoDB;
CREATE OR REPLACE TEMPORARY TABLE tmp LIKE t1;
LOCK TABLE t1 WRITE;
+connect con1,localhost,root,,test;
CREATE OR REPLACE TABLE t1 LIKE tmp;
+connection default;
KILL QUERY con_id;
+connection con1;
ERROR 70100: Query execution was interrupted
CREATE OR REPLACE TABLE t1 (a int);
+connection default;
KILL QUERY con_id;
+connection con1;
ERROR 70100: Query execution was interrupted
+disconnect con1;
+connection default;
drop table t1;
DROP TABLE t2;
diff --git a/mysql-test/r/create_or_replace2.result b/mysql-test/r/create_or_replace2.result
index 6f5e412b91c..47431212492 100644
--- a/mysql-test/r/create_or_replace2.result
+++ b/mysql-test/r/create_or_replace2.result
@@ -17,9 +17,11 @@ t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
KEY `a` (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
SHOW TABLES;
Tables_in_test
t1
+connection master;
drop temporary table if exists tmp;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/r/create_or_replace_permission.result b/mysql-test/r/create_or_replace_permission.result
index f662bf1bfd8..b9938e4270a 100644
--- a/mysql-test/r/create_or_replace_permission.result
+++ b/mysql-test/r/create_or_replace_permission.result
@@ -19,6 +19,8 @@ REVOKE ALTER ROUTINE ON db1.* FROM mysqltest_1@localhost;
GRANT DELETE ON mysql.* TO mysqltest_1@localhost;
REVOKE DELETE ON mysql.* FROM mysqltest_1@localhost;
FLUSH PRIVILEGES;
+connect user_a, localhost, mysqltest_1,,;
+connection user_a;
SELECT CURRENT_USER;
CURRENT_USER
mysqltest_1@localhost
@@ -41,6 +43,7 @@ CREATE OR REPLACE USER u1@localhost;
ERROR 42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
CREATE OR REPLACE ROLE developer;
ERROR 42000: Access denied; you need (at least one of) the CREATE USER privilege(s) for this operation
+connection default;
SELECT CURRENT_USER;
CURRENT_USER
root@localhost
diff --git a/mysql-test/r/cte_grant.result b/mysql-test/r/cte_grant.result
index 4b067f42ff2..1282a98fdef 100644
--- a/mysql-test/r/cte_grant.result
+++ b/mysql-test/r/cte_grant.result
@@ -1,11 +1,17 @@
+connect root,localhost,root,,test;
+connection root;
create database mysqltest;
create user mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
+connection root;
create table mysqltest.t1 (a int, b int);
insert into mysqltest.t1 values (2,10), (1,30);
create table mysqltest.t2 (c int, d char(32));
insert into mysqltest.t2 values (1,'xxx'), (1,'zzz');
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant select (c) on mysqltest.t2 to mysqltest_1@localhost;
+connection user1;
with t as (select c from mysqltest.t2 where c < 2)
select t.c,t1.b from t,mysqltest.t1 where t.c=t1.a;
c b
@@ -18,6 +24,7 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column
with t as (select c,d from mysqltest.t2 where c < 2)
select t.c,t.d,t1.b from t,mysqltest.t1 where t.c=t1.a;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 't2'
+connection root;
create view mysqltest.v1(f1,f2) as
with t as (select c from mysqltest.t2 where c < 2)
select t.c,t1.b from t,mysqltest.t1 where t.c=t1.a;
@@ -27,6 +34,7 @@ select t.a,b from t,mysqltest.t1 where mysqltest.t1.a = t.a;
grant select on mysqltest.v1 to mysqltest_1@localhost;
grant select (c) on mysqltest.v2 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
+connection user1;
create view mysqltest.v3(c,d) as
with t as (select c from mysqltest.t2 where c < 2)
select t.c,t1.b from t,mysqltest.t1 where t.c=t1.a;
@@ -44,11 +52,14 @@ select d from mysqltest.v2;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v2'
select * from mysqltest.v3;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v3'
+connection root;
grant select on mysqltest.v3 to mysqltest_1@localhost;
+connection user1;
select * from mysqltest.v3;
c d
1 30
1 30
+connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
diff --git a/mysql-test/r/ctype_errors.result b/mysql-test/r/ctype_errors.result
index 5ae8c53ce8b..6f9e14a8942 100644
--- a/mysql-test/r/ctype_errors.result
+++ b/mysql-test/r/ctype_errors.result
@@ -1,5 +1,7 @@
Start of 5.4 tests
CREATE TABLE t1(f1 INT);
+connect con1,localhost,root,,test;
+connection con1;
SET lc_messages=ru_RU;
SHOW VARIABLES LIKE 'lc_messages';
Variable_name Value
@@ -9,6 +11,7 @@ ERROR 42S01: \0422\0430\0431\043B\0438\0446\0430 't1' \0443\0436\0435 \0441\0443
SET NAMES utf8;
CREATE TABLE t1(f1 INT);
ERROR 42S01: Таблица 't1' уже ÑущеÑтвует
+connection default;
SHOW VARIABLES LIKE 'lc_messages';
Variable_name Value
lc_messages en_US
@@ -22,21 +25,27 @@ SHOW GLOBAL VARIABLES LIKE 'lc_messages';
Variable_name Value
lc_messages ru_RU
SET GLOBAL lc_messages=en_US;
+disconnect con1;
DROP TABLE t1;
drop table `ק`;
ERROR 42S02: Unknown table 'test.ק'
+connect con1,localhost,root,,test;
+connection con1;
SET lc_messages=cs_CZ;
SET NAMES UTF8;
USE nonexistant;
ERROR 42000: Neznámá databáze 'nonexistant'
+disconnect con1;
+connection default;
#
# Bug#12736295: Buffer overflow for variable converted_err
# with non-latin1 server error message
#
-# Connection con1
+connect con1,localhost,root,,test;
SET lc_messages=ru_RU;
SET NAMES latin1;
SELECT '01234567890123456789012345678901234\';
ERROR 42000: \0423 \0432\0430\0441 \043E\0448\0438\0431\043A\0430 \0432 \0437\0430\043F\0440\043E\0441\0435. \0418\0437\0443\0447\0438\0442\0435 \0434\043E\043A\0443\043C\0435\043D\0442\0430\0446\0438\044E \043F\043E \0438\0441\043F\043E\043B\044C\0437\0443\0435\043C\043E\0439 \0432\0435\0440\0441\0438\0438 MariaDB \043D\0430 \043F\0440\0435\0434\043C\0435\0442 \043A\043E\0440\0440\0435\043A\0442\043D\043E\0433\043E \0441\0438\043D\0442\0430\043A\0441\0438\0441\0430 \043E\043A\043E\043B\043E ''0123456789012345678901234
-# Connection default
+disconnect con1;
+connection default;
End of 5.5 tests
diff --git a/mysql-test/r/ddl_i18n_koi8r.result b/mysql-test/r/ddl_i18n_koi8r.result
index d81b6af0aeb..8423f8fe367 100644
--- a/mysql-test/r/ddl_i18n_koi8r.result
+++ b/mysql-test/r/ddl_i18n_koi8r.result
@@ -61,8 +61,7 @@ SELECT * FROM v3|
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
-
----> connection: con2
+connect con2,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -118,8 +117,7 @@ DROP DATABASE mysqltest1|
---> Restoring mysqltest1...
-
----> connection: con3
+connect con3,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -167,8 +165,9 @@ utf8_general_ci
SELECT * FROM v3|
ÔÅÓÔ
ÔÅÓÔ
-
----> connection: default
+connection default;
+disconnect con2;
+disconnect con3;
use test|
DROP DATABASE mysqltest1|
@@ -477,8 +476,7 @@ utf8_general_ci utf8_general_ci
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
-
----> connection: con2
+connect con2,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -879,8 +877,7 @@ DROP DATABASE mysqltest2|
---> Restoring mysqltest1...
---> Restoring mysqltest2...
-
----> connection: con3
+connect con3,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -1121,8 +1118,9 @@ koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
ca cb
utf8_general_ci utf8_general_ci
-
----> connection: default
+connection default;
+disconnect con2;
+disconnect con3;
use test|
DROP DATABASE mysqltest1|
DROP DATABASE mysqltest2|
@@ -1459,8 +1457,7 @@ ALTER TABLE t1 ADD COLUMN fake INT|
ALTER TABLE t1 DROP COLUMN fake|
ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
-
----> connection: con2
+connect con2,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -1894,8 +1891,7 @@ ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT|
ALTER TABLE mysqltest1.t1 DROP COLUMN fake|
ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
-
----> connection: con3
+connect con3,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -2159,8 +2155,9 @@ ca1 ca2 ca3 cb1 cb2 cb3
koi8r_general_ci utf8_general_ci koi8r_general_ci koi8r_general_ci utf8_general_ci koi8r_general_ci
DELETE FROM mysqltest2.log|
-
----> connection: default
+connection default;
+disconnect con2;
+disconnect con3;
use test|
DROP DATABASE mysqltest1|
DROP DATABASE mysqltest2|
@@ -2348,8 +2345,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
-
----> connection: con2
+connect con2,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -2621,8 +2617,7 @@ DROP DATABASE mysqltest2|
---> Restoring mysqltest1...
---> Restoring mysqltest2...
-
----> connection: con3
+connect con3,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -2829,12 +2824,11 @@ Table Create Table
t2 CREATE TABLE `t2` (
`col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
-
----> connection: con2
-
----> connection: con3
-
----> connection: default
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
USE test;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
diff --git a/mysql-test/r/ddl_i18n_utf8.result b/mysql-test/r/ddl_i18n_utf8.result
index 5921a7f538d..2c9ea77b809 100644
--- a/mysql-test/r/ddl_i18n_utf8.result
+++ b/mysql-test/r/ddl_i18n_utf8.result
@@ -61,8 +61,7 @@ SELECT * FROM v3|
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
-
----> connection: con2
+connect con2,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -118,8 +117,7 @@ DROP DATABASE mysqltest1|
---> Restoring mysqltest1...
-
----> connection: con3
+connect con3,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -167,8 +165,9 @@ koi8r_general_ci
SELECT * FROM v3|
теÑÑ‚
теÑÑ‚
-
----> connection: default
+connection default;
+disconnect con2;
+disconnect con3;
use test|
DROP DATABASE mysqltest1|
@@ -477,8 +476,7 @@ utf8_general_ci utf8_general_ci
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
-
----> connection: con2
+connect con2,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -879,8 +877,7 @@ DROP DATABASE mysqltest2|
---> Restoring mysqltest1...
---> Restoring mysqltest2...
-
----> connection: con3
+connect con3,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -1121,8 +1118,9 @@ utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8
SELECT COLLATION(@a) AS ca, COLLATION(@b) cb|
ca cb
utf8_general_ci utf8_general_ci
-
----> connection: default
+connection default;
+disconnect con2;
+disconnect con3;
use test|
DROP DATABASE mysqltest1|
DROP DATABASE mysqltest2|
@@ -1459,8 +1457,7 @@ ALTER TABLE t1 ADD COLUMN fake INT|
ALTER TABLE t1 DROP COLUMN fake|
ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
-
----> connection: con2
+connect con2,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -1894,8 +1891,7 @@ ALTER TABLE mysqltest1.t1 ADD COLUMN fake INT|
ALTER TABLE mysqltest1.t1 DROP COLUMN fake|
ALTER TABLE mysqltest2.t1 ADD COLUMN fake INT|
ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
-
----> connection: con3
+connect con3,localhost,root,,;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -2159,8 +2155,9 @@ ca1 ca2 ca3 cb1 cb2 cb3
utf8_general_ci utf8_general_ci koi8r_general_ci utf8_general_ci utf8_general_ci koi8r_general_ci
DELETE FROM mysqltest2.log|
-
----> connection: default
+connection default;
+disconnect con2;
+disconnect con3;
use test|
DROP DATABASE mysqltest1|
DROP DATABASE mysqltest2|
@@ -2348,8 +2345,7 @@ END ONE TIME 2030-01-01 00:00:00 NULL NULL NULL NULL ENABLED NOT PRESERVE CREAT
ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
-
----> connection: con2
+connect con2,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -2621,8 +2617,7 @@ DROP DATABASE mysqltest2|
---> Restoring mysqltest1...
---> Restoring mysqltest2...
-
----> connection: con3
+connect con3,localhost,root,,mysqltest1;
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
SET @@collation_connection= cp1251_general_ci|
@@ -2829,12 +2824,11 @@ Table Create Table
t2 CREATE TABLE `t2` (
`col1` varchar(10) COLLATE cp1251_general_cs DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=cp1251 COLLATE=cp1251_general_cs
-
----> connection: con2
-
----> connection: con3
-
----> connection: default
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
USE test;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
diff --git a/mysql-test/r/deadlock_innodb.result b/mysql-test/r/deadlock_innodb.result
index 7a4874d6aab..af78a6aa9d5 100644
--- a/mysql-test/r/deadlock_innodb.result
+++ b/mysql-test/r/deadlock_innodb.result
@@ -1,31 +1,31 @@
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
drop table if exists t1,t2;
-# Switch to connection con1
+connection con1;
create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
id x
0 0
-# Switch to connection con2
+connection con2;
set autocommit=0;
update t1 set x=2 where id = 0;
-# Switch to connection con1
+connection con1;
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
commit;
-# Switch to connection con2
+connection con2;
commit;
-# Switch to connection con1
+connection con1;
select * from t1;
id x
0 2
commit;
drop table t1;
-# Switch to connection con1
+connection con1;
create table t1 (id integer, x integer) engine = InnoDB;
create table t2 (b integer, a integer) engine = InnoDB;
insert into t1 values(0, 0), (300, 300);
@@ -47,19 +47,19 @@ select * from t1;
id x
0 0
300 300
-# Switch to connection con2
+connection con2;
set autocommit=0;
update t1 set x=2 where id = 0;
-# Switch to connection con1
+connection con1;
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
300 300
commit;
-# Switch to connection con2
+connection con2;
commit;
-# Switch to connection con1
+connection con1;
select * from t1;
id x
0 2
@@ -71,7 +71,7 @@ create table t2 (b integer, a integer) engine = InnoDB;
insert into t1 values(0, 0), (300, 300);
insert into t2 values(0, 0), (1, 20), (2, 30);
commit;
-# Switch to connection con1
+connection con1;
select a,b from t2 UNION SELECT id, x from t1 FOR UPDATE;
a b
0 0
@@ -87,7 +87,7 @@ select * from t1;
id x
0 0
300 300
-# Switch to connection con2
+connection con2;
update t2 set a=2 where b = 0;
select * from t2;
b a
@@ -95,22 +95,24 @@ b a
1 20
2 30
update t1 set x=2 where id = 0;
-# Switch to connection con1
+connection con1;
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
300 300
commit;
-# Switch to connection con2
+connection con2;
commit;
-# Switch to connection con1
+connection con1;
select * from t1;
id x
0 2
300 300
commit;
-# Switch to connection default + disconnect con1 and con2
+connection default;
+disconnect con1;
+disconnect con2;
drop table t1, t2;
End of 4.1 tests
set storage_engine=innodb;
diff --git a/mysql-test/r/debug_sync.result b/mysql-test/r/debug_sync.result
index 25fdf523200..8498a908000 100644
--- a/mysql-test/r/debug_sync.result
+++ b/mysql-test/r/debug_sync.result
@@ -234,44 +234,48 @@ Variable_name Value
debug_sync ON - current signal: ''
CREATE USER mysqltest_1@localhost;
GRANT SUPER ON *.* TO mysqltest_1@localhost;
-connection con1, mysqltest_1
+connect con1,localhost,mysqltest_1,,;
SET DEBUG_SYNC= 'RESET';
-connection default
+disconnect con1;
+connection default;
DROP USER mysqltest_1@localhost;
CREATE USER mysqltest_2@localhost;
GRANT ALL ON *.* TO mysqltest_2@localhost;
REVOKE SUPER ON *.* FROM mysqltest_2@localhost;
-connection con1, mysqltest_2
+connect con1,localhost,mysqltest_2,,;
SET DEBUG_SYNC= 'RESET';
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
-connection default
+disconnect con1;
+connection default;
DROP USER mysqltest_2@localhost;
SET DEBUG_SYNC= 'RESET';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT);
-connection con1
+connect con1,localhost,root,,;
SET DEBUG_SYNC= 'before_lock_tables_takes_lock
SIGNAL opened WAIT_FOR flushed';
INSERT INTO t1 VALUES(1);
-connection default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'after_flush_unlock SIGNAL flushed';
FLUSH TABLE t1;
-connection con1
-connection default
+connection con1;
+disconnect con1;
+connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (c1 INT);
LOCK TABLE t1 READ;
-connection con1
+connect con1,localhost,root,,;
SET DEBUG_SYNC= 'wait_for_lock SIGNAL locked EXECUTE 2';
INSERT INTO t1 VALUES (1);
-connection default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
UNLOCK TABLES;
-connection con1
+connection con1;
retrieve INSERT result.
-connection default
+disconnect con1;
+connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/delayed.result b/mysql-test/r/delayed.result
index 98c8b599e88..80b99115055 100644
--- a/mysql-test/r/delayed.result
+++ b/mysql-test/r/delayed.result
@@ -297,16 +297,21 @@ drop table if exists t1;
create table t1 (a int, b int);
insert into t1 values (1,1);
lock table t1 read;
-connection: update
+connect update,localhost,root,,;
+connection update;
insert delayed into t1 values (2,2);;
-connection: select
+connection default;
+connect select,localhost,root,,;
select * from t1;
a b
1 1
-connection: default
+connection default;
select * from t1;
a b
1 1
+connection default;
+disconnect update;
+disconnect select;
unlock tables;
select * from t1;
a b
@@ -359,70 +364,70 @@ CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT);
# Test 1: Using LOCK TABLE
-# Connection con1
+connect con1, localhost, root;
LOCK TABLE t1 WRITE;
-# Connection default
+connection default;
LOCK TABLE t2 WRITE;
# Sending:
INSERT DELAYED INTO t1 VALUES (1);
-# Connection con1
+connection con1;
# Wait until INSERT DELAYED is blocked on table 't1'.
INSERT DELAYED INTO t2 VALUES (1);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
UNLOCK TABLES;
-# Connection default
+connection default;
# Reaping: INSERT DELAYED INTO t1 VALUES (1)
UNLOCK TABLES;
# Test 2: Using ALTER TABLE
START TRANSACTION;
SELECT * FROM t1 WHERE a=0;
a
-# Connection con1
+connection con1;
# Sending:
ALTER TABLE t1 MODIFY a INT UNSIGNED;;
-# Connection default
+connection default;
# Wait until ALTER TABLE is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (3);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
-# Connection con1
+connection con1;
# Reaping: ALTER TABLE t1 COMMENT 'test'
# Test 3: Using RENAME TABLE
-# Connection default
+connection default;
START TRANSACTION;
INSERT INTO t2 VALUES (1);
-# Connection con1
+connection con1;
# Sending:
RENAME TABLE t1 to t5, t2 to t4;
-# Connection default
+connection default;
# Wait until RENAME TABLE is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (4);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
-# Connection con1
+connection con1;
# Reaping: RENAME TABLE t1 to t5, t2 to t4
-# Connection default
+connection default;
# Reverting the renames
RENAME TABLE t5 to t1, t4 to t2;
# Test 4: Two INSERT DELAYED on the same table
START TRANSACTION;
INSERT INTO t2 VALUES (1);
-# Connection con2
+connect con2, localhost, root;
LOCK TABLE t1 WRITE, t2 WRITE;
-# Connection con1
+connection con1;
# Wait until LOCK TABLE is blocked on table 't2'.
INSERT DELAYED INTO t1 VALUES (5);
-# Connection default
+connection default;
# Wait until INSERT DELAYED is blocked on table 't1'.
INSERT DELAYED INTO t1 VALUES (6);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
-# Connection con2
+connection con2;
# Reaping: LOCK TABLE t1 WRITE, t2 WRITE
UNLOCK TABLES;
-# Connection con1
+connection con1;
# Reaping: INSERT DELAYED INTO t1 VALUES (5)
-# Connection default
+connection default;
# Test 5: LOCK TABLES + INSERT DELAYED in one connection.
# This test has triggered some asserts in metadata locking
# subsystem at some point in time..
@@ -434,13 +439,17 @@ LOCK TABLE t1 WRITE;
INSERT DELAYED INTO t2 VALUES (8);
UNLOCK TABLES;
SET AUTOCOMMIT= 1;
-# Connection con2
-# Connection con1
-# Connection default
+connection con2;
+disconnect con2;
+connection con1;
+disconnect con1;
+connection default;
DROP TABLE t1, t2, t3;
#
# Test for bug #56251 "Deadlock with INSERT DELAYED and MERGE tables".
#
+connect con1,localhost,root,,;
+connection default;
drop table if exists t1, t2, tm;
create table t1(a int);
create table t2(a int);
@@ -448,10 +457,10 @@ create table tm(a int) engine=merge union=(t1, t2);
begin;
select * from t1;
a
-# Connection 'con1'.
+connection con1;
# Sending:
alter table t1 comment 'test';
-# Connection 'default'.
+connection default;
# Wait until ALTER TABLE blocks and starts waiting
# for connection 'default'. It should wait with a
# pending SNW lock on 't1'.
@@ -462,7 +471,8 @@ insert delayed into tm values (1);
ERROR HY000: DELAYED option not supported for table 'tm'
# Unblock ALTER TABLE.
commit;
-# Connection 'con1'.
+connection con1;
# Reaping ALTER TABLE:
-# Connection 'default'.
+disconnect con1;
+connection default;
drop tables tm, t1, t2;
diff --git a/mysql-test/r/delete_returning_grant.result b/mysql-test/r/delete_returning_grant.result
index bdd171940ba..b41d48a7112 100644
--- a/mysql-test/r/delete_returning_grant.result
+++ b/mysql-test/r/delete_returning_grant.result
@@ -4,10 +4,14 @@ CREATE TABLE t1 (a int(11), b varchar(32));
INSERT INTO t1 VALUES (7,'ggggggg'),(1,'a'),(3,'ccc'),(4,'dddd'),(1,'A'),
(2,'BB'),(4,'DDDD'),(5,'EEEEE'),(7,'GGGGGGG'),(2,'bb');
CREATE VIEW v1 AS SELECT a, UPPER(b) FROM t1;
+connect root,localhost,root,,test;
+connection root;
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.t1 SELECT * FROM t1;
GRANT DELETE ON mysqltest.* TO mysqltest_1@localhost;
GRANT SELECT(b) ON mysqltest.t1 TO mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
DELETE FROM mysqltest.t1 WHERE a=2 RETURNING b;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 't1'
DELETE FROM mysqltest.t1 RETURNING b;
@@ -22,6 +26,7 @@ DDDD
EEEEE
GGGGGGG
bb
+connection root;
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
@@ -41,15 +46,19 @@ a b
1 a
7 ggggggg
INSERT INTO mysqltest.t1 SELECT * FROM t1;
+connection root;
CREATE VIEW mysqltest.v1(a) AS SELECT a FROM mysqltest.t1;
GRANT SELECT, INSERT ON mysqltest.t1 TO mysqltest_1@localhost;
+connection user1;
DELETE FROM mysqltest.v1;
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
DELETE FROM mysqltest.v1 RETURNING a;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 'v1'
+connection root;
GRANT SELECT ON mysqltest.* TO mysqltest_1@localhost;
+connection user1;
DELETE FROM mysqltest.v1 RETURNING a;
a
7
@@ -65,7 +74,9 @@ a
SELECT * FROM mysqltest.t1;
a b
INSERT INTO mysqltest.t1 SELECT * FROM t1;
+connection root;
DROP DATABASE mysqltest;
+disconnect user1;
DROP USER mysqltest_1@localhost;
DROP VIEW v1;
DROP TABLE t1;
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 1d643333424..d3c0aae91db 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -206,6 +206,8 @@ x
1
create user mysqltest_1;
create table t1 select 1 as a;
+connect con1,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection con1;
set optimizer_switch='derived_merge=off,derived_with_keys=off';
select 2 as a from (select * from t1) b;
ERROR 3D000: No database selected
@@ -385,6 +387,9 @@ ID DATA FID
select t2.* from (select * from t1) as A inner join t2 on A.ID = t2.FID;
ID DATA FID
drop table t1, t2;
+connection con1;
+disconnect con1;
+connection default;
drop user mysqltest_1;
# End of 4.1 tests
SELECT 0 FROM
diff --git a/mysql-test/r/dirty_close.result b/mysql-test/r/dirty_close.result
index f7012ff9c01..d13fdb09192 100644
--- a/mysql-test/r/dirty_close.result
+++ b/mysql-test/r/dirty_close.result
@@ -1,3 +1,8 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
+disconnect con1;
+connection con2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -7,13 +12,25 @@ n
2
3
DROP TABLE t1;
+connection default;
+disconnect con2;
+connection default;
SELECT GET_LOCK("dangling", 0);
GET_LOCK("dangling", 0)
1
+connect con1, localhost, root,,;
+connection con1;
SELECT GET_LOCK('dangling', 3600);;
+connection default;
+disconnect con1;
+connect con1, localhost, root,,;
SELECT GET_LOCK('dangling', 3600);;
+connection default;
SELECT RELEASE_LOCK('dangling');
RELEASE_LOCK('dangling')
1
+connection con1;
GET_LOCK('dangling', 3600)
1
+connection default;
+disconnect con1;
diff --git a/mysql-test/r/drop.result b/mysql-test/r/drop.result
index c23ffbe327b..e2d69a75067 100644
--- a/mysql-test/r/drop.result
+++ b/mysql-test/r/drop.result
@@ -82,13 +82,22 @@ drop table if exists t1;
create table t1 (i int);
create database mysqltest;
lock tables t1 read;
+connect addconroot1, localhost, root,,;
drop table t1;
+connect addconroot2, localhost, root,,;
show open tables;
drop database mysqltest;
+connection default;
select 1;
1
1
unlock tables;
+connection addconroot1;
+connection addconroot2;
+disconnect addconroot2;
+connection addconroot1;
+disconnect addconroot1;
+connection default;
drop table if exists t1,t2;
create table t1 (a int);
create table t2 (a int);
@@ -99,14 +108,20 @@ drop table t1;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
unlock tables;
drop table t1,t2;
+connect addconroot, localhost, root,,;
+connection default;
create table t1 (i int);
create table t2 (i int);
lock tables t1 read;
+connection addconroot;
lock tables t2 read;
drop table t1;
ERROR HY000: Table 't1' was not locked with LOCK TABLES
+connection default;
drop table t1,t2;
ERROR HY000: Table 't1' was locked with a READ lock and can't be updated
+disconnect addconroot;
+connection default;
unlock tables;
drop table t1,t2;
End of 5.0 tests
diff --git a/mysql-test/r/empty_user_table.result b/mysql-test/r/empty_user_table.result
index b93596ab59a..54a7fd4907b 100644
--- a/mysql-test/r/empty_user_table.result
+++ b/mysql-test/r/empty_user_table.result
@@ -2,6 +2,7 @@ create table t1 as select * from mysql.user;
truncate table mysql.user;
flush privileges;
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+connect fail,localhost,u1;
Got one of the listed errors
insert mysql.user select * from t1;
drop table t1;
diff --git a/mysql-test/r/enforce_storage_engine.result b/mysql-test/r/enforce_storage_engine.result
index 6b5e1f6958b..296ed405a72 100644
--- a/mysql-test/r/enforce_storage_engine.result
+++ b/mysql-test/r/enforce_storage_engine.result
@@ -69,8 +69,12 @@ ERROR 42000: Unknown storage engine 'FooBar'
select @@session.enforce_storage_engine;
@@session.enforce_storage_engine
MyISAM
+connect con1,localhost,user_1,,;
+connection con1;
SET SESSION enforce_storage_engine=MyISAM;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+disconnect con1;
+connection default;
SET SESSION enforce_storage_engine=NULL;
SET SESSION sql_mode='NO_ENGINE_SUBSTITUTION';
CREATE TABLE t1 (c1 INT PRIMARY KEY AUTO_INCREMENT, c2 VARCHAR(10)) ENGINE=Memory;
@@ -102,6 +106,8 @@ t1 CREATE TABLE `t1` (
DROP TABLE t1;
SET GLOBAL enforce_storage_engine=Memory;
SET SESSION sql_mode='';
+connect con1,localhost,root,,;
+connection con1;
select @@session.enforce_storage_engine;
@@session.enforce_storage_engine
MEMORY
@@ -119,6 +125,8 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`c1`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
DROP TABLE t1;
+connection default;
+disconnect con1;
set global sql_mode=default;
SET SESSION enforce_storage_engine=NULL;
SET GLOBAL enforce_storage_engine=NULL;
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index 153137bc4f9..70443604f41 100644
--- a/mysql-test/r/events_1.result
+++ b/mysql-test/r/events_1.result
@@ -11,8 +11,10 @@ CREATE DATABASE db_x;
GRANT EVENT ON db_x.* TO pauline@localhost;
USE db_x;
CREATE TABLE x_table(a int);
+connect priv_conn,localhost,pauline,,db_x;
CREATE EVENT e_x1 ON SCHEDULE EVERY 1 SECOND DO DROP DATABASE db_x;
CREATE EVENT e_x2 ON SCHEDULE EVERY 1 SECOND DO DROP TABLE x_table;
+connection default;
SHOW DATABASES LIKE 'db_x';
Database (db_x)
db_x
@@ -24,8 +26,11 @@ SHOW TABLES FROM db_x;
Tables_in_db_x
x_table
SET GLOBAL event_scheduler=off;
+connection priv_conn;
DROP EVENT e_x1;
DROP EVENT e_x2;
+disconnect priv_conn;
+connection default;
DROP DATABASE db_x;
DROP USER pauline@localhost;
USE events_test;
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index bde4f1c785b..e8b849f8ce3 100644
--- a/mysql-test/r/events_bugs.result
+++ b/mysql-test/r/events_bugs.result
@@ -203,10 +203,13 @@ drop database if exists mysqltest_db1;
create user mysqltest_user1@localhost;
create database mysqltest_db1;
grant event on events_test.* to mysqltest_user1@localhost;
+connect conn2,localhost,mysqltest_user1,,events_test;
create event mysqltest_user1 on schedule every 10 second do select 42;
alter event mysqltest_user1 rename to mysqltest_db1.mysqltest_user1;
ERROR 42000: Access denied for user 'mysqltest_user1'@'localhost' to database 'mysqltest_db1'
"Let's test now rename when there is no select DB"
+disconnect conn2;
+connect conn2,localhost,mysqltest_user1,,*NO-ONE*;
select database();
database()
NULL
@@ -216,6 +219,8 @@ select event_schema, event_name, definer, event_type, status from information_sc
event_schema event_name definer event_type status
events_test mysqltest_user1 mysqltest_user1@localhost RECURRING ENABLED
drop event events_test.mysqltest_user1;
+disconnect conn2;
+connection default;
drop user mysqltest_user1@localhost;
drop database mysqltest_db1;
create event e_53 on schedule at (select s1 from ttx) do drop table t;
@@ -366,6 +371,7 @@ SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
e1 mysqltest_u1@localhost
DROP EVENT e1;
+connect conn1, localhost, mysqltest_u1, , events_test;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
SELECT event_name, definer FROM INFORMATION_SCHEMA.EVENTS;
event_name definer
@@ -390,6 +396,8 @@ CREATE DEFINER=root@localhost EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT 1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
DROP EVENT e1;
ERROR HY000: Unknown event 'e1'
+disconnect conn1;
+connection default;
DROP USER mysqltest_u1@localhost;
SET GLOBAL EVENT_SCHEDULER= OFF;
SET @save_time_zone= @@TIME_ZONE;
@@ -586,7 +594,7 @@ Grants for evtest1@localhost
GRANT USAGE ON *.* TO 'evtest1'@'localhost' IDENTIFIED BY PASSWORD '*3170F3644E31580C25DE4A08F4C07CC9A2D40C32'
GRANT SELECT, INSERT ON `test`.* TO 'evtest1'@'localhost'
GRANT SELECT, INSERT, CREATE, EVENT ON `events_test`.* TO 'evtest1'@'localhost'
-connection e1;
+connect e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK;
CREATE EVENT ev_sched_1823 ON SCHEDULE EVERY 2 SECOND
DO BEGIN
SET AUTOCOMMIT = 0;
@@ -615,6 +623,7 @@ Sleep 4 seconds
SELECT COUNT(*) > @row_cnt AS "Expect 0" FROM events_test.event_log;
Expect 0
0
+disconnect e1;
DROP EVENT events_test.ev_sched_1823;
DROP TABLE events_test.event_log;
SET GLOBAL event_scheduler = OFF;
@@ -640,9 +649,7 @@ GRANT EVENT ON *.* TO mysqltest_u1@localhost;
SET GLOBAL READ_ONLY = 1;
-#
-# Connection: u1_con (mysqltest_u1@localhost/events_test).
-#
+connect u1_con,localhost,mysqltest_u1,,events_test;
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
@@ -653,9 +660,7 @@ ERROR HY000: The MariaDB server is running with the --read-only option so it can
DROP EVENT e1;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
-#
-# Connection: root_con (root@localhost/events_test).
-#
+connect root_con,localhost,root,,events_test;
CREATE EVENT e1 ON SCHEDULE AT '2020-01-01 00:00:00' DO SET @a = 1;
@@ -665,9 +670,7 @@ DROP EVENT e1;
SET GLOBAL READ_ONLY = 0;
-#
-# Connection: u1_con (mysqltest_u1@localhost/test).
-#
+connection u1_con;
CREATE EVENT e1 ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 SECOND DO SET @a = 1;
CREATE EVENT e2 ON SCHEDULE EVERY 1 SECOND DO SET @a = 1;
@@ -682,9 +685,7 @@ event_name last_executed IS NULL definer
e1 1 mysqltest_u1@localhost
e2 1 mysqltest_u1@localhost
-#
-# Connection: root_con (root@localhost/events_test).
-#
+connection root_con;
SET GLOBAL READ_ONLY = 1;
@@ -714,9 +715,9 @@ DROP EVENT e2;
SET GLOBAL READ_ONLY = 0;
-#
-# Connection: default
-#
+disconnect u1_con;
+disconnect root_con;
+connection default;
DROP USER mysqltest_u1@localhost;
diff --git a/mysql-test/r/events_grant.result b/mysql-test/r/events_grant.result
index 0fb589dfba5..a054e58494b 100644
--- a/mysql-test/r/events_grant.result
+++ b/mysql-test/r/events_grant.result
@@ -12,6 +12,7 @@ CREATE USER ev_test@localhost;
GRANT ALL ON events_test.* to ev_test@localhost;
GRANT ALL ON events_test2.* to ev_test@localhost;
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
+connect ev_con1,localhost,ev_test,,events_test2;
select "NEW CONNECTION";
NEW CONNECTION
NEW CONNECTION
@@ -52,9 +53,12 @@ events_test two_event ev_test@localhost SYSTEM RECURRING NULL 20 # # NULL ENABLE
"This should show us no events:";
SHOW EVENTS FROM test LIKE '%';
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+connection default;
GRANT EVENT ON events_test2.* TO ev_test@localhost;
+connection ev_con1;
USE events_test2;
CREATE EVENT four_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
+connection default;
USE events_test;
"We should see 4 events : one_event, two_event, three_event & four_event"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
@@ -70,9 +74,11 @@ EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_
def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
+connection default;
CREATE DATABASE events_test2;
USE events_test2;
CREATE EVENT five_event ON SCHEDULE EVERY 20 SECOND DO SELECT 42;
+connection ev_con1;
"Should see 4 events - one, two, three & five"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
@@ -80,7 +86,9 @@ def events_test one_event root@localhost SQL SELECT 123 RECURRING NULL 10 SECOND
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+connection default;
REVOKE EVENT ON events_test2.* FROM ev_test@localhost;
+connection ev_con1;
USE test;
"Should see 3 events - one, two & three"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
@@ -95,8 +103,10 @@ ALTER EVENT one_event ON SCHEDULE EVERY 10 SECOND;
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def events_test one_event ev_test@localhost SQL SELECT 123 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE
+connection default;
USE events_test;
ALTER EVENT one_event COMMENT "comment";
+connection ev_con1;
"The definer should be root@localhost"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
@@ -106,16 +116,22 @@ ALTER EVENT one_event DO SELECT 12;
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_NAME='one_event';
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def events_test one_event ev_test@localhost SQL SELECT 12 RECURRING NULL 10 SECOND ENABLED NOT PRESERVE comment
+connection default;
"make the definer again root@localhost"
ALTER EVENT one_event COMMENT "new comment";
+connection ev_con1;
"test DROP by another user"
DROP EVENT one_event;
+connection default;
"One event should not be there"
SELECT EVENT_CATALOG, EVENT_SCHEMA, EVENT_NAME, DEFINER, EVENT_BODY, EVENT_DEFINITION, EVENT_TYPE, EXECUTE_AT, INTERVAL_VALUE, INTERVAL_FIELD, STATUS,ON_COMPLETION, EVENT_COMMENT FROM INFORMATION_SCHEMA.EVENTS ORDER BY EVENT_SCHEMA, EVENT_NAME;
EVENT_CATALOG EVENT_SCHEMA EVENT_NAME DEFINER EVENT_BODY EVENT_DEFINITION EVENT_TYPE EXECUTE_AT INTERVAL_VALUE INTERVAL_FIELD STATUS ON_COMPLETION EVENT_COMMENT
def events_test three_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED PRESERVE three event
def events_test two_event ev_test@localhost SQL SELECT 123 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE two event
def events_test2 five_event root@localhost SQL SELECT 42 RECURRING NULL 20 SECOND ENABLED NOT PRESERVE
+connection ev_con1;
+disconnect ev_con1;
+connection default;
DROP USER ev_test@localhost;
DROP DATABASE events_test2;
DROP DATABASE events_test;
diff --git a/mysql-test/r/events_stress.result b/mysql-test/r/events_stress.result
index 6015e7c53eb..1a91ff0f528 100644
--- a/mysql-test/r/events_stress.result
+++ b/mysql-test/r/events_stress.result
@@ -9,8 +9,11 @@ GRANT ALL ON *.* TO event_user2@localhost;
CREATE USER event_user3@localhost;
CREATE DATABASE events_conn3_db;
GRANT ALL ON *.* TO event_user3@localhost;
+connect conn2,localhost,event_user2,,events_conn2_db;
"In the second connection we create some events which won't be dropped till the end"
+connect conn3,localhost,event_user3,,events_conn3_db;
"In the second connection we create some events which won't be dropped till the end"
+connection default;
USE events_conn1_test2;
CREATE EVENT ev_drop1 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1;
CREATE EVENT ev_drop2 ON SCHEDULE EVERY 10 MINUTE DISABLE DO SELECT 1;
@@ -52,13 +55,21 @@ USE events_conn1_test2;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.EVENTS WHERE EVENT_SCHEMA='events_conn1_test2';
COUNT(*)
50
+connection conn2;
DROP DATABASE events_conn2_db;
+connection conn3;
DROP DATABASE events_conn3_db;
+connection default;
DROP DATABASE events_conn1_test2;
DROP DATABASE events_conn1_test3;
SET GLOBAL event_scheduler=off;
DROP DATABASE events_conn1_test4;
SET GLOBAL event_scheduler=on;
+connection conn2;
+disconnect conn2;
+connection conn3;
+disconnect conn3;
+connection default;
USE events_test;
DROP TABLE fill_it1;
DROP TABLE fill_it2;
diff --git a/mysql-test/r/events_trans_notembedded.result b/mysql-test/r/events_trans_notembedded.result
index fb68bc9ceab..324e28ddb62 100644
--- a/mysql-test/r/events_trans_notembedded.result
+++ b/mysql-test/r/events_trans_notembedded.result
@@ -6,6 +6,7 @@ create user mysqltest_user1@localhost;
grant create, insert, select, delete on mysqltest_db2.*
to mysqltest_user1@localhost;
create database mysqltest_db2;
+connect conn1,localhost,mysqltest_user1,,mysqltest_db2;
set autocommit=off;
select @@autocommit;
@@autocommit
@@ -41,6 +42,8 @@ a
OK: drop event: insufficient privileges
delete from t1;
commit work;
+disconnect conn1;
+connection default;
drop user mysqltest_user1@localhost;
drop database mysqltest_db2;
drop database events_test;
diff --git a/mysql-test/r/explain_slowquerylog.result b/mysql-test/r/explain_slowquerylog.result
index 8acbdc69a4c..2b350cf04ff 100644
--- a/mysql-test/r/explain_slowquerylog.result
+++ b/mysql-test/r/explain_slowquerylog.result
@@ -12,11 +12,14 @@ drop table t0;
#
# MDEV-5047 virtual THD::~THD(): Assertion `status_var.memory_used == 0' fails on disconnect
#
+connect con1,localhost,root,,;
ALTER TABLE nonexisting ENABLE KEYS;
ERROR 42S02: Table 'test.nonexisting' doesn't exist
SHOW WARNINGS;
Level Code Message
Error 1146 Table 'test.nonexisting' doesn't exist
+disconnect con1;
+connection default;
SELECT 1;
1
1
diff --git a/mysql-test/r/failed_auth_3909.result b/mysql-test/r/failed_auth_3909.result
index 0a757e2cee2..8b41ef4618a 100644
--- a/mysql-test/r/failed_auth_3909.result
+++ b/mysql-test/r/failed_auth_3909.result
@@ -9,10 +9,13 @@ Warning 1364 Field 'x509_subject' doesn't have a default value
Warning 1364 Field 'authentication_string' doesn't have a default value
flush privileges;
connect(localhost,u1,,test,MASTER_PORT,MASTER_SOCKET);
+connect fail,localhost,u1;
ERROR HY000: Plugin 'bar' is not loaded
connect(localhost,u2,,test,MASTER_PORT,MASTER_SOCKET);
+connect fail,localhost,u2;
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
connect(localhost,u2,password,test,MASTER_PORT,MASTER_SOCKET);
+connect fail,localhost,u2,password;
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: YES)
ERROR HY000: Plugin 'bar' is not loaded
ERROR 28000: Access denied for user 'u2'@'localhost' (using password: NO)
diff --git a/mysql-test/r/failed_auth_unixsocket.result b/mysql-test/r/failed_auth_unixsocket.result
index 3cf58ca5bec..680d3b48a33 100644
--- a/mysql-test/r/failed_auth_unixsocket.result
+++ b/mysql-test/r/failed_auth_unixsocket.result
@@ -1,6 +1,7 @@
update mysql.user set plugin='unix_socket';
flush privileges;
connect(localhost,USER,,test,MASTER_PORT,MASTER_SOCKET);
+connect fail,localhost,$USER;
ERROR HY000: Plugin 'unix_socket' is not loaded
ERROR HY000: Plugin 'unix_socket' is not loaded
install plugin unix_socket soname 'auth_socket.so';
diff --git a/mysql-test/r/filesort_debug.result b/mysql-test/r/filesort_debug.result
index 13912ac8756..3eced35d58b 100644
--- a/mysql-test/r/filesort_debug.result
+++ b/mysql-test/r/filesort_debug.result
@@ -18,17 +18,21 @@ DROP FUNCTION f1;
# Bug #11747102
# 30771: LOG MORE INFO ABOUT THREADS KILL'D AND SORT ABORTED MESSAGES
#
-# connection 1
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
SET DEBUG_SYNC='filesort_start SIGNAL filesort_started WAIT_FOR filesort_killed';
# Sending: (not reaped since connection is killed later)
SELECT * FROM t1 ORDER BY f1 ASC, f0;
-# connection 2
+connection con2;
SET DEBUG_SYNC='now WAIT_FOR filesort_started';
KILL @id;
SET DEBUG_SYNC='now SIGNAL filesort_killed';
-# connection default
+connection default;
+disconnect con1;
+disconnect con2;
SET DEBUG_SYNC= "RESET";
DROP TABLE t1;
#
diff --git a/mysql-test/r/flush-innodb-notembedded.result b/mysql-test/r/flush-innodb-notembedded.result
index 911abfe6daf..0b63a7b3519 100644
--- a/mysql-test/r/flush-innodb-notembedded.result
+++ b/mysql-test/r/flush-innodb-notembedded.result
@@ -8,26 +8,31 @@ GRANT CREATE, DROP ON *.* TO user2@localhost;
GRANT RELOAD, SELECT ON *.* TO user3@localhost;
GRANT SELECT, LOCK TABLES ON *.* TO user4@localhost;
GRANT RELOAD, LOCK TABLES ON *.* TO user5@localhost;
-# Connection con1 as user1
+connect con1, localhost, user1;
FLUSH TABLE db1.t1 FOR EXPORT;
UNLOCK TABLES;
-# Connection default
-# Connection con1 as user2
+disconnect con1;
+connection default;
+connect con1, localhost, user2;
FLUSH TABLE db1.t1 FOR EXPORT;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
-# Connection default
-# Connection con1 as user3
+disconnect con1;
+connection default;
+connect con1, localhost, user3;
FLUSH TABLE db1.t1 FOR EXPORT;
ERROR 42000: Access denied for user 'user3'@'localhost' to database 'db1'
-# Connection default
-# Connection con1 as user4
+disconnect con1;
+connection default;
+connect con1, localhost, user4;
FLUSH TABLE db1.t1 FOR EXPORT;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
-# Connection default
-# Connection con1 as user5
+disconnect con1;
+connection default;
+connect con1, localhost, user5;
FLUSH TABLE db1.t1 FOR EXPORT;
ERROR 42000: SELECT command denied to user 'user5'@'localhost' for table 't1'
-# Connection default
+disconnect con1;
+connection default;
DROP USER user1@localhost, user2@localhost, user3@localhost,
user4@localhost, user5@localhost;
DROP TABLE db1.t1;
diff --git a/mysql-test/r/flush-innodb.result b/mysql-test/r/flush-innodb.result
index d596ffbbd51..bd09f0d62dc 100644
--- a/mysql-test/r/flush-innodb.result
+++ b/mysql-test/r/flush-innodb.result
@@ -71,26 +71,26 @@ DROP VIEW v1;
#
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) engine= InnoDB;
CREATE TABLE t2 (a INT) engine= InnoDB;
-# Connection con1
+connect con1, localhost, root;
START TRANSACTION;
INSERT INTO t1 VALUES (1, 1);
-# Connection default
+connection default;
# Should be blocked
# Sending:
FLUSH TABLES t1 FOR EXPORT;
-# Connection con1
+connection con1;
COMMIT;
-# Connection default
+connection default;
# Reaping: FLUSH TABLES t1 FOR EXPORT
-# Connection con1
+connection con1;
# Should not be blocked
INSERT INTO t2 VALUES (1);
# Should be blocked
# Sending:
INSERT INTO t1 VALUES (2, 2);
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con1
+connection con1;
# Reaping: INSERT INTO t1 VALUES (2, 2);
# Test 3: Read operations should not be affected.
#
@@ -99,17 +99,17 @@ SELECT * FROM t1;
a b
1 1
2 2
-# Connection default
+connection default;
# Should not be blocked
FLUSH TABLES t1 FOR EXPORT;
-# Connection con1
+connection con1;
COMMIT;
# Should not be blocked
SELECT * FROM t1;
a b
1 1
2 2
-# Connection default
+connection default;
UNLOCK TABLES;
# Test 4: Blocked by DDL, blocks DDL.
#
@@ -118,39 +118,40 @@ SELECT * FROM t1;
a b
1 1
2 2
-# Connection con2
+connect con2, localhost, root;
# Sending:
ALTER TABLE t1 ADD INDEX i1(b);
-# Connection con1
+connection con1;
# Should be blocked
FLUSH TABLE t1 FOR EXPORT;
-# Connection default
+connection default;
COMMIT;
-# Connection con2
+connection con2;
# Reaping ALTER TABLE ...
-# Connection con1
+connection con1;
# Reaping FLUSH TABLE t1 FOR EXPORT
UNLOCK TABLES;
-# Connection default
+connection default;
FLUSH TABLE t1 FOR EXPORT;
-# Connection con2
+connection con2;
# Should be blocked
DROP TABLE t1;
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con2
+connection con2;
# Reaping DROP TABLE t1
-# Connection default
+disconnect con2;
+connection default;
DROP TABLE t2;
# Test 5: Compatibilty with FLUSH TABLES WITH READ LOCK
#
CREATE TABLE t1(a INT) engine= InnoDB;
FLUSH TABLES WITH READ LOCK;
-# Connection con1
+connection con1;
# This should not block
FLUSH TABLE t1 FOR EXPORT;
UNLOCK TABLES;
-# Connection default
+connection default;
UNLOCK TABLES;
DROP TABLE t1;
# Test 6: Unsupported storage engines.
@@ -159,8 +160,9 @@ CREATE TABLE t1(a INT) engine= MEMORY;
FLUSH TABLE t1 FOR EXPORT;
ERROR HY000: Storage engine MEMORY of the table `test`.`t1` doesn't have this option
DROP TABLE t1;
-# Connection con1
-# Connection defalt
+connection con1;
+disconnect con1;
+connection default;
# Test 7: Check privileges required.
# in flush-innodb-notembedded.test
# Test 8: FLUSH TABLE <table_list> FOR EXPORT is incompatible
@@ -169,38 +171,39 @@ DROP TABLE t1;
#
CREATE TABLE t1 (a INT) engine= InnoDB;
CREATE TABLE t2 (a INT) engine= InnoDB;
-# Connection con1
+connect con1, localhost, root;
FLUSH TABLE t1 FOR EXPORT;
-# Connection default
+connection default;
# This should not block
FLUSH TABLE t2 FOR EXPORT;
UNLOCK TABLES;
# This should block
# Sending:
FLUSH TABLE t1 FOR EXPORT;
-# Connection con1
+connection con1;
UNLOCK TABLES;
-# Connection default
+connection default;
# Reaping: FLUSH TABLE t1 FOR EXPORT
UNLOCK TABLES;
# Test 9: LOCK TABLES ... READ is not affected
#
LOCK TABLE t1 READ;
-# Connection con1
+connection con1;
# Should not block
FLUSH TABLE t1 FOR EXPORT;
UNLOCK TABLES;
-# Connection default
+connection default;
UNLOCK TABLES;
FLUSH TABLE t1 FOR EXPORT;
-# Connection con1
+connection con1;
# Should not block
LOCK TABLE t1 READ;
UNLOCK TABLES;
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con1
-# Connection default
+connection con1;
+disconnect con1;
+connection default;
DROP TABLE t1, t2;
# Test 10: Lock is released if transaction is started after doing
# 'flush table..' in same session
@@ -217,30 +220,30 @@ UNLOCK TABLES;
DROP TABLE t1;
# Test 11: Test 'flush table with fully qualified table names
# and with syntax local/NO_WRITE_TO_BINLOG
-# Connection con1
-# Connection default
+connect con1, localhost, root;
+connection default;
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
INSERT INTO t1 VALUES (100),(200);
FLUSH LOCAL TABLES test.t1 FOR EXPORT;
-# Connection con1
+connection con1;
# Should be blocked
# Sending:
FLUSH LOCAL TABLES t1 FOR EXPORT;
-# Connection default
+connection default;
UNLOCK TABLE;
-# Connection con1
+connection con1;
# Reaping: FLUSH LOCAL TABLES t1 FOR EXPORT
SELECT * FROM t1 ORDER BY i;
i
100
200
-# Connection default
+connection default;
# Should be blocked
# Sending:
FLUSH NO_WRITE_TO_BINLOG TABLES test.t1 FOR EXPORT;
-# Connection con1
+connection con1;
UNLOCK TABLES;
-# Connection default
+connection default;
# Reaping: FLUSH NO_WRITE_TO_BINLOG TABLES test.t1 FOR EXPORT
SELECT * FROM t1 ORDER BY i;
i
@@ -250,7 +253,7 @@ UNLOCK TABLE;
DROP TABLE t1;
# Test 12: Active transaction get committed if user execute
# "FLUSH TABLE ... FOR EXPORT" or "LOCK TABLE.."
-# Connection default
+connection default;
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
INSERT INTO t1 VALUES (100),(200);
START TRANSACTION;
@@ -278,7 +281,7 @@ UNLOCK TABLES;
DROP TABLE t1;
# Test 13: Verify "FLUSH TABLE ... FOR EXPORT" and "LOCK TABLE.."
# in same session
-# Connection default
+connection default;
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
# Lock table
LOCK TABLES test.t1 WRITE;
@@ -294,6 +297,9 @@ ERROR HY000: Can't execute the given command because you have active locked tabl
LOCK TABLES test.t1 WRITE;
UNLOCK TABLES;
DROP TABLE t1;
+connection con1;
+disconnect con1;
+connection default;
# Reset innodb_file_per_table
SET GLOBAL innodb_file_per_table= @old_innodb_file_per_table;
# End of 5.6 tests
diff --git a/mysql-test/r/flush.result b/mysql-test/r/flush.result
index b64351045bf..2c651b71a66 100644
--- a/mysql-test/r/flush.result
+++ b/mysql-test/r/flush.result
@@ -1,27 +1,42 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
drop table if exists t1,t2;
drop database if exists mysqltest;
create temporary table t1(n int not null primary key);
create table t2(n int);
insert into t2 values(3);
+connection con1;
select * from t1;
n
3
+connection con2;
flush tables with read lock and disable checkpoint;
drop table t2;
ERROR HY000: Can't execute the query because you have a conflicting read lock
+connection con1;
drop table t2;
+connection con2;
unlock tables;
+connection con1;
+connection con1;
create database mysqltest;
create table mysqltest.t1(n int);
insert into mysqltest.t1 values (23);
flush tables with read lock;
+connection con2;
drop database mysqltest;
+connection con1;
select * from mysqltest.t1;
n
23
unlock tables;
+connection con2;
+connection con1;
create table t1 (n int);
flush tables with read lock;
+disconnect con1;
+connection con2;
insert into t1 values (345);
select * from t1;
n
@@ -54,10 +69,22 @@ unlock tables;
drop table t1, t2, t3;
create table t1 (c1 int);
create table t2 (c1 int);
+connect con1,localhost,root,,;
+connect con3,localhost,root,,;
+connection con1;
lock table t1 write;
+connection con2;
flush tables with read lock;
+connection con3;
insert into t2 values(1);
+connection con1;
unlock tables;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
drop table t1, t2;
drop table if exists t1, t2;
set session low_priority_updates=1;
@@ -77,7 +104,10 @@ ERROR HY000: Can't execute the given command because you have active locked tabl
unlock tables;
drop table t1, t2;
set session low_priority_updates=default;
+connect con1,localhost,root,,;
select benchmark(200, (select sin(1))) > 1000;
+disconnect con1;
+connection default;
End of 5.0 tests
set @old_general_log= @@general_log;
set @old_read_only= @@read_only;
@@ -189,13 +219,14 @@ insert into t3 (a) values (2);
#
# III. Concurrent tests.
#
-# --> connection default
+connect con1,localhost,root,,;
#
# Check that flush tables <list> with read lock
# does not affect non-locked tables.
+connection default;
#
flush tables t1 with read lock;
-# --> connection con1;
+connection con1;
select * from t1;
a
1
@@ -203,7 +234,7 @@ select * from t2;
a
1
insert into t2 (a) values (3);
-# --> connection default;
+connection default;
unlock tables;
#
# Check that "FLUSH TABLES <list> WITH READ LOCK" is
@@ -211,13 +242,13 @@ unlock tables;
# Vice versa it is not true, since tables read-locked by
# "FLUSH TABLES <list> WITH READ LOCK" can't be flushed.
flush tables with read lock;
-# --> connection con1;
+connection con1;
flush table t1 with read lock;
select * from t1;
a
1
unlock tables;
-# --> connection default;
+connection default;
unlock tables;
#
# Check that FLUSH TABLES t1 WITH READ LOCK
@@ -225,32 +256,34 @@ unlock tables;
# WITH READ LOCK.
#
flush table t1 with read lock;
-# --> connection con1
+connection con1;
flush table t2 with read lock;
unlock tables;
-# --> connection default
+connection default;
unlock tables;
#
# Check that FLUSH TABLES t1 WITH READ LOCK
# does not conflict with SET GLOBAL read_only=1.
#
set global read_only=1;
-# connection con1
+connection con1;
flush table t1 with read lock;
unlock tables;
-# connection default
+connection default;
set global read_only=0;
#
# Check that it's possible to read-lock
# tables locked with FLUSH TABLE <list> WITH READ LOCK.
#
flush tables t1, t2 with read lock;
-# connection con1
+connection con1;
lock table t1 read, t2 read;
unlock tables;
-# connection default
+connection default;
unlock tables;
-# --> connection con1
+connection con1;
+disconnect con1;
+connection default;
drop table t1, t2, t3;
#
# Bug#51710 FLUSH TABLES <view> WITH READ LOCK kills the server
@@ -309,33 +342,35 @@ drop table t1;
# transactions unnecessarily.
#
drop table if exists t1;
-# --> conection default
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection default;
create table t1 (a int);
begin;
select * from t1;
a
-# --> connection con1
+connection con1;
#
# Issue a LOCK TABLE t1 READ. We could use HANDLER t1 OPEN
# or a long-running select -- anything that
# prevents FLUSH TABLE t1 from immediate completion would do.
#
lock table t1 read;
-# --> connection con2
+connection con2;
#
# FLUSH TABLE expels the table definition from the cache.
# Sending 'flush table t1'...
flush table t1;
-# --> connection default
+connection default;
# Let flush table sync in.
select * from t1;
-# --> connection con1
+connection con1;
select * from t1;
a
unlock tables;
-# --> connection con2
+connection con2;
# Reaping 'flush table t1'...
-# --> connection default
+connection default;
# Reaping 'select * from t1'...
a
commit;
@@ -345,33 +380,35 @@ commit;
begin;
select * from t1;
a
-# --> connection con1
+connection con1;
#
# Issue a LOCK TABLE t1 READ.
#
lock table t1 read;
-# --> connection con2
+connection con2;
#
# FLUSH TABLES expels the table definition from the cache.
# Sending 'flush tables'...
flush tables;
-# --> connection default
+connection default;
# Let flush table sync in.
select * from t1;
-# --> connection con1
+connection con1;
select * from t1;
a
unlock tables;
-# --> connection con2
+connection con2;
# Reaping 'flush tables'...
-# --> connection default
+connection default;
# Reaping 'select * from t1'...
a
commit;
# Cleanup
-# --> connection con1
-# --> connection con2
-# --> connection default
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
drop table t1;
#
# Test for bug #55273 "FLUSH TABLE tm WITH READ LOCK for Merge table
@@ -428,28 +465,36 @@ drop tables tm, t1, t2;
# FLUSH TABLES WITH READ LOCK".
#
drop table if exists t1, t2;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection default;
create table t1 (i int);
create table t2 (i int);
handler t1 open;
-# Switching to connection 'con1'.
+connection con1;
# Sending:
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL starts waiting for 't1' to be closed.
-# Switching to connection 'default'.
+connection default;
# The below statement should not cause deadlock.
# Sending:
insert into t2 values (1);
-# Switching to connection 'con2'.
+connection con2;
# Wait until INSERT starts to wait for FTWRL to go away.
-# Switching to connection 'con1'.
+connection con1;
# FTWRL should be able to continue now.
# Reap FTWRL.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap INSERT.
handler t1 close;
# Cleanup.
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
drop tables t1, t2;
#
# Bug#57649 FLUSH TABLES under FLUSH TABLES <list> WITH READ LOCK leads
@@ -481,12 +526,13 @@ INSERT INTO t1 VALUES (1, 1);
CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW SET @var = "a";
BEGIN;
UPDATE t1 SET value= value + 1 WHERE id = 1;
-# Switching to connection 'con1'.
+connect con1, localhost, root;
# The below FLUSH TABLES WITH READ LOCK should succeed and
# should not be blocked by the transaction in default connection.
FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
-# Switching to connection 'default'.
+disconnect con1;
+connection default;
COMMIT;
DROP TABLE t1;
#
diff --git a/mysql-test/r/flush_block_commit.result b/mysql-test/r/flush_block_commit.result
index 7062d05c2d7..e9684e5aa46 100644
--- a/mysql-test/r/flush_block_commit.result
+++ b/mysql-test/r/flush_block_commit.result
@@ -1,50 +1,50 @@
# Save the initial number of concurrent sessions
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
-# Establish connection con3 (user=root)
-# Switch to connection con1
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connection con1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES(1);
-# Switch to connection con2
+connection con2;
FLUSH TABLES WITH READ LOCK;
-# Switch to connection con1
+connection con1;
# Sending:
COMMIT;
-# Switch to connection con2
+connection con2;
# Wait until COMMIT gets blocked.
# Verify that 'con1' was blocked and data did not move.
SELECT * FROM t1;
a
UNLOCK TABLES;
-# Switch to connection con1
+connection con1;
# Reaping COMMIT
-# Switch to connection con1
+connection con1;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
-# Switch to connection con2
+connection con2;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
-# Switch to connection con3
+connection con3;
FLUSH TABLES WITH READ LOCK;
-# Switch to connection con1
+connection con1;
COMMIT;
-# Switch to connection con2
+connection con2;
a
1
COMMIT;
-# Switch to connection con3
+connection con3;
UNLOCK TABLES;
-# Switch to connection con2
+connection con2;
COMMIT;
-# Switch to connection con1
+connection con1;
BEGIN;
INSERT INTO t1 VALUES(10);
FLUSH TABLES WITH READ LOCK;
-# Switch to connection con2
+connection con2;
FLUSH TABLES WITH READ LOCK;
UNLOCK TABLES;
BEGIN;
@@ -57,7 +57,10 @@ Database Create Database
test CREATE DATABASE `test` /*!40100 DEFAULT CHARACTER SET latin1 */
COMMIT;
# Cleanup
-# Switch to connection default and close connections con1, con2, con3
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
# We commit open transactions when we disconnect: only then we can
# drop the table.
DROP TABLE t1;
diff --git a/mysql-test/r/flush_block_commit_notembedded.result b/mysql-test/r/flush_block_commit_notembedded.result
index 130146bf252..7dd6410ac70 100644
--- a/mysql-test/r/flush_block_commit_notembedded.result
+++ b/mysql-test/r/flush_block_commit_notembedded.result
@@ -1,30 +1,36 @@
# Save the initial number of concurrent sessions
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
-# Switch to connection con1
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
CREATE TABLE t1 (a INT) ENGINE=innodb;
RESET MASTER;
SET AUTOCOMMIT=0;
SELECT 1;
1
1
-# Switch to connection con2
+connection con2;
FLUSH TABLES WITH READ LOCK;
include/show_binlog_events.inc
-# Switch to connection con1
+connection con1;
INSERT INTO t1 VALUES (1);
-# Switch to connection con2
+connection con2;
include/show_binlog_events.inc
UNLOCK TABLES;
-# Switch to connection con1
+connection con1;
DROP TABLE t1;
SET AUTOCOMMIT=1;
create table t1 (a int) engine=innodb;
+connection con1;
flush tables with read lock;
+connection con2;
begin;
insert into t1 values (1);;
+connection con1;
unlock tables;
+connection con2;
commit;
drop table t1;
-# Switch to connection default and close connections con1 and con2
+connection default;
+disconnect con1;
+disconnect con2;
# Wait till all disconnects are completed
diff --git a/mysql-test/r/flush_read_lock.result b/mysql-test/r/flush_read_lock.result
index 260edf8e51d..55c31ae8d12 100644
--- a/mysql-test/r/flush_read_lock.result
+++ b/mysql-test/r/flush_read_lock.result
@@ -85,6 +85,10 @@ insert into t1_temp values (1);
return 0;
end|
create event e1 on schedule every 1 minute do begin end;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connection default;
#
# Test compatibility of FLUSH TABLES WITH READ LOCK
# with various statements.
@@ -186,34 +190,34 @@ unlock tables;
# COMMIT is blocked by active FTWRL in another
# connection.
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
begin;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Do some work so ROLLBACK is not a no-op.
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
rollback;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
begin;
# Do some work so COMMIT is not a no-op.
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
# Send:
commit;
-# Switching to connection 'con1'.
+connection con1;
# Wait until COMMIT is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap COMMIT.
delete from t3_trans;
#
@@ -223,18 +227,18 @@ insert into t3_trans values (1);
set debug_sync='RESET';
set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
commit;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL is blocked.
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap COMMIT.
-# Switching to connection 'con1'.
+connection con1;
# Reap FTWRL.
unlock tables;
-# Switching to connection 'default'.
+connection default;
delete from t3_trans;
set debug_sync= "RESET";
# We don't run similar test for BEGIN and ROLLBACK as
@@ -447,30 +451,30 @@ unlock tables;
# Check that active FTWRL in another connection
# blocks EXECUTE which changes data.
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
execute stmt1 ;
-# Switching to connection 'con1'.
+connection con1;
# Check that EXECUTE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap EXECUTE.
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
execute stmt1; ;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL is blocked.
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap EXECUTE.
-# Switching to connection 'con1'.
+connection con1;
# Reap FTWRL.
unlock tables;
-# Switching to connection 'default'.
+connection default;
set debug_sync= "RESET";
delete from t1_base;
deallocate prepare stmt1;
@@ -631,20 +635,19 @@ drop trigger t1_bi;
# Check that FTWRL statements can be run while FTWRL
# is active in another connection.
#
-# Switching to connection 'con1'.
flush tables with read lock;
# The second FTWRL in a row is allowed at the moment.
# It does not make much sense as it does only flush.
flush tables with read lock;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
flush tables with read lock;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
#
# 14.2) FLUSH TABLES <list> WITH READ LOCK is not blocked by
# active FTWRL. But since the latter keeps tables open
@@ -654,25 +657,25 @@ flush tables with read lock;
# It does not make much sense though.
flush tables t1_base, t2_base with read lock;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
flush tables t1_base, t2_base with read lock;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
flush tables t1_base, t2_base with read lock;
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL is blocked.
-# Switching to connection 'default'.
+connection default;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
# Reap FTWRL.
unlock tables;
-# Switching to connection 'default'.
+connection default;
#
# 14.3) FLUSH TABLES is compatible with FTWRL.
Success: Was able to run 'flush tables' under FTWRL.
@@ -711,16 +714,16 @@ unlock tables;
# Check that HANDLER statements can be run while FTWRL
# is active in another connection.
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
handler t1_base open;
handler t1_base read first;
i
handler t1_base close;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
#
# 17) HELP statement is compatible with FTWRL.
#
@@ -767,24 +770,24 @@ unlock tables;
# Check that KILL statements can be run while FTWRL
# is active in another connection.
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
kill query @id;
ERROR 70100: Query execution was interrupted
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Finally check that KILL doesn't block FTWRL
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
kill query @id;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap KILL.
ERROR 70100: Query execution was interrupted
set debug_sync='RESET';
@@ -814,14 +817,14 @@ flush tables with read lock;
lock tables t1_base read;
unlock tables;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
lock tables t1_base read;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
#
# 21.b) LOCK TABLES WRITE on a base table is disallowed
# under FTWRL and should be blocked by active FTWRL.
@@ -830,14 +833,14 @@ lock tables t1_base write;
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
lock tables t1_base write ;
-# Switching to connection 'con1'.
+connection con1;
# Check that LOCK TABLES WRITE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap LOCK TABLES WRITE
unlock tables;
#
@@ -848,14 +851,14 @@ flush tables with read lock;
lock tables t1_temp write;
unlock tables;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
lock tables t1_temp write;
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
#
# 22) OPTIMIZE TABLE statement.
#
@@ -868,14 +871,14 @@ test.t1_base optimize Error Can't execute the query because you have a conflicti
test.t1_base optimize error Corrupt
unlock tables;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
optimize table t1_base;
-# Switching to connection 'con1'.
+connection con1;
# Check that OPTIMIZE TABLE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap OPTIMIZE TABLE
Table Op Msg_type Msg_text
test.t1_base optimize status OK
@@ -919,32 +922,32 @@ commit;
# Check that these statements are not blocked by
# active FTWRL in another connection.
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
begin;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Do some changes to avoid SAVEPOINT and friends
# being almost no-ops.
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
savepoint sv1;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
insert into t3_trans values (2);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
rollback to savepoint sv1;
release savepoint sv1;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
rollback;
# Check that these statements don't block FTWRL in
# another connection.
@@ -955,31 +958,31 @@ insert into t3_trans values (1);
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
savepoint sv1;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap SAVEPOINT
insert into t3_trans values (2);
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
rollback to savepoint sv1;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap ROLLBACK TO SAVEPOINT
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
release savepoint sv1;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap RELEASE SAVEPOINT
rollback;
set debug_sync= "RESET";
@@ -1009,14 +1012,14 @@ test.t1_base repair Error Can't execute the query because you have a conflicting
test.t1_base repair error Corrupt
unlock tables;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
repair table t1_base;
-# Switching to connection 'con1'.
+connection con1;
# Check that REPAIR TABLE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap REPAIR TABLE
Table Op Msg_type Msg_text
test.t1_base repair status OK
@@ -1155,25 +1158,25 @@ delete from t3_temp_trans;
# SET AUTOCOMMIT=1 is blocked by active FTWRL in
# another connection.
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
set autocommit= 0;
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Do some work so implicit commit in SET AUTOCOMMIT=1
# is not a no-op.
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
# Send:
set autocommit= 1;
-# Switching to connection 'con1'.
+connection con1;
# Wait until SET AUTOCOMMIT=1 is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap SET AUTOCOMMIT=1.
delete from t3_trans;
#
@@ -1183,18 +1186,18 @@ insert into t3_trans values (1);
set debug_sync='RESET';
set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
set autocommit= 1;
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL is blocked.
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap SET AUTOCOMMIT=1.
-# Switching to connection 'con1'.
+connection con1;
# Reap FTWRL.
unlock tables;
-# Switching to connection 'default'.
+connection default;
delete from t3_trans;
set debug_sync= "RESET";
#
@@ -1308,36 +1311,37 @@ unlock tables;
# Check that XA non-COMMIT statements are not and COMMIT is
# blocked by active FTWRL in another connection
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
xa start 'test1';
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
xa end 'test1';
xa prepare 'test1';
xa rollback 'test1';
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
xa start 'test1';
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
+connection default;
xa end 'test1';
xa prepare 'test1';
# Send:
xa commit 'test1';;
-# Switching to connection 'con1'.
+connection con1;
# Wait until XA COMMIT is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap XA COMMIT.
delete from t3_trans;
#
@@ -1349,18 +1353,18 @@ xa prepare 'test1';
set debug_sync='RESET';
set debug_sync='trans_xa_commit_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
xa commit 'test1';
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL is blocked.
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap XA COMMIT.
-# Switching to connection 'con1'.
+connection con1;
# Reap FTWRL.
unlock tables;
-# Switching to connection 'default'.
+connection default;
delete from t3_trans;
set debug_sync= "RESET";
#
@@ -1413,14 +1417,14 @@ Table Op Msg_type Msg_text
test.t3_trans analyze status OK
unlock tables;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
analyze table t3_trans;
-# Switching to connection 'con1'.
+connection con1;
# Check that ANALYZE TABLE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap ANALYZE TABLE
Table Op Msg_type Msg_text
test.t3_trans analyze status OK
@@ -1478,28 +1482,28 @@ Success: Was able to run FTWRL while 'alter table t3_temp_trans add column c1 in
begin;
insert into t3_trans values (1);
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
check table t1_base;
-# Switching to connection 'con1'.
+connection con1;
# Check that CHECK TABLE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap CHECK TABLE
Table Op Msg_type Msg_text
test.t1_base check status OK
begin;
delete from t3_trans;
#
-# Switching to connection 'con1'.
+connection con1;
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
alter table t1_temp add column c1 int;
-# Switching to connection 'con1'.
+connection con1;
# Check that ALTER TABLE is blocked.
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Reap ALTER TABLE
alter table t1_temp drop column c1;
#
@@ -1512,10 +1516,10 @@ alter table t1_temp drop column c1;
begin;
insert into t1_base values (1);
insert into t3_trans values (1);
-# Switching to connection 'con1'.
+connection con1;
# The below FTWRL should not be blocked by transaction in 'default'.
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
# Transaction still is able to read even with FTWRL active in another
# connection.
select * from t1_base;
@@ -1526,9 +1530,9 @@ j
select * from t3_trans;
i
1
-# Switching to connection 'con1'.
+connection con1;
unlock tables;
-# Switching to connection 'default'.
+connection default;
commit;
delete from t1_base;
delete from t3_trans;
@@ -1541,25 +1545,25 @@ delete from t3_trans;
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
insert into t1_base values (1);
-# Switching to connection 'con1'.
+connection con1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
-# Switching to connection 'con2'.
+connection con2;
# Wait until FTWRL is blocked.
# Try to run another INSERT and see that it is blocked.
insert into t2_base values (1);;
-# Switching to connection 'con3'.
+connection con3;
# Wait until new INSERT is blocked.
# Unblock INSERT in the first connection.
set debug_sync='now SIGNAL go';
-# Switching to connection 'default'.
+connection default;
# Reap first INSERT.
-# Switching to connection 'con1'.
+connection con1;
# Reap FTWRL.
unlock tables;
-# Switching to connection 'con2'.
+connection con2;
# Reap second INSERT.
-# Switching to connection 'default'.
+connection default;
set debug_sync= "RESET";
delete from t1_base;
delete from t2_base;
@@ -1573,23 +1577,23 @@ delete from t2_base;
# only taken when there were such modifications.
flush tables with read lock;
-# Switching to connection 'con1'.
+connection con1;
# The below FTWRL should not be blocked by transaction in 'default'.
flush tables with read lock;
-# Switching to connection 'default'.
+connection default;
select * from t1_base;
i
select * from t3_trans;
i
commit;
-# Switching to connection 'con1'.
+connection con1;
select * from t1_base;
i
select * from t3_trans;
i
commit;
unlock tables;
-# Switching to connection 'default'.
+connection default;
unlock tables;
#
# Check how FLUSH TABLE WITH READ LOCK is handled for MERGE tables.
@@ -1669,4 +1673,7 @@ drop database `#mysql50#mysqltest-2`;
drop database mysqltest1;
drop temporary tables t1_temp, t2_temp;
drop tables t1_base, t2_base, t3_trans;
+disconnect con1;
+disconnect con2;
+disconnect con3;
set global sql_mode=default;
diff --git a/mysql-test/r/flush_read_lock_kill.result b/mysql-test/r/flush_read_lock_kill.result
index 8453d26cbea..05836b04524 100644
--- a/mysql-test/r/flush_read_lock_kill.result
+++ b/mysql-test/r/flush_read_lock_kill.result
@@ -1,8 +1,11 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
DROP TABLE IF EXISTS t1;
SET DEBUG_SYNC= 'RESET';
CREATE TABLE t1 (kill_id INT) engine = InnoDB;
INSERT INTO t1 VALUES(connection_id());
-# Switching to connection 'default'.
+connection default;
# Start transaction.
BEGIN;
INSERT INTO t1 VALUES(connection_id());
@@ -11,13 +14,13 @@ INSERT INTO t1 VALUES(connection_id());
SET DEBUG_SYNC='ha_commit_trans_after_acquire_commit_lock SIGNAL acquired WAIT_FOR go';
# Sending:
COMMIT;
-# Switching to 'con1'.
+connection con1;
# Wait till COMMIT acquires protection against global read
# lock and pauses.
SET DEBUG_SYNC='now WAIT_FOR acquired';
# Sending:
FLUSH TABLES WITH READ LOCK;
-# Switching to 'con2'.
+connection con2;
SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1;
((@id := kill_id) - kill_id)
0
@@ -25,14 +28,15 @@ SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1;
# to active COMMIT
# Kill connection 'con1'.
KILL CONNECTION @id;
-# Switching to 'con1'.
+connection con1;
# Try to reap FLUSH TABLES WITH READ LOCK,
# it fail due to killed statement and connection.
Got one of the listed errors
-# Switching to 'con2'.
+connection con2;
# Resume COMMIT.
SET DEBUG_SYNC='now SIGNAL go';
-# Switching to 'default'.
+connection default;
# Reaping COMMIT.
+disconnect con2;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/flush_table.result b/mysql-test/r/flush_table.result
index 2b0ee1cb205..c56d63bd849 100644
--- a/mysql-test/r/flush_table.result
+++ b/mysql-test/r/flush_table.result
@@ -12,25 +12,35 @@ Table Op Msg_type Msg_text
test.t1 check status OK
unlock tables;
lock table t1 write;
+connect locker,localhost,root,,test;
+connection locker;
lock table t1 read;
+connection default;
flush table t1;
select * from t1;
a
1
unlock tables;
+connection locker;
unlock tables;
+connection default;
lock table t1 write;
+connection locker;
lock table t1 write;
+connection default;
flush table t1;
select * from t1;
a
1
unlock tables;
+connection locker;
unlock tables;
select * from t1;
a
1
+connection default;
drop table t1;
+disconnect locker;
create table t1(table_id char(20) primary key);
create table t2(table_id char(20) primary key);
insert into t1 values ('test.t1');
diff --git a/mysql-test/r/func_compress.result b/mysql-test/r/func_compress.result
index e9c8193685b..9bedddd7740 100644
--- a/mysql-test/r/func_compress.result
+++ b/mysql-test/r/func_compress.result
@@ -1,4 +1,6 @@
set global max_allowed_packet=1048576;
+connect conn1,localhost,root,,;
+connection conn1;
select @test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ';
@test_compress_string:='string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa '
string for test compress function aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -70,12 +72,15 @@ Warning 1259 ZLIB: Input data corrupted
Warning 1256 Uncompressed data size too large; the maximum size is 1048576 (probably, length of uncompressed data was corrupted)
drop table t1;
set @@global.max_allowed_packet=1048576*100;
+connect newconn, localhost, root,,;
select compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null;
compress(repeat('aaaaaaaaaa', IF(XXX, 10, 10000000))) is null
0
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: XXX
Warning 1292 Truncated incorrect DOUBLE value: XXX
+disconnect newconn;
+connection default;
set @@global.max_allowed_packet=default;
create table t1(a blob);
insert into t1 values(NULL), (compress('a'));
@@ -156,6 +161,8 @@ UNCOMPRESS(CAST(0 AS BINARY(5)))
NULL
Warnings:
Warning 1259 ZLIB: Input data corrupted
+disconnect conn1;
+connection default;
set global max_allowed_packet=default;
#
# End of 5.5 tests
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 0d9d4ffff9f..422e7bd25c8 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -2220,11 +2220,15 @@ INSERT INTO `t1` (b) VALUES ('2013-07-06 23:59:59');
EXPLAIN SELECT MIN(b) FROM t1 WHERE b <= '2013-11-06 23:59:59';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+connect con1,localhost,root,,;
+connection con1;
set names utf8;
# Should be the same as above:
EXPLAIN SELECT MIN(b) FROM t1 WHERE b <= '2013-11-06 23:59:59';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away
+connection default;
+disconnect con1;
DROP TABLE t1;
CREATE TABLE `t1` (
`a` int(11) NOT NULL AUTO_INCREMENT,
diff --git a/mysql-test/r/func_misc.result b/mysql-test/r/func_misc.result
index 700fda2e182..6590e3ef982 100644
--- a/mysql-test/r/func_misc.result
+++ b/mysql-test/r/func_misc.result
@@ -62,6 +62,7 @@ INSERT INTO t1 VALUES ('default', CONNECTION_ID());
SELECT GET_LOCK('bug16501',600);
GET_LOCK('bug16501',600)
1
+connect con1,localhost,root,,;
INSERT INTO t1 VALUES ('con1', CONNECTION_ID());
SELECT IS_USED_LOCK('bug16501') = connection_id
FROM t1
@@ -69,19 +70,23 @@ WHERE conn = 'default';
IS_USED_LOCK('bug16501') = connection_id
1
SELECT GET_LOCK('bug16501',600);
+connection default;
SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
IS_USED_LOCK('bug16501') = CONNECTION_ID()
1
SELECT RELEASE_LOCK('bug16501');
RELEASE_LOCK('bug16501')
1
+connection con1;
GET_LOCK('bug16501',600)
1
+connection default;
SELECT IS_USED_LOCK('bug16501') = connection_id
FROM t1
WHERE conn = 'con1';
IS_USED_LOCK('bug16501') = connection_id
1
+connection con1;
SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
IS_USED_LOCK('bug16501') = CONNECTION_ID()
1
@@ -91,6 +96,8 @@ RELEASE_LOCK('bug16501')
SELECT IS_USED_LOCK('bug16501');
IS_USED_LOCK('bug16501')
NULL
+disconnect con1;
+connection default;
DROP TABLE t1;
select export_set(3, _latin1'foo', _utf8'bar', ',', 4);
export_set(3, _latin1'foo', _utf8'bar', ',', 4)
@@ -595,7 +602,8 @@ is_free_lock('test')
select is_used_lock('test') = connection_id();
is_used_lock('test') = connection_id()
1
-# -> Switching to connection 'con1'
+connect con1,localhost,root,,;
+connection con1;
# IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired in another
# connection
select is_used_lock('test') = connection_id();
@@ -612,7 +620,7 @@ get_lock('test', 0)
select release_lock('test');
release_lock('test')
0
-# -> Switching to connection 'default'
+connection default;
# RELEASE_LOCK returns 1 if it successfully releases a lock
select release_lock('test');
release_lock('test')
@@ -625,18 +633,18 @@ NULL
select get_lock('test', 0);
get_lock('test', 0)
1
-# -> Switching to connection 'con1'
+connection con1;
create table t1 select connection_id() as id;
select get_lock('test', 7200);
-# -> Switching to connection 'default'
+connection default;
select (@id := id) - id from t1;
(@id := id) - id
0
kill query @id;
-# -> Switching to connection 'con1'
+connection con1;
get_lock('test', 7200)
NULL
-# -> Switching to connection 'default'
+connection default;
# GET_LOCK() works recursively
select get_lock('test', 0);
get_lock('test', 0)
@@ -685,18 +693,18 @@ release_lock('test3')
select get_lock('test1', 0);
get_lock('test1', 0)
1
-# -> Switching to connection 'con1'
+connection con1;
select get_lock('test2', 0);
get_lock('test2', 0)
1
select get_lock('test1', 7200);
-# -> Switching to connection 'default'
+connection default;
select get_lock('test2', 7200);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select release_lock('test1');
release_lock('test1')
1
-# -> Switching to connection 'con1'
+connection con1;
get_lock('test1', 7200)
1
select release_lock('test2');
@@ -705,7 +713,7 @@ release_lock('test2')
select release_lock('test1');
release_lock('test1')
1
-# -> Switching to connection 'default'
+connection default;
# LOCK/UNLOCK TABLES works fine with a user lock.
lock table t1 write;
select get_lock('test', 0);
@@ -755,16 +763,16 @@ release_lock('test2')
select get_lock('test', 0);
get_lock('test', 0)
1
-# -> Switching to connection 'con1'
+connection con1;
lock table t1 write;
select get_lock('test', 7200);
-# -> Switching to connection 'default'
+connection default;
lock table t1 read;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select release_lock('test');
release_lock('test')
1
-# -> Switching to connection 'con1'
+connection con1;
get_lock('test', 7200)
1
select release_lock('test');
@@ -772,6 +780,8 @@ release_lock('test')
1
unlock tables;
# cleanup
+disconnect con1;
+connection default;
drop table t1;
# check too long identifier names
select get_lock(repeat('a', 192), 0);
@@ -1382,7 +1392,7 @@ DROP TABLE t2;
#
# MDEV-4018 : Microseconds in GET_LOCK()
#
-# -> Switching to connection 'default'
+connection default;
select is_used_lock('test') = connection_id();
is_used_lock('test') = connection_id()
NULL
@@ -1390,7 +1400,8 @@ NULL
select get_lock('test', 0);
get_lock('test', 0)
1
-# -> Switching to connection 'con1'
+connect con1,localhost,root,,;
+connection con1;
select is_used_lock('test') = connection_id();
is_used_lock('test') = connection_id()
0
@@ -1412,7 +1423,7 @@ get_lock('test', 0.000001)
select get_lock('test', 0.0000000000000001);
get_lock('test', 0.0000000000000001)
0
-# -> Switching to connection 'default'
+connection default;
select is_used_lock('test') = connection_id();
is_used_lock('test') = connection_id()
1
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index f196571218f..d8ad6d7edb6 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -1,5 +1,7 @@
drop table if exists t1,t2;
set global max_allowed_packet=1048576;
+connect conn1,localhost,root,,;
+connection conn1;
set names latin1;
select 'hello',"'hello'",'""hello""','''h''e''l''l''o''',"hel""lo",'hel\'lo';
hello 'hello' ""hello"" 'h'e'l'l'o' hel"lo hel'lo
@@ -2911,6 +2913,7 @@ SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
1048576
SET @@global.max_allowed_packet=1024*1024*1024;
+connect newconn, localhost, root,,;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
1073741824
@@ -2942,7 +2945,9 @@ Warning 1292 Truncated incorrect INTEGER value: '511993d3c99719e38a6779073019dac
Warning 1292 Truncated incorrect DECIMAL value: '[.DC2.]'
Warning 1292 Truncated incorrect INTEGER value: '511993d3c99719e38a6779073019dacd7178ddb9'
Warning 1292 Truncated incorrect DOUBLE value: '0.000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111'
+connection conn1;
SET @@global.max_allowed_packet:= @tmp_max;
+disconnect newconn;
SELECT @tmp_max:= @@global.max_allowed_packet;
@tmp_max:= @@global.max_allowed_packet
1048576
@@ -4542,6 +4547,8 @@ SET NAMES latin2;
EXECUTE stmt;
COLLATION(space(2))
latin2_general_ci
+disconnect conn1;
+connection default;
set global max_allowed_packet=default;
#
# End of 5.6 tests
diff --git a/mysql-test/r/func_weight_string.result b/mysql-test/r/func_weight_string.result
index e63ee4267ea..df5b552d9ab 100644
--- a/mysql-test/r/func_weight_string.result
+++ b/mysql-test/r/func_weight_string.result
@@ -1,5 +1,7 @@
drop table if exists t1;
set global max_allowed_packet=1048576;
+connect conn1,localhost,root,,;
+connection conn1;
set names latin1;
select hex(weight_string(0x010203));
hex(weight_string(0x010203))
@@ -91,6 +93,8 @@ NULL
Warnings:
Warning 1301 Result of cast_as_binary() was larger than max_allowed_packet (1048576) - truncated
Warning 1301 Result of weight_string() was larger than max_allowed_packet (1048576) - truncated
+disconnect conn1;
+connection default;
set global max_allowed_packet=default;
#
# Start of 10.1 tests
diff --git a/mysql-test/r/function_defaults_notembedded.result b/mysql-test/r/function_defaults_notembedded.result
index 9bd03ab9f05..645133bad1d 100644
--- a/mysql-test/r/function_defaults_notembedded.result
+++ b/mysql-test/r/function_defaults_notembedded.result
@@ -48,15 +48,19 @@ DROP TABLE t1;
# with different sets of active defaults.
#
CREATE TABLE t1 ( a INT, b TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP);
+connect con1, localhost, root,,;
# 2011-04-19 08:04:01 UTC
SET TIMESTAMP = 1303200241.345678;
SET debug_sync = 'before_write_delayed SIGNAL parked WAIT_FOR go';
INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3);
+connection default;
SET debug_sync = 'now WAIT_FOR parked';
+connect con2, localhost, root,,;
# 2011-04-19 08:04:01 UTC
SET TIME_ZONE="+03:00";
SET TIMESTAMP = 1303200241.456789;
INSERT DELAYED INTO t1 ( a, b ) VALUES (4, '1977-12-19 12:34:56.789123'), (5, '1977-12-19 12:34:57.891234'), (6, '1977-12-19 12:34:58.912345');
+connection default;
SET debug_sync = 'now SIGNAL go';
SELECT * FROM t1;
a b
@@ -66,6 +70,8 @@ a b
4 1977-12-19 09:34:56
5 1977-12-19 09:34:57
6 1977-12-19 09:34:58
+disconnect con1;
+disconnect con2;
DROP TABLE t1;
#
# Test of early activation of function defaults.
@@ -133,15 +139,19 @@ DROP TABLE t1;
# with different sets of active defaults.
#
CREATE TABLE t1 ( a INT, b TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6));
+connect con1, localhost, root,,;
# 2011-04-19 08:04:01 UTC
SET TIMESTAMP = 1303200241.345678;
SET debug_sync = 'before_write_delayed SIGNAL parked WAIT_FOR go';
INSERT DELAYED INTO t1 ( a ) VALUES (1), (2), (3);
+connection default;
SET debug_sync = 'now WAIT_FOR parked';
+connect con2, localhost, root,,;
# 2011-04-19 08:04:01 UTC
SET TIME_ZONE="+03:00";
SET TIMESTAMP = 1303200241.456789;
INSERT DELAYED INTO t1 ( a, b ) VALUES (4, '1977-12-19 12:34:56.789123'), (5, '1977-12-19 12:34:57.891234'), (6, '1977-12-19 12:34:58.912345');
+connection default;
SET debug_sync = 'now SIGNAL go';
SELECT * FROM t1;
a b
@@ -151,6 +161,8 @@ a b
4 1977-12-19 09:34:56.789123
5 1977-12-19 09:34:57.891234
6 1977-12-19 09:34:58.912345
+disconnect con1;
+disconnect con2;
DROP TABLE t1;
#
# Test of early activation of function defaults.
diff --git a/mysql-test/r/grant.result b/mysql-test/r/grant.result
index 3020c7deba7..5d44f47dede 100644
--- a/mysql-test/r/grant.result
+++ b/mysql-test/r/grant.result
@@ -4,6 +4,8 @@ SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creato
SET GLOBAL log_bin_trust_function_creators = 1;
drop table if exists t1;
drop database if exists mysqltest;
+connect master,localhost,root,,;
+connection master;
SET NAMES binary;
delete from mysql.user where user='mysqltest_1';
delete from mysql.db where user='mysqltest_1';
@@ -518,6 +520,8 @@ grant update (a) on mysqltest_1.t1 to mysqltest_3@localhost;
grant select (b) on mysqltest_1.t2 to mysqltest_3@localhost;
grant select (c) on mysqltest_2.t1 to mysqltest_3@localhost;
grant update (d) on mysqltest_2.t2 to mysqltest_3@localhost;
+connect conn1,localhost,mysqltest_3,,;
+connection conn1;
SELECT * FROM INFORMATION_SCHEMA.COLUMN_PRIVILEGES
WHERE GRANTEE = '''mysqltest_3''@''localhost'''
ORDER BY TABLE_NAME,COLUMN_NAME,PRIVILEGE_TYPE;
@@ -551,6 +555,7 @@ update mysqltest_2.t1, mysqltest_2.t2 set d=10 where s=2;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 's' in table 't1'
update mysqltest_1.t1, mysqltest_2.t2 set a=10,d=10;
update mysqltest_1.t1, mysqltest_2.t1 set a=20 where c=20;
+connection master;
select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
a q b r
10 2 1 2
@@ -565,6 +570,9 @@ grant all on mysqltest_2.* to mysqltest_3@localhost;
grant select on *.* to mysqltest_3@localhost;
grant select on mysqltest_2.t1 to mysqltest_3@localhost;
flush privileges;
+disconnect conn1;
+connect conn2,localhost,mysqltest_3,,;
+connection conn2;
use mysqltest_1;
update mysqltest_2.t1, mysqltest_2.t2 set c=500,d=600;
update mysqltest_1.t1, mysqltest_1.t2 set a=100,b=200;
@@ -576,6 +584,7 @@ update mysqltest_2.t1, mysqltest_1.t2 set c=100,b=200;
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for table 't2'
update mysqltest_1.t1, mysqltest_2.t2 set a=100,d=200;
ERROR 42000: UPDATE command denied to user 'mysqltest_3'@'localhost' for table 't1'
+connection master;
select t1.*,t2.* from mysqltest_1.t1,mysqltest_1.t2;
a q b r
10 2 1 2
@@ -589,6 +598,7 @@ delete from mysql.columns_priv where user="mysqltest_3";
flush privileges;
drop database mysqltest_1;
drop database mysqltest_2;
+disconnect conn2;
SHOW PRIVILEGES;
Privilege Context Comment
Alter Tables To alter the table
@@ -622,14 +632,22 @@ Trigger Tables To use triggers
Create tablespace Server Admin To create/alter/drop tablespaces
Update Tables To update existing rows
Usage Server Admin No privileges - allow connect only
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int,b int,c int);
grant all on mysqltest.t1 to mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user1;
alter table t1 rename t2;
ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
+disconnect user1;
+connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
+connection default;
+disconnect root;
CREATE USER dummy@localhost;
CREATE DATABASE mysqltest;
CREATE TABLE mysqltest.dummytable (dummyfield INT);
@@ -742,6 +760,7 @@ use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM dummy@localhost;
DROP USER dummy@localhost;
DROP DATABASE mysqltest;
+connection default;
use mysql;
insert into tables_priv values ('','test_db','mysqltest_1','test_table','test_grantor',CURRENT_TIMESTAMP,'Select','Select');
flush privileges;
@@ -801,13 +820,18 @@ delete from mysql.db where user='mysqltest1';
delete from mysql.tables_priv where user='mysqltest1';
flush privileges;
drop database mysqltest;
+connection master;
create database db27515;
use db27515;
create table t1 (a int);
grant alter on db27515.t1 to user27515@localhost;
grant insert, create on db27515.t2 to user27515@localhost;
+connect conn27515, localhost, user27515, , db27515;
+connection conn27515;
rename table t1 to t2;
ERROR 42000: DROP command denied to user 'user27515'@'localhost' for table 't1'
+disconnect conn27515;
+connection master;
revoke all privileges, grant option from user27515@localhost;
drop user user27515@localhost;
drop database db27515;
@@ -849,8 +873,11 @@ select * from information_schema.schema_privileges
where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def mysqltest SELECT NO
+connect conn3,localhost,mysqltest_8,,;
select * from t1;
a
+disconnect conn3;
+connection master;
revoke select on mysqltest.* from mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
@@ -899,8 +926,11 @@ GRANT UPDATE (a) ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.column_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 a UPDATE NO
+connect conn4,localhost,mysqltest_8,,;
select * from t1;
a
+disconnect conn4;
+connection master;
revoke update (a) on t1 from mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
@@ -940,8 +970,11 @@ GRANT UPDATE ON `test`.`t1` TO 'mysqltest_8'@'%'
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'%' def test t1 UPDATE NO
+connect conn5,localhost,mysqltest_8,,;
select * from t1;
a
+disconnect conn5;
+connection master;
revoke update on t1 from mysqltest_8@'';
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
@@ -979,8 +1012,11 @@ where grantee like "'mysqltest_8'%";
GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
'mysqltest_8'@'host8' def USAGE NO
'mysqltest_8'@'%' def USAGE NO
+connect conn5,localhost,mysqltest_8,,;
select * from t1;
a
+disconnect conn5;
+connection master;
flush privileges;
show grants for mysqltest_8@'';
Grants for mysqltest_8@%
@@ -996,7 +1032,9 @@ drop user mysqltest_8@'';
show grants for mysqltest_8@'';
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host '%'
connect(localhost,mysqltest_8,,test,MASTER_PORT,MASTER_SOCKET);
+connect conn6,localhost,mysqltest_8,,;
ERROR 28000: Access denied for user 'mysqltest_8'@'localhost' (using password: NO)
+connection master;
show grants for mysqltest_8;
ERROR 42000: There is no such grant defined for user 'mysqltest_8' on host '%'
drop user mysqltest_8@host8;
@@ -1006,6 +1044,7 @@ insert into mysql.user select * from t2;
flush privileges;
drop table t2;
drop table t1;
+connection master;
CREATE DATABASE mysqltest3;
USE mysqltest3;
CREATE TABLE t_nn (c1 INT);
@@ -1022,6 +1061,7 @@ GRANT SHOW VIEW ON mysqltest2.v_ny TO 'mysqltest_1'@'localhost' IDENTIFIE
GRANT SELECT ON mysqltest2.v_yn TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
GRANT SELECT ON mysqltest2.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
GRANT SHOW VIEW,SELECT ON mysqltest2.v_yy TO 'mysqltest_1'@'localhost' IDENTIFIED BY 'mysqltest_1';
+connect mysqltest_1, localhost, mysqltest_1, mysqltest_1,;
SHOW CREATE VIEW mysqltest2.v_nn;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v_nn'
SHOW CREATE TABLE mysqltest2.v_nn;
@@ -1057,6 +1097,7 @@ v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER
SHOW CREATE TABLE mysqltest2.v_yy;
View Create View character_set_client collation_connection
v_yy CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest2`.`v_yy` AS select `mysqltest2`.`t_nn`.`c1` AS `c1` from `mysqltest2`.`t_nn` where (`mysqltest2`.`t_nn`.`c1` = 55) latin1 latin1_swedish_ci
+connection master;
SHOW CREATE TABLE mysqltest2.v_nn;
View Create View character_set_client collation_connection
v_nn CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v_nn` AS select `t_nn`.`c1` AS `c1` from `t_nn` latin1 latin1_swedish_ci
@@ -1079,9 +1120,12 @@ DROP DATABASE mysqltest2;
DROP VIEW mysqltest3.v_nn;
DROP TABLE mysqltest3.t_nn;
DROP DATABASE mysqltest3;
+disconnect mysqltest_1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'mysqltest_1'@'localhost';
DROP USER 'mysqltest_1'@'localhost';
USE test;
+connection default;
+disconnect master;
create user longer_than_80_456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789;
ERROR HY000: String 'longer_than_80_4567890123456789012345678901234567890123456789012345678' is too long for user name (should be no longer than 80)
CREATE DATABASE mysqltest1;
@@ -1095,6 +1139,7 @@ CREATE TABLE mysqltest1.t2 (int_field INT);
"RENAME TABLE and ALTER TABLE"
CREATE USER mysqltest_1@localhost;
GRANT SELECT ON mysqltest1.t1 TO mysqltest_1@localhost;
+connect conn42,localhost,mysqltest_1,,mysqltest1;
SELECT USER();
USER()
mysqltest_1@localhost
@@ -1106,12 +1151,18 @@ RENAME TABLE t1 TO t2;
ERROR 42000: DROP, ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
ALTER TABLE t1 RENAME TO t2;
ERROR 42000: DROP, ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
+disconnect conn42;
+connection default;
GRANT DROP ON mysqltest1.t1 TO mysqltest_1@localhost;
+connect conn42,localhost,mysqltest_1,,mysqltest1;
RENAME TABLE t1 TO t2;
ERROR 42000: ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
ALTER TABLE t1 RENAME TO t2;
ERROR 42000: ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
+disconnect conn42;
+connection default;
GRANT ALTER ON mysqltest1.t1 TO mysqltest_1@localhost;
+connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -1120,13 +1171,19 @@ RENAME TABLE t1 TO t2;
ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
ALTER TABLE t1 RENAME TO t2;
ERROR 42000: INSERT, CREATE command denied to user 'mysqltest_1'@'localhost' for table 't2'
+disconnect conn42;
+connection default;
GRANT INSERT, CREATE ON mysqltest1.t1 TO mysqltest_1@localhost;
+connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT, INSERT, CREATE, DROP, ALTER ON `mysqltest1`.`t1` TO 'mysqltest_1'@'localhost'
+disconnect conn42;
+connection default;
GRANT INSERT, SELECT, CREATE, ALTER, DROP ON mysqltest1.t2 TO mysqltest_1@localhost;
DROP TABLE mysqltest1.t2;
+connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -1136,8 +1193,11 @@ RENAME TABLE t1 TO t2;
RENAME TABLE t2 TO t1;
ALTER TABLE t1 RENAME TO t2;
ALTER TABLE t2 RENAME TO t1;
+disconnect conn42;
+connection default;
REVOKE DROP, INSERT ON mysqltest1.t1 FROM mysqltest_1@localhost;
REVOKE DROP, INSERT ON mysqltest1.t2 FROM mysqltest_1@localhost;
+connect conn42,localhost,mysqltest_1,,mysqltest1;
SHOW GRANTS;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -1147,6 +1207,8 @@ RENAME TABLE t1 TO t2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
ALTER TABLE t1 RENAME TO t2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
+disconnect conn42;
+connection default;
DROP USER mysqltest_1@localhost;
DROP DATABASE mysqltest1;
USE test;
@@ -1177,25 +1239,37 @@ ERROR HY000: String '1234567890abcdefghij1234567890abcdefghij1234567890abcdefghi
CREATE USER bug23556@localhost;
CREATE DATABASE bug23556;
GRANT SELECT ON bug23556.* TO bug23556@localhost;
+connect bug23556,localhost,bug23556,,bug23556;
+connection default;
USE bug23556;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4),(5);
GRANT DELETE ON t1 TO bug23556@localhost;
+connection bug23556;
USE bug23556;
TRUNCATE t1;
ERROR 42000: DROP command denied to user 'bug23556'@'localhost' for table 't1'
+connection default;
USE bug23556;
REVOKE DELETE ON t1 FROM bug23556@localhost;
GRANT DROP ON t1 TO bug23556@localhost;
+connection bug23556;
USE bug23556;
TRUNCATE t1;
+connection default;
USE bug23556;
DROP TABLE t1;
USE test;
DROP DATABASE bug23556;
DROP USER bug23556@localhost;
+connection default;
+disconnect bug23556;
+connect con1, localhost, root,,*NO-ONE*;
+connection con1;
GRANT PROCESS ON * TO user@localhost;
ERROR 3D000: No database selected
+disconnect con1;
+connection default;
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
DROP DATABASE IF EXISTS mysqltest3;
@@ -1217,8 +1291,7 @@ GRANT EXECUTE ON PROCEDURE mysqltest2.p_inv TO mysqltest_1@localhost;
GRANT EXECUTE ON FUNCTION mysqltest3.f_def TO mysqltest_1@localhost;
GRANT EXECUTE ON FUNCTION mysqltest4.f_inv TO mysqltest_1@localhost;
GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost;
-
----> connection: bug9504_con1
+connect bug9504_con1,localhost,mysqltest_1,,;
use mysqltest1;
use mysqltest2;
use mysqltest3;
@@ -1236,8 +1309,8 @@ mysqltest3.f_def()
SELECT mysqltest4.f_inv();
mysqltest4.f_inv()
1
-
----> connection: default
+connection default;
+disconnect bug9504_con1;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP DATABASE mysqltest3;
@@ -1251,8 +1324,7 @@ GRANT ALL PRIVILEGES ON mysqltest1.* TO mysqltest_1@localhost;
GRANT SELECT ON mysqltest2.* TO mysqltest_1@localhost;
CREATE PROCEDURE mysqltest1.p1() SQL SECURITY INVOKER
SELECT 1;
-
----> connection: bug27337_con1
+connect bug27337_con1,localhost,mysqltest_1,,mysqltest2;
CREATE TABLE t1(c INT);
ERROR 42000: CREATE command denied to user 'mysqltest_1'@'localhost' for table 't1'
CALL mysqltest1.p1();
@@ -1260,14 +1332,14 @@ CALL mysqltest1.p1();
1
CREATE TABLE t1(c INT);
ERROR 42000: CREATE command denied to user 'mysqltest_1'@'localhost' for table 't1'
-
----> connection: bug27337_con2
+disconnect bug27337_con1;
+connect bug27337_con2,localhost,mysqltest_1,,mysqltest2;
CREATE TABLE t1(c INT);
ERROR 42000: CREATE command denied to user 'mysqltest_1'@'localhost' for table 't1'
SHOW TABLES;
Tables_in_mysqltest2
-
----> connection: default
+connection default;
+disconnect bug27337_con2;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
@@ -1279,8 +1351,7 @@ CREATE TABLE mysqltest1.t1(c INT);
CREATE TABLE mysqltest2.t2(c INT);
GRANT SELECT ON mysqltest1.t1 TO mysqltest_1@localhost;
GRANT SELECT ON mysqltest2.t2 TO mysqltest_2@localhost;
-
----> connection: bug27337_con1
+connect bug27337_con1,localhost,mysqltest_1,,mysqltest1;
SHOW TABLES FROM mysqltest1;
Tables_in_mysqltest1
t1
@@ -1288,8 +1359,7 @@ PREPARE stmt1 FROM 'SHOW TABLES FROM mysqltest1';
EXECUTE stmt1;
Tables_in_mysqltest1
t1
-
----> connection: bug27337_con2
+connect bug27337_con2,localhost,mysqltest_2,,mysqltest2;
SHOW COLUMNS FROM mysqltest2.t2;
Field Type Null Key Default Extra
c int(11) YES NULL
@@ -1297,24 +1367,22 @@ PREPARE stmt2 FROM 'SHOW COLUMNS FROM mysqltest2.t2';
EXECUTE stmt2;
Field Type Null Key Default Extra
c int(11) YES NULL
-
----> connection: default
+connection default;
REVOKE SELECT ON mysqltest1.t1 FROM mysqltest_1@localhost;
REVOKE SELECT ON mysqltest2.t2 FROM mysqltest_2@localhost;
-
----> connection: bug27337_con1
+connection bug27337_con1;
SHOW TABLES FROM mysqltest1;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest1'
EXECUTE stmt1;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest1'
-
----> connection: bug27337_con2
+connection bug27337_con2;
SHOW COLUMNS FROM mysqltest2.t2;
ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2'
EXECUTE stmt2;
ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't2'
-
----> connection: default
+connection default;
+disconnect bug27337_con1;
+disconnect bug27337_con2;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_1@localhost;
@@ -1328,6 +1396,8 @@ GRANT SELECT ON `test`.* TO 'mysqltest_1'@'localhost';
GRANT ALL ON db27878.* TO 'mysqltest_1'@'localhost';
USE db27878;
CREATE SQL SECURITY INVOKER VIEW db27878.v1 AS SELECT * FROM test.t1;
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
USE db27878;
UPDATE v1 SET f2 = 4;
ERROR HY000: View 'db27878.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
@@ -1335,6 +1405,8 @@ SELECT * FROM test.t1;
f1 f2
1 1
2 2
+disconnect user1;
+connection default;
REVOKE UPDATE (f1) ON `test`.`t1` FROM 'mysqltest_1'@'localhost';
REVOKE SELECT ON `test`.* FROM 'mysqltest_1'@'localhost';
REVOKE ALL ON db27878.* FROM 'mysqltest_1'@'localhost';
@@ -1394,8 +1466,7 @@ GRANT CREATE ROUTINE, EXECUTE ON mysqltest1.* TO testuser@localhost;
GRANT SELECT(b) ON t1 TO testuser@localhost;
GRANT SELECT ON t2 TO testuser@localhost;
GRANT SELECT ON mysqltest2.* TO testuser@localhost;
-
-# Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
+connect bug57952_con1,localhost,testuser,,mysqltest1;
PREPARE s1 FROM 'SELECT b FROM t1';
PREPARE s2 FROM 'SELECT a FROM t2';
PREPARE s3 FROM 'SHOW TABLES FROM mysqltest2';
@@ -1411,14 +1482,12 @@ a
CALL p3;
Tables_in_mysqltest2
t3
-
-# Connection: default
+connection default;
REVOKE SELECT ON t1 FROM testuser@localhost;
GRANT SELECT(a) ON t1 TO testuser@localhost;
REVOKE SELECT ON t2 FROM testuser@localhost;
REVOKE SELECT ON mysqltest2.* FROM testuser@localhost;
-
-# Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
+connection bug57952_con1;
# - Check column-level privileges...
EXECUTE s1;
ERROR 42000: SELECT command denied to user 'testuser'@'localhost' for column 'b' in table 't1'
@@ -1442,8 +1511,8 @@ EXECUTE s3;
ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
CALL p3;
ERROR 42000: Access denied for user 'testuser'@'localhost' to database 'mysqltest2'
-
-# Connection: default
+connection default;
+disconnect bug57952_con1;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER testuser@localhost;
@@ -1474,28 +1543,26 @@ select db, routine_name, routine_type, proc_priv from mysql.procs_priv where use
db routine_name routine_type proc_priv
mysqltest1 f1 FUNCTION Execute
mysqltest1 p1 PROCEDURE Execute
-#
-# Create connection 'bug_36544_con1' as 'mysqluser1@localhost'.
+connect bug36544_con1,localhost,mysqluser1,,;
call mysqltest1.p1();
select mysqltest1.f1();
mysqltest1.f1()
0
-#
-# Switch to connection 'default'.
+connection default;
drop user mysqluser1@localhost;
#
# Test that dropping of user is properly reflected in
# both privilege tables and in in-memory structures.
#
-# Switch to connection 'bug36544_con1'.
+connection bug36544_con1;
# The connection cold be alive but should not be able to
# access to any of the stored routines.
call mysqltest1.p1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
select mysqltest1.f1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
-#
-# Switch to connection 'default'.
+disconnect bug36544_con1;
+connection default;
#
# Now create user with the same name and check that he
# has not inherited privileges.
@@ -1505,15 +1572,13 @@ Grants for mysqluser1@localhost
GRANT USAGE ON *.* TO 'mysqluser1'@'localhost'
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
db routine_name routine_type proc_priv
-#
-# Create connection 'bug_36544_con2' as 'mysqluser1@localhost'.
+connect bug36544_con2,localhost,mysqluser1,,;
# Newly created user should not be able to access any of the routines.
call mysqltest1.p1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.p1'
select mysqltest1.f1();
ERROR 42000: execute command denied to user 'mysqluser1'@'localhost' for routine 'mysqltest1.f1'
-#
-# Switch to connection 'default'.
+connection default;
#
# 2) Check that RENAME USER properly updates privileges on both
# stored procedures and functions.
@@ -1551,8 +1616,7 @@ select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1'
db table_name table_priv
mysqltest1 t11 Select
mysqltest1 t22 Select
-#
-# Switch to connection 'bug36544_con2'.
+connection bug36544_con2;
call mysqltest1.p1();
select mysqltest1.f1();
mysqltest1.f1()
@@ -1561,13 +1625,12 @@ select * from mysqltest1.t11;
i
select * from mysqltest1.t22;
i
-#
-# Switch to connection 'default'.
+connection default;
rename user mysqluser1@localhost to mysqluser10@localhost;
#
# Test that there are no privileges left for mysqluser1.
#
-# Switch to connection 'bug36544_con2'.
+connection bug36544_con2;
# The connection cold be alive but should not be able to
# access to any of the stored routines or tables.
call mysqltest1.p1();
@@ -1578,8 +1641,8 @@ select * from mysqltest1.t11;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11'
select * from mysqltest1.t22;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22'
-#
-# Switch to connection 'default'.
+disconnect bug36544_con2;
+connection default;
#
# Now create user with the old name and check that he
# has not inherited privileges.
@@ -1591,8 +1654,7 @@ select db, routine_name, routine_type, proc_priv from mysql.procs_priv where use
db routine_name routine_type proc_priv
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
db table_name table_priv
-#
-# Create connection 'bug_36544_con3' as 'mysqluser1@localhost'.
+connect bug36544_con3,localhost,mysqluser1,,;
# Newly created user should not be able to access to any of the
# stored routines or tables.
call mysqltest1.p1();
@@ -1603,8 +1665,8 @@ select * from mysqltest1.t11;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't11'
select * from mysqltest1.t22;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 't22'
-#
-# Switch to connection 'default'.
+disconnect bug36544_con3;
+connection default;
#
# Now check that privileges became associated with a new user
# name - mysqluser10.
@@ -1624,8 +1686,7 @@ select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10
db table_name table_priv
mysqltest1 t11 Select
mysqltest1 t22 Select
-#
-# Create connection 'bug_36544_con4' as 'mysqluser10@localhost'.
+connect bug36544_con4,localhost,mysqluser10,,;
call mysqltest1.p1();
select mysqltest1.f1();
mysqltest1.f1()
@@ -1634,8 +1695,8 @@ select * from mysqltest1.t11;
i
select * from mysqltest1.t22;
i
-#
-# Switch to connection 'default'.
+disconnect bug36544_con4;
+connection default;
#
# Clean-up.
drop user mysqluser1@localhost;
@@ -1656,15 +1717,19 @@ create database mysqltest;
use mysqltest;
grant create on mysqltest.* to mysqltest@localhost;
create table t1 (i INT);
+connect user1,localhost,mysqltest,,mysqltest;
+connection user1;
insert into t1 values (1);
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1'
create table t2 (i INT);
create table t4 (i INT);
+connection default;
grant select, insert on mysqltest.t2 to mysqltest@localhost;
grant insert on mysqltest.t4 to mysqltest@localhost;
grant create, insert on mysqltest.t5 to mysqltest@localhost;
grant create, insert on mysqltest.t6 to mysqltest@localhost;
flush privileges;
+connection user1;
insert into t2 values (1);
create table if not exists t1 select * from t2;
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1'
@@ -1681,6 +1746,7 @@ create table t4 select * from t2;
ERROR 42S01: Table 't4' already exists
create table t1 select * from t2;
ERROR 42000: INSERT command denied to user 'mysqltest'@'localhost' for table 't1'
+connection default;
drop table t1,t2,t4,t5,t6;
revoke create on mysqltest.* from mysqltest@localhost;
revoke select, insert on mysqltest.t2 from mysqltest@localhost;
@@ -1688,6 +1754,7 @@ revoke insert on mysqltest.t4 from mysqltest@localhost;
revoke create, insert on mysqltest.t5 from mysqltest@localhost;
revoke create, insert on mysqltest.t6 from mysqltest@localhost;
drop user mysqltest@localhost;
+disconnect user1;
drop database mysqltest;
use test;
FLUSH PRIVILEGES without procs_priv table.
@@ -1711,6 +1778,7 @@ FLUSH PRIVILEGES;
CREATE DATABASE dbbug33464;
CREATE USER 'userbug33464'@'localhost';
GRANT CREATE ROUTINE ON dbbug33464.* TO 'userbug33464'@'localhost';
+connect connbug33464, localhost, userbug33464, , dbbug33464;
userbug33464@localhost dbbug33464
CREATE PROCEDURE sp3(v1 char(20))
@@ -1725,6 +1793,8 @@ CREATE FUNCTION fn2() returns char(50) SQL SECURITY DEFINER
BEGIN
return 2;
END//
+disconnect connbug33464;
+connection default;
USE dbbug33464;
root@localhost dbbug33464
@@ -1753,6 +1823,7 @@ SHOW GRANTS FOR 'user1'@'localhost';
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user1'@'localhost'
+connect con1,localhost,user1,,;
** Connect as user1 and create a procedure.
** The creation will imply implicitly assigned
** EXECUTE and ALTER ROUTINE privileges to
@@ -1769,6 +1840,7 @@ BEGIN
SET @x = 0;
REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;
END ;||
+connect con2,localhost,user2,,;
** Connect as user2 and create a procedure.
** Implicitly assignment of privileges will
** fail because the user2@localhost is an
@@ -1780,6 +1852,7 @@ REPEAT SET @x = @x + 1; UNTIL @x > p1 END REPEAT;
END ;||
Warnings:
Warning 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges
+connection default;
SHOW GRANTS FOR 'user1'@'localhost';
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
@@ -1789,6 +1862,8 @@ SHOW GRANTS FOR 'user2';
Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
GRANT CREATE, CREATE ROUTINE ON `db1`.* TO 'user2'@'%'
+disconnect con1;
+disconnect con2;
DROP PROCEDURE db1.proc1;
DROP PROCEDURE db1.proc2;
REVOKE ALL ON db1.* FROM 'user1'@'localhost';
@@ -1801,6 +1876,7 @@ DROP DATABASE db1;
# Bug #25863 No database selected error, but documentation
# says * for global allowed
#
+connect conn1,localhost,root,,*NO-ONE*;
GRANT ALL ON * TO mysqltest_1;
ERROR 3D000: No database selected
GRANT ALL ON *.* TO mysqltest_1;
@@ -1820,18 +1896,23 @@ SHOW GRANTS FOR mysqltest_1;
Grants for mysqltest_1@%
GRANT ALL PRIVILEGES ON *.* TO 'mysqltest_1'@'%'
DROP USER mysqltest_1;
+connection default;
+disconnect conn1;
CREATE DATABASE db1;
CREATE DATABASE db2;
GRANT SELECT ON db1.* to 'testbug'@localhost;
USE db2;
CREATE TABLE t1 (a INT);
USE test;
+connect con1,localhost,testbug,,db1;
SELECT * FROM `../db2/tb2`;
ERROR 42S02: Table 'db1.../db2/tb2' doesn't exist
SELECT * FROM `../db2`.tb2;
ERROR 42000: SELECT command denied to user 'testbug'@'localhost' for table 'tb2'
SELECT * FROM `#mysql50#/../db2/tb2`;
ERROR 42000: Incorrect table name '#mysql50#/../db2/tb2'
+connection default;
+disconnect con1;
DROP USER 'testbug'@localhost;
DROP TABLE db2.t1;
DROP DATABASE db1;
@@ -1888,13 +1969,13 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT RELOAD, SHUTDOWN, PROCESS, FILE, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT, CREATE USER ON *.* TO 'mysqltest_u1'@'localhost'
GRANT CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE ROUTINE, ALTER ROUTINE, EVENT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -1911,16 +1992,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT SELECT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -1937,16 +2018,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT INSERT ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -1963,16 +2044,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT UPDATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -1989,16 +2070,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT DELETE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2015,16 +2096,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT CREATE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2041,16 +2122,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT DROP ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2067,16 +2148,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT ALTER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2093,16 +2174,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT INDEX ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2119,16 +2200,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT REFERENCES ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2145,16 +2226,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT USAGE ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2171,16 +2252,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT CREATE VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2197,16 +2278,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT SHOW VIEW ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2223,16 +2304,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT SELECT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2249,16 +2330,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT INSERT ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2275,16 +2356,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT UPDATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2301,16 +2382,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT DELETE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2327,16 +2408,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT CREATE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2353,16 +2434,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT DROP ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2379,16 +2460,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT ALTER ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2405,16 +2486,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT INDEX ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2431,16 +2512,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT REFERENCES ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2457,16 +2538,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT USAGE ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost' WITH GRANT OPTION
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2483,16 +2564,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT CREATE VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2509,16 +2590,16 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT SHOW VIEW ON `mysqltest_db1`.`t1` TO 'mysqltest_u1'@'localhost'
-
-# connection: con1 (mysqltest_u1@mysqltest_db1)
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
+connection con1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-
-# connection: default
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
@@ -2542,7 +2623,7 @@ DROP DATABASE IF EXISTS secret;
DROP DATABASE IF EXISTS no_such_db;
CREATE DATABASE secret;
GRANT USAGE ON *.* TO untrusted@localhost;
-# Connection con1
+connect con1, localhost, untrusted;
SHOW GRANTS;
Grants for untrusted@localhost
GRANT USAGE ON *.* TO 'untrusted'@'localhost'
@@ -2557,7 +2638,8 @@ CREATE PROCEDURE no_such_db.foo() BEGIN END;
ERROR 42000: Access denied for user 'untrusted'@'localhost' to database 'no_such_db'
CREATE PROCEDURE secret.peek_at_secret() BEGIN END;
ERROR 42000: Access denied for user 'untrusted'@'localhost' to database 'secret'
-# Connection default
+connection default;
+disconnect con1;
DROP USER untrusted@localhost;
DROP DATABASE secret;
#
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index bd14f21010b..d447bc10dc7 100644
--- a/mysql-test/r/grant2.result
+++ b/mysql-test/r/grant2.result
@@ -11,15 +11,27 @@ flush privileges;
grant all privileges on `my\_1`.* to mysqltest_1@localhost with grant option;
grant create user on *.* to mysqltest_1@localhost;
create user mysqltest_2@localhost;
+connect user_a,localhost,mysqltest_1,,;
+connection user_a;
grant select on `my\_1`.* to mysqltest_2@localhost;
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysql'
+disconnect user_a;
+connection default;
grant update on mysql.* to mysqltest_1@localhost;
+connect user_b,localhost,mysqltest_1,,;
+connection user_b;
grant select on `my\_1`.* to mysqltest_2@localhost identified by 'pass';
grant select on `my\_1`.* to mysqltest_3@localhost;
+disconnect user_b;
+connection default;
grant insert on mysql.* to mysqltest_1@localhost;
+connect user_c,localhost,mysqltest_1,,;
+connection user_c;
grant select on `my\_1`.* to mysqltest_3@localhost;
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'pass';
+disconnect user_c;
+connection default;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
@@ -27,6 +39,8 @@ delete from mysql.columns_priv where user like 'mysqltest\_%';
flush privileges;
grant all privileges on `my\_%`.* to mysqltest_1@localhost with grant option;
grant create user on *.* to mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,;
+connection user1;
select current_user();
current_user()
mysqltest_1@localhost
@@ -41,6 +55,8 @@ grant select on `my\_1`.* to mysqltest_4@localhost with grant option;
ERROR 28000: Can't find any matching row in the user table
grant select on `my\_1`.* to mysqltest_4@localhost identified by 'mypass'
with grant option;
+disconnect user1;
+connection default;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT CREATE USER ON *.* TO 'mysqltest_1'@'localhost'
@@ -56,6 +72,8 @@ delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
create database mysqltest_1;
grant all privileges on `mysqltest\_1`.* to mysqltest_1@localhost with grant option;
+connect user2,localhost,mysqltest_1,,;
+connection user2;
select current_user();
current_user()
mysqltest_1@localhost
@@ -66,6 +84,8 @@ mysqltest_1
test
grant all privileges on `mysqltest_1`.* to mysqltest_1@localhost with grant option;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest_1'
+disconnect user2;
+connection default;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -79,6 +99,8 @@ grant INSERT, SELECT on mysqltest.* to mysqltest_1@localhost;
flush privileges;
use mysqltest;
create table t1 (id int primary key, data varchar(255));
+connect mrbad, localhost, mysqltest_1,,mysqltest;
+connection mrbad;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -91,16 +113,22 @@ ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table '
select * from t1;
id data
1 I can't change it!
+disconnect mrbad;
+connection default;
drop table t1;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
create table t1 (a int, b int);
grant select (a) on t1 to mysqltest_1@localhost with grant option;
+connect mrugly, localhost, mysqltest_1,,mysqltest;
+connection mrugly;
grant select (a,b) on t1 to mysqltest_2@localhost;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't1'
grant select on t1 to mysqltest_3@localhost;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
+disconnect mrugly;
+connection default;
drop table t1;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
@@ -118,14 +146,24 @@ create user mysqltest_6@host6;
create user mysqltest_7@host7;
flush privileges;
drop user mysqltest_3@host3;
+connect con8,127.0.0.1,root,,test,$MASTER_MYPORT,;
+disconnect con8;
+connection default;
drop user mysqltest_1@host1, mysqltest_2@host2, mysqltest_4@host4,
mysqltest_5@host5, mysqltest_6@host6, mysqltest_7@host7;
+connect con9,127.0.0.1,root,,test,$MASTER_MYPORT,;
+disconnect con9;
+connection default;
create database mysqltest_1;
grant select, insert, update on `mysqltest\_1`.* to mysqltest_1@localhost;
+connect con10,localhost,mysqltest_1,,;
+connection con10;
set sql_log_off = 1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
set sql_log_bin = 0;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+disconnect con10;
+connection default;
delete from mysql.user where user like 'mysqltest\_1';
delete from mysql.db where user like 'mysqltest\_1';
drop database mysqltest_1;
@@ -270,14 +308,20 @@ GRANT SELECT ON "mysql".* TO '%@a'@'a'
drop user '%@a'@'a';
create user mysqltest_2@localhost;
grant create user on *.* to mysqltest_2@localhost;
+connect user3,localhost,mysqltest_2,,;
+connection user3;
select host,user,password from mysql.user where user like 'mysqltest_%' order by host,user,password;
ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 'user'
create user mysqltest_A@'%';
rename user mysqltest_A@'%' to mysqltest_B@'%';
drop user mysqltest_B@'%';
+disconnect user3;
+connection default;
drop user mysqltest_2@localhost;
create user mysqltest_3@localhost;
grant INSERT,DELETE,UPDATE on mysql.* to mysqltest_3@localhost;
+connect user4,localhost,mysqltest_3,,;
+connection user4;
show grants;
Grants for mysqltest_3@localhost
GRANT USAGE ON *.* TO 'mysqltest_3'@'localhost'
@@ -294,12 +338,16 @@ create user mysqltest_A@'%';
rename user mysqltest_B@'%' to mysqltest_C@'%';
drop user mysqltest_C@'%';
drop user mysqltest_A@'%';
+disconnect user4;
+connection default;
drop user mysqltest_3@localhost;
set @@sql_mode='';
create database mysqltest_1;
create table mysqltest_1.t1 (i int);
insert into mysqltest_1.t1 values (1),(2),(3);
GRANT ALL ON mysqltest_1.t1 TO mysqltest_1@'127.0.0.0/255.0.0.0';
+connect n1,127.0.0.1,mysqltest_1,,mysqltest_1,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection n1;
show grants for current_user();
Grants for mysqltest_1@127.0.0.0/255.0.0.0
GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.0/255.0.0.0'
@@ -309,15 +357,21 @@ i
1
2
3
+disconnect n1;
+connection default;
REVOKE ALL ON mysqltest_1.t1 FROM mysqltest_1@'127.0.0.0/255.0.0.0';
delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
drop table mysqltest_1.t1;
grant all on mysqltest_1.* to mysqltest_1@'127.0.0.1';
+connect b12302,127.0.0.1,mysqltest_1,,mysqltest_1,$MASTER_MYPORT,;
+connection b12302;
select current_user();
current_user()
mysqltest_1@127.0.0.1
set password = password('changed');
+disconnect b12302;
+connection default;
select host, length(password) from mysql.user where user like 'mysqltest\_1';
host length(password)
127.0.0.1 41
@@ -325,10 +379,14 @@ revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.1';
delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
grant all on mysqltest_1.* to mysqltest_1@'127.0.0.0/255.0.0.0';
+connect b12302_2,127.0.0.1,mysqltest_1,,mysqltest_1,$MASTER_MYPORT,;
+connection b12302_2;
select current_user();
current_user()
mysqltest_1@127.0.0.0/255.0.0.0
set password = password('changed');
+disconnect b12302_2;
+connection default;
select host, length(password) from mysql.user where user like 'mysqltest\_1';
host length(password)
127.0.0.0/255.0.0.0 41
@@ -336,17 +394,38 @@ revoke all on mysqltest_1.* from mysqltest_1@'127.0.0.0/255.0.0.0';
delete from mysql.user where user like 'mysqltest\_1';
flush privileges;
drop database mysqltest_1;
+connect n5,localhost,test,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection n5;
set password = password("changed");
ERROR 42000: You are using MariaDB as an anonymous user and anonymous users are not allowed to modify user settings
+disconnect n5;
+connection default;
+connect con2root,localhost,root,,;
+connect con3root,localhost,root,,;
+connection default;
lock table mysql.user write;
+connection con2root;
flush privileges;
+connection con3root;
grant all on *.* to 'mysqltest_1'@'localhost';
+connection default;
unlock tables;
+connection con2root;
+connection con3root;
+connection default;
lock table mysql.user write;
+connection con2root;
set password for 'mysqltest_1'@'localhost' = password('');
+connection con3root;
revoke all on *.* from 'mysqltest_1'@'localhost';
+connection default;
unlock tables;
+connection con2root;
+connection con3root;
+connection default;
drop user 'mysqltest_1'@'localhost';
+disconnect con2root;
+disconnect con3root;
create database TESTDB;
create table t2(a int);
create temporary table t1 as select * from mysql.user;
@@ -361,8 +440,11 @@ Warning 1364 Field 'authentication_string' doesn't have a default value
INSERT INTO mysql.db (host, db, user, select_priv) VALUES
('%','TESTDB','mysqltest_1','Y');
FLUSH PRIVILEGES;
+connect con1,localhost,mysqltest_1,password,TESTDB;
create database TEStdb;
Got one of the listed errors
+connection default;
+disconnect con1;
delete from mysql.user;
delete from mysql.db where host='%' and user='mysqltest_1' and db='TESTDB';
insert into mysql.user select * from t1;
@@ -373,6 +455,8 @@ SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creato
SET GLOBAL log_bin_trust_function_creators = 1;
GRANT ALL PRIVILEGES ON test.* TO `a@`@localhost;
GRANT EXECUTE ON * TO `a@`@localhost;
+connect bug13310,localhost,'a@',,test;
+connection bug13310;
CREATE TABLE t2 (s1 INT);
INSERT INTO t2 VALUES (1);
DROP FUNCTION IF EXISTS f2;
@@ -383,6 +467,8 @@ f2()
1
DROP FUNCTION f2;
DROP TABLE t2;
+disconnect bug13310;
+connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM `a@`@localhost;
DROP USER `a@`@localhost;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
@@ -394,35 +480,48 @@ create database mysqltest_2;
grant all on mysqltest_1.* to mysqltest_u1@localhost;
use mysqltest_2;
create table t1 (i int);
+connect user1,localhost,mysqltest_u1,,mysqltest_1;
+connection user1;
show create table mysqltest_2.t1;
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't1'
create table t1 like mysqltest_2.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
+connection default;
grant select on mysqltest_2.t1 to mysqltest_u1@localhost;
+connection user1;
show create table mysqltest_2.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create table t1 like mysqltest_2.t1;
+connection default;
+disconnect user1;
use test;
drop database mysqltest_1;
drop database mysqltest_2;
drop user mysqltest_u1@localhost;
grant all on `mysqltest\_%`.* to mysqltest_1@localhost with grant option;
grant usage on *.* to mysqltest_2@localhost;
+connect con18600_1,localhost,mysqltest_1,,;
create database mysqltest_1;
use mysqltest_1;
create table t1 (f1 int);
grant create on `mysqltest\_1`.* to mysqltest_2@localhost;
grant select on mysqltest_1.t1 to mysqltest_2@localhost;
+connect con3,localhost,mysqltest_2,,;
+connection con3;
create database mysqltest_3;
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest_3'
use mysqltest_1;
create table t2(f1 int);
select * from t1;
f1
+connection default;
drop database mysqltest_1;
+connection default;
+disconnect con3;
+disconnect con18600_1;
revoke all privileges, grant option from mysqltest_1@localhost;
revoke all privileges, grant option from mysqltest_2@localhost;
drop user mysqltest_1@localhost;
@@ -435,6 +534,8 @@ CREATE TABLE t2 (b INT, c INT);
INSERT INTO t2 VALUES (1,100),(2,200);
GRANT SELECT ON t1 TO mysqltest1@localhost;
GRANT SELECT (b) ON t2 TO mysqltest1@localhost;
+connect conn1,localhost,mysqltest1,,;
+connection conn1;
USE db1;
SELECT c FROM t2;
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
@@ -442,6 +543,8 @@ SELECT * FROM t2;
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for table 't2'
SELECT * FROM t1 JOIN t2 USING (b);
ERROR 42000: SELECT command denied to user 'mysqltest1'@'localhost' for column 'c' in table 't2'
+connection default;
+disconnect conn1;
USE test;
DROP TABLE db1.t1, db1.t2;
DROP USER mysqltest1@localhost;
@@ -530,8 +633,7 @@ CREATE TABLE mysqltest_db2.t2_1(a INT);
# SQL-statement against temporary tables (loosely follow order in
# sql_command enum).
###########################################################################
-
-# -- connect con1, mysqltest_u1@localhost, mysqltest_db1
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
#
# Variants of CREATE TABLE.
#
@@ -770,8 +872,7 @@ DROP TEMPORARY TABLE t1;
# - Check that even outside of SUID context we can access temporary
# table once it is created.
###########################################################################
-
-# -- connect con2, mysqltest_u2@localhost, mysqltest_db1
+connect con2,localhost,mysqltest_u2,,mysqltest_db1;
CREATE TEMPORARY TABLE t2(a INT);
ERROR 42000: Access denied for user 'mysqltest_u2'@'localhost' to database 'mysqltest_db1'
CALL p1();
@@ -796,8 +897,7 @@ DROP TEMPORARY TABLE t4;
# - Check that once table is created it can be accessed from within any
# context, even by user without any privileges on tables.
###########################################################################
-
-# -- connect con3, mysqltest_u4@localhost, mysqltest_db1
+connect con3,localhost,mysqltest_u4,,mysqltest_db1;
CALL p1();
INSERT INTO t4 VALUES (4);
UPDATE t4 SET x = 10 WHERE x = 1;
@@ -812,8 +912,7 @@ DROP TEMPORARY TABLE t4;
# - SELECT_ACL, UPDATE_ACL and DELETE_ACL are required to include
# a temporary table into the underlying-table-list.
###########################################################################
-
-# -- connect con4, mysqltest_u5@localhost, mysqltest_db1
+connect con4,localhost,mysqltest_u5,,mysqltest_db1;
CREATE TEMPORARY TABLE t7(a INT);
CREATE TEMPORARY TABLE t8(a INT);
CREATE TEMPORARY TABLE t9(a INT);
@@ -832,13 +931,12 @@ DROP TEMPORARY TABLE t9;
###########################################################################
# That's all. Cleanup.
###########################################################################
-
-# -- connection: default
-# -- disconnect con1
+connection default;
# All remaining temporary tables are automatically dropped.
-# -- disconnect con2
-# -- disconnect con3
-# -- disconnect con4
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
SET GLOBAL keycache1.key_buffer_size = 0;
DROP DATABASE mysqltest_db1;
DROP DATABASE mysqltest_db2;
diff --git a/mysql-test/r/grant3.result b/mysql-test/r/grant3.result
index d1722fc8ea9..4c99fb02f19 100644
--- a/mysql-test/r/grant3.result
+++ b/mysql-test/r/grant3.result
@@ -1,6 +1,8 @@
set global sql_mode="";
set local sql_mode="";
SET NAMES binary;
+connect master,localhost,root,,;
+connection master;
drop table if exists t1;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
@@ -10,9 +12,14 @@ flush privileges;
create user mysqltest_1@localhost;
grant create user on *.* to mysqltest_1@localhost;
grant select on `my\_1`.* to mysqltest_1@localhost with grant option;
+connect user_a,localhost,mysqltest_1,,;
+connection user_a;
grant select on `my\_1`.* to mysqltest_2@localhost;
ERROR 42000: You are not allowed to create a user with GRANT
create user mysqltest_2@localhost;
+disconnect user_a;
+disconnect master;
+connection default;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
@@ -132,6 +139,8 @@ GRANT SELECT, UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%';
REVOKE SELECT ON `mysqltest_1`.* FROM 'mysqltest1'@'%';
GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%';
FLUSH PRIVILEGES;
+connect conn1,localhost,mysqltest1,,;
+connection conn1;
SHOW GRANTS;
Grants for mysqltest1@%
GRANT USAGE ON *.* TO 'mysqltest1'@'%'
@@ -139,6 +148,8 @@ GRANT SELECT, UPDATE ON `mysqltest\_1`.* TO 'mysqltest1'@'%'
GRANT UPDATE ON `mysqltest_1`.* TO 'mysqltest1'@'%'
SELECT * FROM mysqltest_1.t1;
a
+disconnect conn1;
+connection default;
DROP USER 'mysqltest1'@'%';
DROP DATABASE mysqltest_1;
#
@@ -163,6 +174,8 @@ Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
GRANT SELECT (a), INSERT (b) ON `temp`.`t1` TO 'user2'@'%'
# Connect as the renamed user
+connect conn1, localhost, user2,,;
+connection conn1;
SHOW GRANTS;
Grants for user2@%
GRANT USAGE ON *.* TO 'user2'@'%'
@@ -177,6 +190,8 @@ a
# access this column.
SELECT b FROM temp.t1;
ERROR 42000: SELECT command denied to user 'user2'@'localhost' for column 'b' in table 't1'
+disconnect conn1;
+connection default;
DROP USER 'user2'@'%';
DROP DATABASE temp;
set global sql_mode=default;
diff --git a/mysql-test/r/grant4.result b/mysql-test/r/grant4.result
index 5a0032cd338..c3db2e03e3e 100644
--- a/mysql-test/r/grant4.result
+++ b/mysql-test/r/grant4.result
@@ -11,6 +11,8 @@ grant insert (a) on mysqltest_db1.t_column_priv_only to mysqltest_u1@localhost;
grant select on mysqltest_db1.t_select_priv to mysqltest_u1@localhost;
** Connect as restricted user mysqltest_u1.
+connect con1,localhost,mysqltest_u1,,;
+connection con1;
** Test column level privileges only. No SELECT privileges on the table.
** INSERT INTO ... VALUES ...
** Attempting to insert values to a table with only column privileges
@@ -72,6 +74,7 @@ t_select_priv CREATE TABLE `t_select_priv` (
show create table mysqltest_db1.t_no_priv;
ERROR 42000: SHOW command denied to user 'mysqltest_u1'@'localhost' for table 't_no_priv'
+connection default;
use mysqltest_db1;
CREATE TABLE t5 (s1 INT);
CREATE INDEX i ON t5 (s1);
@@ -85,6 +88,7 @@ GRANT UPDATE (s2) ON t6 to mysqltest_u1@localhost;
GRANT UPDATE (s2) ON v6 to mysqltest_u1@localhost;
GRANT SHOW VIEW ON v2 to mysqltest_u1@localhost;
GRANT SHOW VIEW, SELECT ON v3 to mysqltest_u1@localhost;
+connection con1;
use mysqltest_db1;
** Connect as restricted user mysqltest_u1.
** SELECT FROM INFORMATION_SCHEMA.STATISTICS will succeed because any privileges will do (authentication is enough).
@@ -121,6 +125,8 @@ ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t_select_priv`.`a` AS `a`,`t_select_priv`.`b` AS `b` from `t_select_priv` latin1 latin1_swedish_ci
+connection default;
+disconnect con1;
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
#
@@ -147,11 +153,13 @@ insert into mysqltest_db1.t2 values (1);
# Create user which will try to do this.
create user mysqltest_u1@localhost;
grant insert, select on mysqltest_db1.t1 to mysqltest_u1@localhost;
+connect con1,localhost,mysqltest_u1,,;
+connection default;
# Corrupt t1 by replacing t1.MYI with a corrupt + unclosed one created
# by doing: 'create table t1 (a int key(a))'
# head -c1024 t1.MYI > corrupt_t1.MYI
flush table mysqltest_db1.t1;
-# Switching to connection 'con1'.
+connection con1;
check table mysqltest_db1.t1;
Table Op Msg_type Msg_text
mysqltest_db1.t1 check warning 1 client is using or hasn't closed the table properly
@@ -177,7 +185,8 @@ Table Op Msg_type Msg_text
mysqltest_db1.t1 repair warning Number of rows changed from 1 to 2
mysqltest_db1.t1 repair status OK
# Clean-up.
-# Switching to connection 'default'.
+disconnect con1;
+connection default;
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
create user foo1 identified by password '11111111111111111111111111111111111111111';
diff --git a/mysql-test/r/grant_cache_no_prot.result b/mysql-test/r/grant_cache_no_prot.result
index 34abd96f026..f1adb3ae839 100644
--- a/mysql-test/r/grant_cache_no_prot.result
+++ b/mysql-test/r/grant_cache_no_prot.result
@@ -7,7 +7,8 @@ set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
------ establish connection root -----
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
@@ -26,7 +27,8 @@ insert into test.t1 values ("test.t1");
select * from t1;
a
test.t1
------ establish connection root2 -----
+connect root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root2;
select * from t1;
a b c
1 1 1
@@ -56,7 +58,8 @@ grant SELECT on mysqltest.* to mysqltest_1@localhost;
grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
------ establish connection user1 (user=mysqltest_1) -----
+connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user1;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -121,11 +124,13 @@ Qcache_hits 3
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 1
------ establish connection unkuser (user=unkuser) -----
+connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection unkuser;
show grants for current_user();
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
------ establish connection user2 (user=mysqltest_2) -----
+connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user2;
select "user2";
user2
user2
@@ -156,7 +161,8 @@ Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 2
------ establish connection user3 (user=mysqltest_3) -----
+connect user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user3;
select "user3";
user3
user3
@@ -181,7 +187,8 @@ Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 4
------ establish connection user4 (user=mysqltest_1) -----
+connect user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user4;
select "user4";
user4
user4
@@ -212,8 +219,21 @@ Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 5
------ close connections -----
------ switch to connection default -----
+connection root;
+disconnect root;
+connection root2;
+disconnect root2;
+connection user1;
+disconnect user1;
+connection user2;
+disconnect user2;
+connection user3;
+disconnect user3;
+connection user4;
+disconnect user4;
+connection unkuser;
+disconnect unkuser;
+connection default;
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/r/grant_cache_ps_prot.result b/mysql-test/r/grant_cache_ps_prot.result
index 5fe57c7c35d..56a98cc076d 100644
--- a/mysql-test/r/grant_cache_ps_prot.result
+++ b/mysql-test/r/grant_cache_ps_prot.result
@@ -7,7 +7,8 @@ set LOCAL query_cache_type=ON;
set GLOBAL query_cache_size=1355776;
reset query cache;
flush status;
------ establish connection root -----
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
@@ -26,7 +27,8 @@ insert into test.t1 values ("test.t1");
select * from t1;
a
test.t1
------ establish connection root2 -----
+connect root2,localhost,root,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root2;
select * from t1;
a b c
1 1 1
@@ -56,7 +58,8 @@ grant SELECT on mysqltest.* to mysqltest_1@localhost;
grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
------ establish connection user1 (user=mysqltest_1) -----
+connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user1;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -121,11 +124,13 @@ Qcache_hits 3
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 1
------ establish connection unkuser (user=unkuser) -----
+connect unkuser,localhost,unkuser,,,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection unkuser;
show grants for current_user();
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
------ establish connection user2 (user=mysqltest_2) -----
+connect user2,localhost,mysqltest_2,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user2;
select "user2";
user2
user2
@@ -156,7 +161,8 @@ Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 2
------ establish connection user3 (user=mysqltest_3) -----
+connect user3,localhost,mysqltest_3,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user3;
select "user3";
user3
user3
@@ -181,7 +187,8 @@ Qcache_hits 7
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 3
------ establish connection user4 (user=mysqltest_1) -----
+connect user4,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user4;
select "user4";
user4
user4
@@ -212,8 +219,21 @@ Qcache_hits 8
show status like "Qcache_not_cached";
Variable_name Value
Qcache_not_cached 4
------ close connections -----
------ switch to connection default -----
+connection root;
+disconnect root;
+connection root2;
+disconnect root2;
+connection user1;
+disconnect user1;
+connection user2;
+disconnect user2;
+connection user3;
+disconnect user3;
+connection user4;
+disconnect user4;
+connection unkuser;
+disconnect unkuser;
+connection default;
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
diff --git a/mysql-test/r/grant_explain_non_select.result b/mysql-test/r/grant_explain_non_select.result
index 1dbb5b1e3c0..53b7d687d6c 100644
--- a/mysql-test/r/grant_explain_non_select.result
+++ b/mysql-test/r/grant_explain_non_select.result
@@ -6,6 +6,8 @@ CREATE TABLE privtest_db.t2 (a INT);
INSERT INTO privtest_db.t2 VALUES (1), (2), (3);
GRANT USAGE ON *.* TO 'privtest'@'localhost';
GRANT SELECT ON privtest_db.t2 TO 'privtest'@'localhost';
+connect con1,localhost,privtest,,;
+connection con1;
USE privtest_db;
EXPLAIN INSERT INTO t1 VALUES (10);
ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
@@ -15,7 +17,9 @@ EXPLAIN INSERT INTO t1 SELECT * FROM t2;
ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
INSERT INTO t1 SELECT * FROM t2;
ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
GRANT INSERT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN INSERT INTO t1 VALUES (10);
id select_type table type possible_keys key key_len ref rows Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
@@ -24,7 +28,9 @@ EXPLAIN INSERT INTO t1 SELECT * FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
INSERT INTO t1 SELECT * FROM t2;
+connection default;
REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+connection con1;
EXPLAIN REPLACE INTO t1 VALUES (10);
ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
REPLACE INTO t1 VALUES (10);
@@ -33,7 +39,9 @@ EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
REPLACE INTO t1 SELECT * FROM t2;
ERROR 42000: INSERT, DELETE command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
GRANT INSERT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN REPLACE INTO t1 VALUES (10);
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
REPLACE INTO t1 VALUES (10);
@@ -42,8 +50,10 @@ EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
REPLACE INTO t1 SELECT * FROM t2;
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
REVOKE INSERT ON privtest_db.t1 FROM 'privtest'@'localhost';
GRANT DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN REPLACE INTO t1 VALUES (10);
ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
REPLACE INTO t1 VALUES (10);
@@ -52,7 +62,9 @@ EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
REPLACE INTO t1 SELECT * FROM t2;
ERROR 42000: INSERT command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
GRANT INSERT, DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN REPLACE INTO t1 VALUES (10);
id select_type table type possible_keys key key_len ref rows Extra
1 INSERT t1 ALL NULL NULL NULL NULL NULL NULL
@@ -61,7 +73,9 @@ EXPLAIN REPLACE INTO t1 SELECT * FROM t2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
REPLACE INTO t1 SELECT * FROM t2;
+connection default;
REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+connection con1;
EXPLAIN UPDATE t1 SET a = a + 1;
ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
UPDATE t1 SET a = a + 1;
@@ -70,7 +84,9 @@ EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
GRANT UPDATE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN UPDATE t1 SET a = a + 1;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
UPDATE t1 SET a = a + 1;
@@ -79,8 +95,10 @@ EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
+connection default;
REVOKE UPDATE ON privtest_db.t1 FROM 'privtest'@'localhost';
GRANT SELECT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN UPDATE t1 SET a = a + 1;
ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
UPDATE t1 SET a = a + 1;
@@ -89,7 +107,9 @@ EXPLAIN UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
ERROR 42000: UPDATE command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
GRANT UPDATE, SELECT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN UPDATE t1 SET a = a + 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8
@@ -99,7 +119,9 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
UPDATE t1, t2 SET t1.a = t1.a + 1 WHERE t1.a = t2.a;
+connection default;
REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
+connection con1;
EXPLAIN DELETE FROM t1 WHERE a = 10;
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
DELETE FROM t1 WHERE a = 10;
@@ -108,7 +130,9 @@ EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
GRANT DELETE ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN DELETE FROM t1 WHERE a = 10;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for column 'a' in table 't1'
DELETE FROM t1 WHERE a = 10;
@@ -117,8 +141,10 @@ EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
ERROR 42000: SELECT command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
GRANT SELECT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN DELETE FROM t1 WHERE a = 10;
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
DELETE FROM t1 WHERE a = 10;
@@ -127,8 +153,10 @@ EXPLAIN DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
ERROR 42000: DELETE command denied to user 'privtest'@'localhost' for table 't1'
+connection default;
REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
GRANT DELETE, SELECT ON privtest_db.t1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN DELETE FROM t1 WHERE a = 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
@@ -138,9 +166,11 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 3
1 SIMPLE t1 ALL NULL NULL NULL NULL 8 Using where
DELETE FROM t1 USING t1, t2 WHERE t1.a = t2.a;
+connection default;
REVOKE ALL PRIVILEGES ON privtest_db.t1 FROM 'privtest'@'localhost';
CREATE VIEW privtest_db.v1 (a) AS SELECT a FROM privtest_db.t1;
GRANT SELECT, INSERT, UPDATE, DELETE ON privtest_db.v1 TO 'privtest'@'localhost';
+connection con1;
EXPLAIN SELECT * FROM v1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
SELECT * FROM v1;
@@ -175,6 +205,8 @@ DELETE FROM v1 WHERE a = 10;
EXPLAIN DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
DELETE FROM v1 USING v1, t2 WHERE v1.a = t2.a;
+connection default;
+disconnect con1;
DROP USER 'privtest'@localhost;
USE test;
DROP DATABASE privtest_db;
diff --git a/mysql-test/r/grant_lowercase.result b/mysql-test/r/grant_lowercase.result
index b449453a47a..d4a1667595e 100644
--- a/mysql-test/r/grant_lowercase.result
+++ b/mysql-test/r/grant_lowercase.result
@@ -1,8 +1,12 @@
set sql_mode="";
grant file on *.* to user1@localhost with grant option;
grant select on `a%`.* to user1@localhost with grant option;
+connect conn1,localhost,user1,,;
+connection conn1;
grant file on aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.* to 'user'@'%' identified by 'secret';
ERROR 42000: Incorrect database name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
+connection default;
+disconnect conn1;
drop user user1@localhost;
call mtr.add_suppression("Incorrect database name");
alter table mysql.host modify Db varchar(200);
diff --git a/mysql-test/r/grant_lowercase_fs.result b/mysql-test/r/grant_lowercase_fs.result
index eb27b1d7ea0..e883067eca0 100644
--- a/mysql-test/r/grant_lowercase_fs.result
+++ b/mysql-test/r/grant_lowercase_fs.result
@@ -3,13 +3,18 @@ create user user_1@localhost;
create user USER_1@localhost;
GRANT CREATE ON db1.* to user_1@localhost;
GRANT SELECT ON db1.* to USER_1@localhost;
+connect con1,localhost,user_1,,db1;
CREATE TABLE t1(f1 int);
SELECT * FROM t1;
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
+connect con2,localhost,USER_1,,db1;
SELECT * FROM t1;
f1
CREATE TABLE t2(f1 int);
ERROR 42000: CREATE command denied to user 'USER_1'@'localhost' for table 't2'
+connection default;
+disconnect con1;
+disconnect con2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
DROP USER user_1@localhost;
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index fa5280df2b4..fba04812a5b 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -230,6 +230,8 @@ a int(11) YES NULL
create view mysqltest.v1 (c) as select a from mysqltest.t1;
grant select (a) on mysqltest.t1 to mysqltest_2@localhost;
grant select on mysqltest.v1 to mysqltest_3;
+connect user3,localhost,mysqltest_2,,;
+connection user3;
select table_name, column_name, privileges from information_schema.columns
where table_schema = 'mysqltest' and table_name = 't1';
table_name column_name privileges
@@ -237,12 +239,16 @@ t1 a select
show columns from mysqltest.t1;
Field Type Null Key Default Extra
a int(11) YES NULL
+connect user4,localhost,mysqltest_3,,mysqltest;
+connection user4;
select table_name, column_name, privileges from information_schema.columns
where table_schema = 'mysqltest' and table_name = 'v1';
table_name column_name privileges
v1 c select
explain select * from v1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+connection default;
+disconnect user4;
drop view v1, mysqltest.v1;
drop tables mysqltest.t4, mysqltest.t1, t2, t3, t5;
drop database mysqltest;
@@ -346,15 +352,21 @@ routine_schema routine_name
test sel2
test sub1
drop view v1;
+connect user1,localhost,mysqltest_1,,;
+connection user1;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
ROUTINE_NAME ROUTINE_DEFINITION
show create function sub1;
ERROR 42000: FUNCTION sub1 does not exist
+connection user3;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
ROUTINE_NAME ROUTINE_DEFINITION
sel2 NULL
sub1 NULL
+connection default;
grant all privileges on test.* to mysqltest_1@localhost;
+connect user2,localhost,mysqltest_1,,;
+connection user2;
select ROUTINE_NAME, ROUTINE_DEFINITION from information_schema.ROUTINES;
ROUTINE_NAME ROUTINE_DEFINITION
sel2 NULL
@@ -379,6 +391,9 @@ return i+1 latin1 latin1_swedish_ci latin1_swedish_ci
show function status like "sub2";
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test sub2 FUNCTION mysqltest_1@localhost # # DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+connection default;
+disconnect user1;
+disconnect user3;
drop function sub2;
show create procedure sel2;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
@@ -510,6 +525,7 @@ def test PRIMARY def test t1 a 1 NULL NULL NULL NULL
def test constraint_1 def test t1 a 1 NULL NULL NULL NULL
def test key_1 def test t1 a 1 NULL NULL NULL NULL
def test key_2 def test t1 a 1 NULL NULL NULL NULL
+connection user2;
select table_name from information_schema.TABLES where table_schema like "test%";
table_name
t1
@@ -520,6 +536,8 @@ select ROUTINE_NAME from information_schema.ROUTINES;
ROUTINE_NAME
sel2
sub1
+disconnect user2;
+connection default;
delete from mysql.user where user='mysqltest_1';
drop table t1;
drop procedure sel2;
@@ -887,6 +905,8 @@ x_float NULL NULL
x_double_precision NULL NULL
drop table t1;
grant select on test.* to mysqltest_4@localhost;
+connect user10261,localhost,mysqltest_4,,;
+connection user10261;
SELECT TABLE_NAME, COLUMN_NAME, PRIVILEGES FROM INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME='TABLE_NAME' and table_name not like 'innodb%';
TABLE_NAME COLUMN_NAME PRIVILEGES
@@ -903,6 +923,8 @@ TABLE_CONSTRAINTS TABLE_NAME select
TABLE_PRIVILEGES TABLE_NAME select
TABLE_STATISTICS TABLE_NAME select
VIEWS TABLE_NAME select
+connection default;
+disconnect user10261;
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
flush privileges;
@@ -970,6 +992,11 @@ grant select (f1) on mysqltest.t1 to user1@localhost;
grant select on mysqltest.t2 to user2@localhost;
grant select on mysqltest.* to user3@localhost;
grant select on *.* to user4@localhost;
+connect con1,localhost,user1,,mysqltest;
+connect con2,localhost,user2,,mysqltest;
+connect con3,localhost,user3,,mysqltest;
+connect con4,localhost,user4,,;
+connection con1;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'user1'@'localhost' def mysqltest t1 f1 SELECT NO
@@ -984,6 +1011,7 @@ show grants;
Grants for user1@localhost
GRANT USAGE ON *.* TO 'user1'@'localhost'
GRANT SELECT (f1) ON `mysqltest`.`t1` TO 'user1'@'localhost'
+connection con2;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.table_privileges order by grantee;
@@ -998,6 +1026,7 @@ show grants;
Grants for user2@localhost
GRANT USAGE ON *.* TO 'user2'@'localhost'
GRANT SELECT ON `mysqltest`.`t2` TO 'user2'@'localhost'
+connection con3;
select * from information_schema.column_privileges order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
select * from information_schema.table_privileges order by grantee;
@@ -1012,6 +1041,7 @@ show grants;
Grants for user3@localhost
GRANT USAGE ON *.* TO 'user3'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'user3'@'localhost'
+connection con4;
select * from information_schema.column_privileges where grantee like '%user%'
order by grantee;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
@@ -1034,6 +1064,11 @@ GRANTEE TABLE_CATALOG PRIVILEGE_TYPE IS_GRANTABLE
show grants;
Grants for user4@localhost
GRANT SELECT ON *.* TO 'user4'@'localhost'
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
drop user user1@localhost, user2@localhost, user3@localhost, user4@localhost;
use test;
drop database mysqltest;
@@ -1107,12 +1142,15 @@ t2 MyISAM 10 Fixed 0 0 0 # 1024 0 NULL # # NULL latin1_swedish_ci NULL
DROP TABLE t1,t2;
create table t1(f1 int);
create view v1 (c) as select f1 from t1;
+connect con5,localhost,root,,*NO-ONE*;
select database();
database()
NULL
show fields from test.v1;
Field Type Null Key Default Extra
c int(11) YES NULL
+connection default;
+disconnect con5;
drop view v1;
drop table t1;
alter database information_schema;
@@ -1223,11 +1261,15 @@ create table t1 (id int);
create view v1 as select * from t1;
create definer = mysqltest_1@localhost
sql security definer view v2 as select 1;
+connect con16681,localhost,mysqltest_1,,test;
+connection con16681;
select * from information_schema.views
where table_name='v1' or table_name='v2';
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def test v1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def test v2 select 1 AS `1` NONE NO mysqltest_1@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
+connection default;
+disconnect con16681;
drop view v1, v2;
drop table t1;
drop user mysqltest_1@localhost;
@@ -1259,6 +1301,7 @@ SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN @a + 1 latin1 latin1_swedish_ci latin1_swedish_ci
+connect conn1, localhost, mysql_bug20230,,;
SELECT ROUTINE_NAME, ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_SCHEMA='test';
ROUTINE_NAME ROUTINE_DEFINITION
f1 NULL
@@ -1273,6 +1316,8 @@ CALL p1();
SELECT f1();
f1()
2
+disconnect conn1;
+connection default;
DROP FUNCTION f1;
DROP PROCEDURE p1;
DROP USER mysql_bug20230@localhost;
@@ -1351,6 +1396,7 @@ t1_ai
show triggers from mysqltest;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
t1_ai INSERT t1 set @a = new.a + new.b + new.c AFTER NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+connect con27629,localhost,mysqltest_1,,mysqltest;
show columns from t1;
Field Type Null Key Default Extra
b int(11) YES NULL
@@ -1362,6 +1408,8 @@ Trigger Event Table Statement Timing Created sql_mode Definer character_set_clie
select trigger_name from information_schema.triggers
where event_object_table='t1';
trigger_name
+connection default;
+disconnect con27629;
drop user mysqltest_1@localhost;
drop database mysqltest;
create table t1 (
@@ -1415,13 +1463,19 @@ select * from information_schema.engines WHERE ENGINE="MyISAM";
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
MyISAM DEFAULT MyISAM storage engine NO NO NO
grant select on *.* to user3148@localhost;
+connect con3148,localhost,user3148,,test;
+connection con3148;
select user,db from information_schema.processlist;
user db
user3148 test
+connection default;
+disconnect con3148;
drop user user3148@localhost;
+connect pslistcon,localhost,root,,test;
SELECT 'other connection here' AS who;
who
other connection here
+connection default;
SELECT IF(`time` > 0, 'OK', `time`) AS time_low,
IF(`time` < 1000, 'OK', `time`) AS time_high,
IF(time_ms >= 1000, 'OK', time_ms) AS time_ms_low,
@@ -1430,6 +1484,7 @@ FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID=@tid;
time_low time_high time_ms_low time_ms_high
OK OK OK OK
+disconnect pslistcon;
DROP TABLE IF EXISTS server_status;
DROP EVENT IF EXISTS event_status;
SET GLOBAL event_scheduler=1;
@@ -1579,10 +1634,22 @@ show open tables where f1()=0;
show open tables where f1()=0;
drop table t1;
drop function f1;
+connect conn1, localhost, root,,;
+connection conn1;
select * from information_schema.tables where 1=sleep(100000);
+connection default;
+connection conn1;
Got one of the listed errors
+connection default;
+disconnect conn1;
+connect conn1, localhost, root,,;
+connection conn1;
select * from information_schema.columns where 1=sleep(100000);
+connection default;
+connection conn1;
Got one of the listed errors
+connection default;
+disconnect conn1;
explain select count(*) from information_schema.tables;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE tables ALL NULL NULL NULL NULL NULL Skip_open_table; Scanned all databases
@@ -1688,6 +1755,8 @@ USE db1;
CREATE TABLE t1 (id INT);
CREATE USER nonpriv;
USE test;
+connect nonpriv_con, localhost, nonpriv,,;
+connection nonpriv_con;
# connected as nonpriv
# Should return 0
SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1';
@@ -1698,7 +1767,9 @@ USE INFORMATION_SCHEMA;
SELECT COUNT(*) FROM TABLES WHERE TABLE_NAME='t1';
COUNT(*)
0
+connection default;
# connected as root
+disconnect nonpriv_con;
DROP USER nonpriv;
DROP TABLE db1.t1;
DROP DATABASE db1;
@@ -1732,8 +1803,12 @@ DROP TABLE ubig;
select 1 from information_schema.tables where table_schema=repeat('a', 2000);
1
grant usage on *.* to mysqltest_1@localhost;
+connect con1, localhost, mysqltest_1,,;
+connection con1;
select 1 from information_schema.tables where table_schema=repeat('a', 2000);
1
+connection default;
+disconnect con1;
drop user mysqltest_1@localhost;
End of 5.1 tests.
#
@@ -1746,13 +1821,15 @@ End of 5.1 tests.
drop tables if exists t1, t2, t3;
create table t1 (i int);
create table t2 (j int primary key auto_increment);
-# Switching to connection 'con3726_1'
+connect con3726_1,localhost,root,,test;
+connection con3726_1;
lock table t2 read;
-# Switching to connection 'con3726_2'
+connect con3726_2,localhost,root,,test;
+connection con3726_2;
# RENAME below will be blocked by 'lock table t2 read' above but
# will add two pending requests for exclusive metadata locks.
rename table t2 to t3;
-# Switching to connection 'default'
+connection default;
# These statements should not be blocked by pending lock requests
select table_name, column_name, data_type from information_schema.columns
where table_schema = 'test' and table_name in ('t1', 't2');
@@ -1764,10 +1841,12 @@ where table_schema = 'test' and table_name in ('t1', 't2');
table_name auto_increment
t1 NULL
t2 1
-# Switching to connection 'con3726_1'
+connection con3726_1;
unlock tables;
-# Switching to connection 'con3726_2'
-# Switching to connection 'default'
+connection con3726_2;
+connection default;
+disconnect con3726_1;
+disconnect con3726_2;
drop tables t1, t3;
EXPLAIN SELECT * FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1846,9 +1925,10 @@ create table t1 (a int, b int);
create view v1 as select t1.a, t1.b from t1;
alter table t1 change b c int;
lock table t1 read;
-# --> connection con1
+connect con1, localhost, root,,;
+connection con1;
flush tables;
-# --> connection default
+connection default;
select * from information_schema.views;
TABLE_CATALOG def
TABLE_SCHEMA test
@@ -1869,9 +1949,10 @@ unlock tables;
#
# Cleanup.
#
-# --> connection con1
+connection con1;
# Reaping 'flush tables'
-# --> connection default
+disconnect con1;
+connection default;
drop table t1;
drop view v1;
#
@@ -1897,47 +1978,33 @@ create table t2 (k int);
# Acquire lock on 't2' so upcoming RENAME is
# blocked.
lock tables t2 read;
-#
-# Switching to connection 'con12828477_1'.
-#
+connect con12828477_1, localhost, root,,mysqltest;
# The below RENAME should wait on 't2' while
# keeping X lock on 't1'.
rename table t1 to t3, t2 to t1, t3 to t2;
-#
-# Switching to connection 'con12828477_2'.
-#
+connect con12828477_2, localhost, root,,mysqltest;
# Wait while the above RENAME is blocked.
# Issue query to I_S which will open 't0' and get
# blocked on 't1' because of RENAME.
select table_name, auto_increment from information_schema.tables where table_schema='mysqltest';
-#
-# Switching to connection 'con12828477_3'.
-#
+connect con12828477_3, localhost, root,,mysqltest;
# Wait while the above SELECT is blocked.
#
# Check that it holds no lock on 't0' so it can be renamed.
rename table t0 to t4;
-#
-# Switching to connection 'default'.
-#
+connection default;
#
# Unblock the first RENAME.
unlock tables;
-#
-# Switching to connection 'con12828477_1'.
-#
+connection con12828477_1;
# Reap the first RENAME
-#
-# Switching to connection 'con12828477_2'.
-#
+connection con12828477_2;
# Reap SELECT to I_S.
table_name auto_increment
t0 NULL
t1 NULL
t2 NULL
-#
-# Switching to connection 'default'.
-#
+connection default;
#
# Now test that we don't keep locks in case when we to fill
# I_S table we read .FRM or .TRG file only (this was the case
@@ -1947,44 +2014,33 @@ rename table t4 to t0;
# Acquire lock on 't2' so upcoming RENAME is
# blocked.
lock tables t2 read;
-#
-# Switching to connection 'con12828477_1'.
-#
+connection con12828477_1;
# The below RENAME should wait on 't2' while
# keeping X lock on 't1'.
rename table t1 to t3, t2 to t1, t3 to t2;
-#
-# Switching to connection 'con12828477_2'.
-#
+connection con12828477_2;
# Wait while the above RENAME is blocked.
# Issue query to I_S which will open 't0' and get
# blocked on 't1' because of RENAME.
select event_object_table, trigger_name from information_schema.triggers where event_object_schema='mysqltest';
-#
-# Switching to connection 'con12828477_3'.
-#
+connection con12828477_3;
# Wait while the above SELECT is blocked.
#
# Check that it holds no lock on 't0' so it can be renamed.
rename table t0 to t4;
-#
-# Switching to connection 'default'.
-#
+connection default;
#
# Unblock the first RENAME.
unlock tables;
-#
-# Switching to connection 'con12828477_1'.
-#
+connection con12828477_1;
# Reap the first RENAME
-#
-# Switching to connection 'con12828477_2'.
-#
+connection con12828477_2;
# Reap SELECT to I_S.
event_object_table trigger_name
-#
-# Switching to connection 'default'.
-#
+connection default;
+disconnect con12828477_1;
+disconnect con12828477_2;
+disconnect con12828477_3;
#
# MDEV-3818: Query against view over IS tables worse than equivalent query without view
#
@@ -2030,6 +2086,8 @@ SELECT @val1 = @val2;
# MDEV-5723: mysqldump -uroot unusable for multi-database operations, checks all databases
#
drop database if exists db1;
+connect con1,localhost,root,,;
+connection con1;
create database db1;
use db1;
create table t1 (a int);
@@ -2068,4 +2126,6 @@ Variable_name Value
Opened_tables 3
drop database mysqltest;
drop database db1;
+connection default;
+disconnect con1;
set global sql_mode=default;
diff --git a/mysql-test/r/information_schema_db.result b/mysql-test/r/information_schema_db.result
index c09e04f786a..ca1ab45b98b 100644
--- a/mysql-test/r/information_schema_db.result
+++ b/mysql-test/r/information_schema_db.result
@@ -38,10 +38,13 @@ create table t1
(f1 int(10) unsigned not null,
f2 varchar(100) not null,
primary key (f1), unique key (f2));
+connect user1,localhost,mysqltest_1,,;
+connection user1;
select * from information_schema.tables;
call mbase.p1();
call mbase.p1();
call mbase.p1();
+connection default;
use `inf%`;
drop user mysqltest_1@localhost;
drop table t1;
@@ -59,6 +62,7 @@ drop function func2;
drop database `inf%`;
drop procedure mbase.p1;
drop database mbase;
+disconnect user1;
use test;
create table t1 (i int);
create function f1 () returns int return (select max(i) from t1);
@@ -87,6 +91,7 @@ create user testdb_1@localhost;
grant all on testdb_1.* to testdb_1@localhost with grant option;
create user testdb_2@localhost;
grant all on test.* to testdb_2@localhost with grant option;
+connect testdb_1,localhost,testdb_1,,test;
use testdb_1;
create table t1 (f1 char(4));
create view v1 as select f1 from t1;
@@ -95,6 +100,7 @@ create view v5 as select f1 from t1;
grant select, show view on v5 to testdb_2@localhost;
create definer=`no_such_user`@`no_such_host` view v6 as select f1 from t1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection default;
use testdb_1;
create view v6 as select f1 from t1;
grant select, show view on v6 to testdb_2@localhost;
@@ -118,9 +124,11 @@ Field Type Null Key Default Extra
f1 char(4) YES NULL
Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
+connection testdb_1;
create table t3 (f1 char(4), f2 char(4));
create view v3 as select f1,f2 from t3;
grant insert(f1), insert(f2) on v3 to testdb_2@localhost;
+connect testdb_2,localhost,testdb_2,,test;
create view v2 as select f1 from testdb_1.v1;
create view v4 as select f1,f2 from testdb_1.v3;
show fields from testdb_1.v5;
@@ -135,6 +143,7 @@ f1 char(4) YES NULL
show create view testdb_1.v6;
View Create View character_set_client collation_connection
v6 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v6` AS select `testdb_1`.`t1`.`f1` AS `f1` from `testdb_1`.`t1` latin1 latin1_swedish_ci
+connection testdb_1;
show fields from testdb_1.v7;
Field Type Null Key Default Extra
f1 char(4) YES NULL
@@ -147,8 +156,10 @@ Warnings:
Note 1449 The user specified as a definer ('no_such_user'@'no_such_host') does not exist
revoke insert(f1) on v3 from testdb_2@localhost;
revoke select,show view on v5 from testdb_2@localhost;
+connection default;
use testdb_1;
revoke select,show view on v6 from testdb_2@localhost;
+connection testdb_2;
show fields from testdb_1.v5;
ERROR 42000: SELECT command denied to user 'testdb_2'@'localhost' for table 'v5'
show create view testdb_1.v5;
@@ -192,9 +203,15 @@ where a.table_name = 'testdb_1.v1';
view_definition
select * from v2;
ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+connection default;
use test;
drop view testdb_1.v1, v2, testdb_1.v3, v4;
drop database testdb_1;
+connection testdb_1;
+disconnect testdb_1;
+connection testdb_2;
+disconnect testdb_2;
+connection default;
drop user testdb_1@localhost;
drop user testdb_2@localhost;
create database testdb_1;
@@ -202,6 +219,8 @@ create table testdb_1.t1 (a int);
create view testdb_1.v1 as select * from testdb_1.t1;
grant show view on testdb_1.* to mysqltest_1@localhost;
grant select on testdb_1.v1 to mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
select table_schema, table_name, view_definition from information_schema.views
where table_name='v1';
table_schema table_name view_definition
@@ -209,13 +228,19 @@ testdb_1 v1 select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1`
show create view testdb_1.v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `testdb_1`.`v1` AS select `testdb_1`.`t1`.`a` AS `a` from `testdb_1`.`t1` latin1 latin1_swedish_ci
+connection default;
revoke select on testdb_1.v1 from mysqltest_1@localhost;
+connection user1;
select table_schema, table_name, view_definition from information_schema.views
where table_name='v1';
table_schema table_name view_definition
testdb_1 v1
show create view testdb_1.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v1'
+connection default;
drop user mysqltest_1@localhost;
drop database testdb_1;
+connection user1;
+disconnect user1;
+connection default;
set global sql_mode=default;
diff --git a/mysql-test/r/information_schema_linux.result b/mysql-test/r/information_schema_linux.result
index 43095b76151..b4b7de7bc65 100644
--- a/mysql-test/r/information_schema_linux.result
+++ b/mysql-test/r/information_schema_linux.result
@@ -2,6 +2,9 @@
# MDEV-6756: map a linux pid (child pid) to a connection id shown in
# the output of SHOW PROCESSLIST
#
+connect con1,localhost,root;
SELECT max(tid) != min(tid) FROM information_schema.processlist;
max(tid) != min(tid)
1
+connection default;
+disconnect con1;
diff --git a/mysql-test/r/init_connect.result b/mysql-test/r/init_connect.result
index 0ff6c206422..11bb6036156 100644
--- a/mysql-test/r/init_connect.result
+++ b/mysql-test/r/init_connect.result
@@ -1,29 +1,51 @@
+connect con0,localhost,root,,;
+connection con0;
select hex(@a);
hex(@a)
NULL
+connect con1,localhost,user_1,,;
+connection con1;
select hex(@a);
hex(@a)
610063
+connection con0;
set global init_connect="set @a=2;set @b=3";
+connect con2,localhost,user_1,,;
+connection con2;
select @a, @b;
@a @b
2 3
+connection con0;
set GLOBAL init_connect=DEFAULT;
+connect con3,localhost,user_1,,;
+connection con3;
select @a;
@a
NULL
+connection con0;
set global init_connect="drop table if exists t1; create table t1(a char(10));\
insert into t1 values ('\0');insert into t1 values('abc')";
+connect con4,localhost,user_1,,;
+connection con4;
select hex(a) from t1;
hex(a)
00
616263
+connection con0;
set GLOBAL init_connect="adsfsdfsdfs";
+connect con5,localhost,user_1,,;
+connection con5;
select @a;
ERROR 08S01: Aborted connection to db: 'test' user: 'user_1' host: 'localhost' (init_connect command failed)
select @a;
Got one of the listed errors
+connection con0;
drop table t1;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
+disconnect con5;
End of 4.1 tests
create table t1 (x int);
insert into t1 values (3), (5), (7);
@@ -31,18 +53,24 @@ create table t2 (y int);
create user mysqltest1@localhost;
grant all privileges on test.* to mysqltest1@localhost;
set global init_connect="create procedure p1() select * from t1";
+connect con1,localhost,mysqltest1,,;
+connection con1;
call p1();
x
3
5
7
drop procedure p1;
+connection con0;
+disconnect con1;
set global init_connect="create procedure p1(x int)\
begin\
select count(*) from t1;\
select * from t1;\
set @x = x;
end";
+connect con1,localhost,mysqltest1,,;
+connection con1;
call p1(42);
count(*)
3
@@ -53,13 +81,23 @@ x
select @x;
@x
42
+connection con0;
+disconnect con1;
set global init_connect="call p1(4711)";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select @x;
@x
4711
+connection con0;
+disconnect con1;
set global init_connect="drop procedure if exists p1";
+connect con1,localhost,mysqltest1,,;
+connection con1;
call p1();
ERROR 42000: PROCEDURE test.p1 does not exist
+connection con0;
+disconnect con1;
create procedure p1(out sum int)
begin
declare n int default 0;
@@ -81,9 +119,13 @@ end;
end loop;
end|
set global init_connect="call p1(@sum)";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select @sum;
@sum
12
+connection con0;
+disconnect con1;
drop procedure p1;
create procedure p1(tbl char(10), v int)
begin
@@ -94,12 +136,16 @@ execute stmt1 using @v;
deallocate prepare stmt1;
end|
set global init_connect="call p1('t1', 11)";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select * from t1;
x
3
5
7
11
+connection con0;
+disconnect con1;
drop procedure p1;
create function f1() returns int
begin
@@ -108,22 +154,36 @@ select count(*) into n from t1;
return n;
end|
set global init_connect="set @x = f1()";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select @x;
@x
4
+connection con0;
+disconnect con1;
set global init_connect="create view v1 as select f1()";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select * from v1;
f1()
4
+connection con0;
+disconnect con1;
set global init_connect="drop view v1";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
+connection con0;
+disconnect con1;
drop function f1;
create trigger trg1
after insert on t2
for each row
insert into t1 values (new.y);
set global init_connect="insert into t2 values (13), (17), (19)";
+connect con1,localhost,mysqltest1,,;
+connection con1;
select * from t1;
x
3
@@ -133,6 +193,9 @@ x
13
17
19
+connection default;
+disconnect con0;
+disconnect con1;
drop trigger trg1;
set global init_connect="set @a='a\\0c'";
revoke all privileges, grant option from mysqltest1@localhost;
diff --git a/mysql-test/r/init_connection_query_cache.result b/mysql-test/r/init_connection_query_cache.result
index 5a1e5c5244f..eacc06c05f6 100644
--- a/mysql-test/r/init_connection_query_cache.result
+++ b/mysql-test/r/init_connection_query_cache.result
@@ -6,6 +6,8 @@ set GLOBAL query_cache_size=1355776;
create user mysqltest1@localhost;
grant SELECT on test.* to mysqltest1@localhost;
create table t1 (a int);
+connect con1,localhost,mysqltest1,,;
+connection con1;
# This explain put here to be sure that init connection query
# has 'Impossible WHERE'.
explain extended select * from test.t1 where 0;
@@ -13,6 +15,8 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
+connection default;
+disconnect con1;
revoke all privileges, grant option from mysqltest1@localhost;
drop user mysqltest1@localhost;
drop table t1;
diff --git a/mysql-test/r/innodb_mysql_lock.result b/mysql-test/r/innodb_mysql_lock.result
index 70b86017008..a7f45d355f1 100644
--- a/mysql-test/r/innodb_mysql_lock.result
+++ b/mysql-test/r/innodb_mysql_lock.result
@@ -5,29 +5,38 @@ set session innodb_lock_wait_timeout=300;
# Bug #22876 Four-way deadlock
#
DROP TABLE IF EXISTS t1;
-# Connection 1
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connection con1;
set @@autocommit=0;
CREATE TABLE t1(s1 INT UNIQUE) ENGINE=innodb;
INSERT INTO t1 VALUES (1);
-# Connection 2
+connection con2;
set @@autocommit=0;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (1);
-# Connection 3
+connection con3;
set @@autocommit=0;
DROP TABLE t1;
-# Connection 1
+connection con1;
# Connection 1 is now holding the lock.
# Issuing insert from connection 1 while connection 2&3
# is waiting for the lock should give a deadlock error.
INSERT INTO t1 VALUES (2);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Cleanup
+connection con2;
commit;
set @@autocommit=1;
+connection con1;
commit;
set @@autocommit=1;
+connection con3;
set @@autocommit=1;
+connection default;
+disconnect con1;
+disconnect con3;
#
# Test for bug #37346 "innodb does not detect deadlock between update
# and alter table".
@@ -39,14 +48,15 @@ begin;
# Run statement which acquires X-lock on one of table's rows.
update t1 set c3=c3+1 where c2=3;
#
-# Switching to connection 'con37346'.
+connect con37346,localhost,root,,test,,;
+connection con37346;
# The below ALTER TABLE statement should wait till transaction
# in connection 'default' is complete and then succeed.
# It should not deadlock or fail with ER_LOCK_DEADLOCK error.
# Sending:
alter table t1 add column c4 int;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until the above ALTER TABLE gets blocked because this
# connection holds SW metadata lock on table to be altered.
# The below statement should succeed. It should not
@@ -55,10 +65,11 @@ update t1 set c3=c3+1 where c2=4;
# Unblock ALTER TABLE by committing transaction.
commit;
#
-# Switching to connection 'con37346'.
+connection con37346;
# Reaping ALTER TABLE.
#
-# Switching to connection 'default'.
+connection default;
+disconnect con37346;
drop table t1;
#
# Bug #42147 Concurrent DML and LOCK TABLE ... READ for InnoDB
@@ -72,22 +83,23 @@ drop table t1;
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (i INT) engine= innodb;
-# Connection 2
# Get user-level lock
+connection con2;
SELECT get_lock('bug42147_lock', 60);
get_lock('bug42147_lock', 60)
1
-# Connection 1
+connection default;
INSERT INTO t1 SELECT get_lock('bug42147_lock', 60);
-# Connection 2
+connection con2;
LOCK TABLES t1 READ;
SELECT release_lock('bug42147_lock');
release_lock('bug42147_lock')
1
-# Connection 1
-# Connection 2
+connection default;
+connection con2;
UNLOCK TABLES;
-# Connection 1
+connection default;
+disconnect con2;
DROP TABLE t1;
#
# Bug#53798 OPTIMIZE TABLE breaks repeatable read
@@ -95,29 +107,30 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) engine=innodb;
INSERT INTO t1 VALUES (1), (2), (3);
-# Connection con1
+connect con1, localhost, root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SELECT * FROM t1;
a
1
2
3
-# Connection default
+connection default;
# This should block
# Sending:
OPTIMIZE TABLE t1;
-# Connection con1
+connection con1;
SELECT * FROM t1;
a
1
2
3
COMMIT;
-# Connection default
+connection default;
# Reaping OPTIMIZE TABLE t1
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
+disconnect con1;
DROP TABLE t1;
#
# Bug#49891 View DDL breaks REPEATABLE READ
@@ -127,52 +140,58 @@ DROP VIEW IF EXISTS v2;
CREATE TABLE t1 ( f1 INTEGER ) ENGINE = innodb;
CREATE TABLE t2 ( f1 INTEGER );
CREATE VIEW v1 AS SELECT 1 FROM t1;
-# Connection con3
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection con3;
LOCK TABLE t1 WRITE;
-# Connection default
+connection default;
START TRANSACTION;
# Sending:
SELECT * FROM v1;
-# Connection con2
+connection con2;
# Waiting for 'SELECT * FROM v1' to sync in.
# Sending:
ALTER VIEW v1 AS SELECT 2 FROM t2;
-# Connection con3
+connection con3;
# Waiting for 'ALTER VIEW v1 AS SELECT 2 FROM t2' to sync in.
UNLOCK TABLES;
-# Connection default;
+connection default;
# Reaping: SELECT * FROM v1
1
SELECT * FROM v1;
1
COMMIT;
-# Connection con2
+connection con2;
# Reaping: ALTER VIEW v1 AS SELECT 2 FROM t2
-# Connection default
+connection default;
DROP TABLE t1, t2;
DROP VIEW v1;
+disconnect con2;
+disconnect con3;
#
# Bug#11815600 [ERROR] INNODB COULD NOT FIND INDEX PRIMARY
# KEY NO 0 FOR TABLE IN ERROR LOG
#
DROP TABLE IF EXISTS t1;
-# Connection default
+connect con1,localhost,root;
+connection default;
CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1, 12345);
START TRANSACTION;
SELECT * FROM t1;
id value
1 12345
-# Connection con1
+connection con1;
SET lock_wait_timeout=1;
ALTER TABLE t1 ADD INDEX idx(value);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE t1 ADD INDEX idx(value);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
SELECT * FROM t1;
id value
1 12345
COMMIT;
DROP TABLE t1;
+disconnect con1;
set global innodb_lock_wait_timeout=@old_innodb_lock_wait_timeout;
diff --git a/mysql-test/r/innodb_mysql_lock2.result b/mysql-test/r/innodb_mysql_lock2.result
index 54203c140a2..df97b32a41c 100644
--- a/mysql-test/r/innodb_mysql_lock2.result
+++ b/mysql-test/r/innodb_mysql_lock2.result
@@ -17,6 +17,8 @@ select @@session.tx_isolation;
REPEATABLE-READ
# Prepare playground by creating tables, views,
# routines and triggers used in tests.
+connect con1, localhost, root,,;
+connection default;
drop table if exists t0, t1, t2, t3, t4, t5;
drop view if exists v1, v2;
drop procedure if exists p1;
@@ -179,6 +181,7 @@ end|
#
# No locks are necessary as this statement won't be written
# to the binary log and InnoDB supports snapshots.
+connection default;
Success: 'select * from t1' doesn't take row locks on 't1'.
#
# 1.2 Multi-UPDATE statement.
@@ -186,11 +189,13 @@ Success: 'select * from t1' doesn't take row locks on 't1'.
# Has to take shared locks on rows in the table being read as this
# statement will be written to the binary log and therefore should
# be serialized with concurrent statements.
+connection default;
Success: 'update t2, t1 set j= j - 1 where i = j' takes shared row locks on 't1'.
#
# 1.3 Multi-DELETE statement.
#
# The above is true for this statement as well.
+connection default;
Success: 'delete t2 from t1, t2 where i = j' takes shared row locks on 't1'.
#
# 1.4 DESCRIBE statement.
@@ -198,12 +203,15 @@ Success: 'delete t2 from t1, t2 where i = j' takes shared row locks on 't1'.
# This statement does not really read data from the
# target table and thus does not take any lock on it.
# We check this for completeness of coverage.
+connection default;
Success: 'describe t1' doesn't take row locks on 't1'.
#
# 1.5 SHOW statements.
#
# The above is true for SHOW statements as well.
+connection default;
Success: 'show create table t1' doesn't take row locks on 't1'.
+connection default;
Success: 'show keys from t1' doesn't take row locks on 't1'.
#
# 2. Statements which read tables through subqueries.
@@ -218,6 +226,7 @@ Success: 'show keys from t1' doesn't take row locks on 't1'.
# But in practice InnoDB does locking reads for all statements
# other than SELECT (unless it is a READ-COMITTED mode or
# innodb_locks_unsafe_for_binlog is ON).
+connection default;
Success: 'call p1((select i + 5 from t1 where i = 1))' takes shared row locks on 't1'.
#
# 2.2 CREATE TABLE with a subquery.
@@ -225,25 +234,30 @@ Success: 'call p1((select i + 5 from t1 where i = 1))' takes shared row locks on
# Has to take shared locks on rows in the table being read as
# this statement is written to the binary log and therefore
# should be serialized with concurrent statements.
+connection default;
Success: 'create table t0 engine=innodb select * from t1' takes shared row locks on 't1'.
drop table t0;
+connection default;
Success: 'create table t0 engine=innodb select j from t2 where j in (select i from t1)' takes shared row locks on 't1'.
drop table t0;
#
# 2.3 DELETE with a subquery.
#
# The above is true for this statement as well.
+connection default;
Success: 'delete from t2 where j in (select i from t1)' takes shared row locks on 't1'.
#
# 2.4 MULTI-DELETE with a subquery.
#
# Same is true for this statement as well.
+connection default;
Success: 'delete t2 from t3, t2 where k = j and j in (select i from t1)' takes shared row locks on 't1'.
#
# 2.5 DO with a subquery.
#
# In theory should not take row locks as it is not logged.
# In practice InnoDB takes shared row locks.
+connection default;
Success: 'do (select i from t1 where i = 1)' takes shared row locks on 't1'.
#
# 2.6 INSERT with a subquery.
@@ -251,18 +265,23 @@ Success: 'do (select i from t1 where i = 1)' takes shared row locks on 't1'.
# Has to take shared locks on rows in the table being read as
# this statement is written to the binary log and therefore
# should be serialized with concurrent statements.
+connection default;
Success: 'insert into t2 select i+5 from t1' takes shared row locks on 't1'.
+connection default;
Success: 'insert into t2 values ((select i+5 from t1 where i = 4))' takes shared row locks on 't1'.
#
# 2.7 LOAD DATA with a subquery.
#
# The above is true for this statement as well.
+connection default;
Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1)' takes shared row locks on 't1'.
#
# 2.8 REPLACE with a subquery.
#
# Same is true for this statement as well.
+connection default;
Success: 'replace into t2 select i+5 from t1' takes shared row locks on 't1'.
+connection default;
Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' takes shared row locks on 't1'.
#
# 2.9 SELECT with a subquery.
@@ -273,6 +292,7 @@ Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' takes share
#
# Also serves as a test case for bug #46947 "Embedded SELECT
# without FOR UPDATE is causing a lock".
+connection default;
Success: 'select * from t2 where j in (select i from t1)' doesn't take row locks on 't1'.
#
# 2.10 SET with a subquery.
@@ -280,6 +300,7 @@ Success: 'select * from t2 where j in (select i from t1)' doesn't take row locks
# In theory should not require locking as it is not written
# to the binary log. In practice InnoDB acquires shared row
# locks.
+connection default;
Success: 'set @a:= (select i from t1 where i = 1)' takes shared row locks on 't1'.
#
# 2.11 SHOW with a subquery.
@@ -287,7 +308,9 @@ Success: 'set @a:= (select i from t1 where i = 1)' takes shared row locks on 't1
# Similarly to the previous case, in theory should not require locking
# as it is not written to the binary log. In practice InnoDB
# acquires shared row locks.
+connection default;
Success: 'show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1)' takes shared row locks on 't1'.
+connection default;
Success: 'show columns from t2 where (select i from t1 where i = 1)' takes shared row locks on 't1'.
#
# 2.12 UPDATE with a subquery.
@@ -295,11 +318,13 @@ Success: 'show columns from t2 where (select i from t1 where i = 1)' takes share
# Has to take shared locks on rows in the table being read as
# this statement is written to the binary log and therefore
# should be serialized with concurrent statements.
+connection default;
Success: 'update t2 set j= j-10 where j in (select i from t1)' takes shared row locks on 't1'.
#
# 2.13 MULTI-UPDATE with a subquery.
#
# Same is true for this statement as well.
+connection default;
Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' takes shared row locks on 't1'.
#
# 3. Statements which read tables through a view.
@@ -310,9 +335,13 @@ Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' take
# Since this statement is not written to the binary log
# and old version of rows are accessible thanks to MVCC,
# no locking is necessary.
+connection default;
Success: 'select * from v1' doesn't take row locks on 't1'.
+connection default;
Success: 'select * from v2' doesn't take row locks on 't1'.
+connection default;
Success: 'select * from t2 where j in (select i from v1)' doesn't take row locks on 't1'.
+connection default;
Success: 'select * from t3 where k in (select j from v2)' doesn't take row locks on 't1'.
#
# 3.2 Statements which modify a table and use views.
@@ -320,9 +349,13 @@ Success: 'select * from t3 where k in (select j from v2)' doesn't take row locks
# Since such statements are going to be written to the binary
# log they need to be serialized against concurrent statements
# and therefore should take shared row locks on data read.
+connection default;
Success: 'update t2 set j= j-10 where j in (select i from v1)' takes shared row locks on 't1'.
+connection default;
Success: 'update t3 set k= k-10 where k in (select j from v2)' takes shared row locks on 't1'.
+connection default;
Success: 'update t2, v1 set j= j-10 where j = i' takes shared row locks on 't1'.
+connection default;
Success: 'update v2 set j= j-10 where j = 3' takes shared row locks on 't1'.
#
# 4. Statements which read tables through stored functions.
@@ -338,7 +371,9 @@ Success: 'update v2 set j= j-10 where j = 3' takes shared row locks on 't1'.
# However in practice innodb takes strong lock on tables
# being selected from within SF, when SF is called from
# non SELECT statements like 'set' statement below.
+connection default;
Success: 'select f1()' doesn't take row locks on 't1'.
+connection default;
Success: 'set @a:= f1()' takes shared row locks on 't1'.
#
# 4.2 INSERT (or other statement which modifies data) with
@@ -349,6 +384,7 @@ Success: 'set @a:= f1()' takes shared row locks on 't1'.
# be serialized with concurrent statements affecting the data
# it uses. Therefore it should take row locks on the data
# it reads.
+connection default;
Success: 'insert into t2 values (f1() + 5)' takes shared row locks on 't1'.
#
# 4.3 SELECT/SET with a stored function which
@@ -358,7 +394,9 @@ Success: 'insert into t2 values (f1() + 5)' takes shared row locks on 't1'.
# it should be serialized with concurrent statements affecting
# the data it uses. Hence, row locks on the data read
# should be taken.
+connection default;
Success: 'select f2()' takes shared row locks on 't1'.
+connection default;
Success: 'set @a:= f2()' takes shared row locks on 't1'.
#
# 4.4. SELECT/SET with a stored function which does not
@@ -371,9 +409,13 @@ Success: 'set @a:= f2()' takes shared row locks on 't1'.
# However in practice innodb takes strong lock on tables
# being selected from within SF, when SF is called from
# non SELECT statements like 'set' statement below.
+connection default;
Success: 'select f3()' doesn't take row locks on 't1'.
+connection default;
Success: 'set @a:= f3()' takes shared row locks on 't1'.
+connection default;
Success: 'select f4()' doesn't take row locks on 't1'.
+connection default;
Success: 'set @a:= f4()' takes shared row locks on 't1'.
#
# 4.5. INSERT (or other statement which modifies data) with
@@ -385,7 +427,9 @@ Success: 'set @a:= f4()' takes shared row locks on 't1'.
# be serialized with concurrent statements affecting data it
# uses. Therefore it should take row locks on the data
# it reads.
+connection default;
Success: 'insert into t2 values (f3() + 5)' takes shared row locks on 't1'.
+connection default;
Success: 'insert into t2 values (f4() + 6)' takes shared row locks on 't1'.
#
# 4.6 SELECT/SET which uses a stored function with
@@ -394,7 +438,9 @@ Success: 'insert into t2 values (f4() + 6)' takes shared row locks on 't1'.
# Since call to such function is written to the binary log
# it should be serialized with concurrent statements.
# Hence reads should take row locks.
+connection default;
Success: 'select f5()' takes shared row locks on 't1'.
+connection default;
Success: 'set @a:= f5()' takes shared row locks on 't1'.
#
# 4.7 SELECT/SET which uses a stored function which
@@ -407,9 +453,13 @@ Success: 'set @a:= f5()' takes shared row locks on 't1'.
# However in practice innodb takes strong lock on tables
# being selected from within SF, when SF is called from
# non SELECT statements like 'set' statement below.
+connection default;
Success: 'select f6()' doesn't take row locks on 't1'.
+connection default;
Success: 'set @a:= f6()' takes shared row locks on 't1'.
+connection default;
Success: 'select f7()' doesn't take row locks on 't1'.
+connection default;
Success: 'set @a:= f7()' takes shared row locks on 't1'.
#
# 4.8 INSERT which uses stored function which
@@ -420,7 +470,9 @@ Success: 'set @a:= f7()' takes shared row locks on 't1'.
# should be serialized with concurrent statements affecting
# the data it uses. Therefore it should take row locks on
# the rows it reads.
+connection default;
Success: 'insert into t3 values (f6() + 5)' takes shared row locks on 't1'.
+connection default;
Success: 'insert into t3 values (f7() + 5)' takes shared row locks on 't1'.
#
# 4.9 SELECT which uses a stored function which
@@ -429,7 +481,9 @@ Success: 'insert into t3 values (f7() + 5)' takes shared row locks on 't1'.
# Since a call to such function is written to the binary log
# it should be serialized with concurrent statements.
# Hence, reads should take row locks.
+connection default;
Success: 'select f8()' takes shared row locks on 't1'.
+connection default;
Success: 'select f9()' takes shared row locks on 't1'.
#
# 4.10 SELECT which uses stored function which doesn't modify
@@ -438,6 +492,7 @@ Success: 'select f9()' takes shared row locks on 't1'.
#
# Calls to such functions won't get into the binary
# log and thus don't need to acquire row locks.
+connection default;
Success: 'select f10()' doesn't take row locks on 't1'.
#
# 4.11 INSERT which uses a stored function which doesn't modify
@@ -447,6 +502,7 @@ Success: 'select f10()' doesn't take row locks on 't1'.
# Since such statement is written to the binary log, it should
# be serialized with concurrent statements affecting the data it
# uses. Therefore it should take row locks on data it reads.
+connection default;
Success: 'insert into t2 values (f10() + 5)' takes shared row locks on 't1'.
#
# 4.12 SELECT which uses a stored function which modifies
@@ -456,6 +512,7 @@ Success: 'insert into t2 values (f10() + 5)' takes shared row locks on 't1'.
# Since a call to such function is written to the binary log
# it should be serialized from concurrent statements.
# Hence, reads should take row locks.
+connection default;
Success: 'select f11()' takes shared row locks on 't1'.
#
# 4.13 SELECT that reads a table through a subquery passed
@@ -466,6 +523,7 @@ Success: 'select f11()' takes shared row locks on 't1'.
# binary log, values of its parameters are written as literals.
# So there is no need to acquire row locks on rows used in
# the subquery.
+connection default;
Success: 'select f12((select i+10 from t1 where i=1))' doesn't take row locks on 't1'.
#
# 4.14 INSERT that reads a table via a subquery passed
@@ -475,6 +533,7 @@ Success: 'select f12((select i+10 from t1 where i=1))' doesn't take row locks on
# Since this statement is written to the binary log it should
# be serialized with concurrent statements affecting the data it
# uses. Therefore it should take row locks on the data it reads.
+connection default;
Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' takes shared row locks on 't1'.
#
# 5. Statements that read tables through stored procedures.
@@ -485,6 +544,7 @@ Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' takes sh
# Since neither this statement nor its components are
# written to the binary log, there is no need to take
# row locks on the data it reads.
+connection default;
Success: 'call p2(@a)' doesn't take row locks on 't1'.
#
# 5.2 Function that modifies data and uses CALL,
@@ -493,6 +553,7 @@ Success: 'call p2(@a)' doesn't take row locks on 't1'.
# Since a call to such function is written to the binary
# log, it should be serialized with concurrent statements.
# Hence, in this case reads should take row locks on data.
+connection default;
Success: 'select f14()' takes shared row locks on 't1'.
#
# 5.3 SELECT that calls a function that doesn't modify data and
@@ -500,6 +561,7 @@ Success: 'select f14()' takes shared row locks on 't1'.
#
# Calls to such functions won't get into the binary
# log and thus don't need to acquire row locks.
+connection default;
Success: 'select f15()' doesn't take row locks on 't1'.
#
# 5.4 INSERT which calls function which doesn't modify data and
@@ -508,6 +570,7 @@ Success: 'select f15()' doesn't take row locks on 't1'.
# Since such statement is written to the binary log it should
# be serialized with concurrent statements affecting data it
# uses. Therefore it should take row locks on data it reads.
+connection default;
Success: 'insert into t2 values (f15()+5)' takes shared row locks on 't1'.
#
# 6. Statements that use triggers.
@@ -519,30 +582,35 @@ Success: 'insert into t2 values (f15()+5)' takes shared row locks on 't1'.
# be serialized with concurrent statements affecting the data
# it uses. Therefore, it should take row locks on the data
# it reads.
+connection default;
Success: 'insert into t4 values (2)' takes shared row locks on 't1'.
#
# 6.2 Statement invoking a trigger that reads table through
# a subquery in a control construct.
#
# The above is true for this statement as well.
+connection default;
Success: 'update t4 set l= 2 where l = 1' takes shared row locks on 't1'.
#
# 6.3 Statement invoking a trigger that reads a table through
# a view.
#
# And for this statement.
+connection default;
Success: 'delete from t4 where l = 1' takes shared row locks on 't1'.
#
# 6.4 Statement invoking a trigger that reads a table through
# a stored function.
#
# And for this statement.
+connection default;
Success: 'insert into t5 values (2)' takes shared row locks on 't1'.
#
# 6.5 Statement invoking a trigger that reads a table through
# stored procedure.
#
# And for this statement.
+connection default;
Success: 'update t5 set l= 2 where l = 1' takes shared row locks on 't1'.
# Clean-up.
drop function f1;
@@ -564,10 +632,13 @@ drop view v1, v2;
drop procedure p1;
drop procedure p2;
drop table t1, t2, t3, t4, t5;
+disconnect con1;
#
# Test for bug#51263 "Deadlock between transactional SELECT
# and ALTER TABLE ... REBUILD PARTITION".
#
+connect con1,localhost,root,,test,,;
+connection default;
drop table if exists t1, t2;
create table t1 (i int auto_increment not null primary key) engine=innodb;
create table t2 (i int) engine=innodb;
@@ -575,10 +646,10 @@ insert into t1 values (1), (2), (3), (4), (5);
begin;
# Acquire SR metadata lock on t1 and LOCK_S row-locks on its rows.
insert into t2 select count(*) from t1;
-# Switching to connection 'con1'.
+connection con1;
# Sending:
alter table t1 add column j int;
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER is blocked because it tries to upgrade SNW
# metadata lock to X lock.
# It should not be blocked during copying data to new version of
@@ -593,9 +664,9 @@ insert into t1 values (6);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Unblock ALTER TABLE.
commit;
-# Switching to connection 'con1'.
+connection con1;
# Reaping ALTER TABLE.
-# Switching to connection 'default'.
+connection default;
#
# Now test for scenario in which bug was reported originally.
#
@@ -613,10 +684,10 @@ i
3
4
5
-# Switching to connection 'con1'.
+connection con1;
# Sending:
alter table t1 rebuild partition p0;
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER is blocked because of active SR lock.
# The below statement should succeed as transaction
# has SR metadata lock on t1 and only going to read
@@ -624,8 +695,9 @@ alter table t1 rebuild partition p0;
insert into t2 select count(*) from t1;
# Unblock ALTER TABLE.
commit;
-# Switching to connection 'con1'.
+connection con1;
# Reaping ALTER TABLE.
-# Switching to connection 'default'.
+connection default;
+disconnect con1;
# Clean-up.
drop tables t1, t2;
diff --git a/mysql-test/r/innodb_mysql_sync.result b/mysql-test/r/innodb_mysql_sync.result
index 478b0109816..0b9a17adf4d 100644
--- a/mysql-test/r/innodb_mysql_sync.result
+++ b/mysql-test/r/innodb_mysql_sync.result
@@ -5,23 +5,25 @@
DROP TABLE IF EXISTS t1;
# Create InnoDB table
CREATE TABLE t1 (id INT) engine=innodb;
-# Connection 1
+connect con2, localhost, root;
# Start optimizing table
+connection default;
SET DEBUG_SYNC='ha_admin_try_alter SIGNAL optimize_started WAIT_FOR table_altered';
OPTIMIZE TABLE t1;
-# Connection 2
# Change table to engine=memory
+connection con2;
SET DEBUG_SYNC='now WAIT_FOR optimize_started';
ALTER TABLE t1 engine=memory;
SET DEBUG_SYNC='now SIGNAL table_altered';
-# Connection 1
# Complete optimization
+connection default;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize error Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY
test.t1 optimize status Operation failed
Warnings:
Error 1030 Got error -1 "Internal error < 0 (Not system error)" from storage engine MEMORY
+disconnect con2;
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
#
@@ -29,16 +31,18 @@ SET DEBUG_SYNC='RESET';
# OPTIMIZE TABLE
#
DROP TABLE IF EXISTS t1;
+connect con1, localhost, root;
+connection default;
CREATE TABLE t1(a INT) ENGINE= InnoDB;
-# Connection con1
+connection con1;
SET DEBUG_SYNC= "ha_admin_open_ltable SIGNAL opening WAIT_FOR dropped";
# Sending:
OPTIMIZE TABLE t1;
-# Connection default
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR opening";
DROP TABLE t1;
SET DEBUG_SYNC= "now SIGNAL dropped";
-# Connection con1
+connection con1;
# Reaping: OPTIMIZE TABLE t1
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
@@ -46,7 +50,8 @@ test.t1 optimize error Table 'test.t1' doesn't exist
test.t1 optimize status Operation failed
Warnings:
Error 1146 Table 'test.t1' doesn't exist
-# Connection default
+connection default;
+disconnect con1;
SET DEBUG_SYNC= "RESET";
#
# Bug#53757 assert in mysql_truncate_by_delete
@@ -55,10 +60,12 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1(a INT) Engine=InnoDB;
CREATE TABLE t2(id INT);
INSERT INTO t1 VALUES (1), (2);
+connect con1, localhost, root;
INSERT INTO t2 VALUES(connection_id());
SET DEBUG_SYNC= "open_and_process_table SIGNAL opening WAIT_FOR killed";
# Sending: (not reaped since connection is killed later)
TRUNCATE t1;
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR opening";
SELECT ((@id := id) - id) FROM t2;
((@id := id) - id)
@@ -66,6 +73,7 @@ SELECT ((@id := id) - id) FROM t2;
KILL @id;
SET DEBUG_SYNC= "now SIGNAL killed";
DROP TABLE t1, t2;
+disconnect con1;
SET DEBUG_SYNC= "RESET";
#
# Bug#58933 Assertion `thd- >is_error()' fails on shutdown with ongoing
@@ -74,15 +82,15 @@ SET DEBUG_SYNC= "RESET";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2);
-# Connection con1
+connect con1,localhost,root;
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
# Sending:
OPTIMIZE TABLE t1;
-# Connection default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR waiting';
KILL QUERY ID;
SET DEBUG_SYNC= 'now SIGNAL killed';
-# Connection con1
+connection con1;
# Reaping: OPTIMIZE TABLE t1
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
@@ -90,24 +98,27 @@ test.t1 optimize error Query execution was interrupted
test.t1 optimize status Operation failed
Warnings:
Error 1317 Query execution was interrupted
-# Connection default
+connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
+disconnect con1;
#
# Bug#42230 during add index, cannot do queries on storage engines
# that implement add_index
#
DROP DATABASE IF EXISTS db1;
DROP TABLE IF EXISTS t1;
+connect con1,localhost,root;
+connect con2,localhost,root;
# Test 1: Secondary index, should not block reads (original test case).
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
INSERT INTO db1.t1(value) VALUES (1), (2);
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE db1.t1 ADD INDEX(value);
-# Connection con1
+connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
USE db1;
SELECT * FROM t1;
@@ -115,7 +126,7 @@ id value
1 1
2 2
SET DEBUG_SYNC= "now SIGNAL query";
-# Connection default
+connection default;
# Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
DROP DATABASE db1;
# Test 2: Primary index (implicit), should block writes.
@@ -123,51 +134,53 @@ CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD UNIQUE INDEX(a), LOCK=SHARED;
-# Connection con1
+connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
USE test;
SELECT * FROM t1;
a b
# Sending:
UPDATE t1 SET a=NULL;
-# Connection con2
+connection con2;
# Waiting for SELECT to be blocked by the metadata lock on t1
SET DEBUG_SYNC= "now SIGNAL query";
-# Connection default
+connection default;
# Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
-# Connection con1
+connection con1;
# Reaping: UPDATE t1 SET a=NULL
# Test 3: Primary index (explicit), should block writes.
-# Connection default
+connection default;
ALTER TABLE t1 DROP INDEX a;
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD PRIMARY KEY (a), LOCK=SHARED;
-# Connection con1
+connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
a b
# Sending:
UPDATE t1 SET a=NULL;
-# Connection con2
+connection con2;
# Waiting for SELECT to be blocked by the metadata lock on t1
SET DEBUG_SYNC= "now SIGNAL query";
-# Connection default
+connection default;
# Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
-# Connection con1
+connection con1;
# Reaping: UPDATE t1 SET a=NULL
# Test 4: Secondary unique index, should not block reads.
-# Connection default
+connection default;
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
# Sending:
ALTER TABLE t1 ADD UNIQUE (b);
-# Connection con1
+connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
a b
SET DEBUG_SYNC= "now SIGNAL query";
-# Connection default
+connection default;
# Reaping: ALTER TABLE t1 ADD UNIQUE (b)
+disconnect con1;
+disconnect con2;
SET DEBUG_SYNC= "RESET";
DROP TABLE t1;
#
@@ -177,7 +190,7 @@ DROP TABLE t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
INSERT INTO t1 VALUES (1, 12345), (2, 23456);
-# Connection con1
+connect con1,localhost,root;
SET SESSION debug_dbug= "+d,alter_table_rollback_new_index";
ALTER TABLE t1 ADD PRIMARY KEY(a);
ERROR HY000: Unknown error
@@ -185,12 +198,13 @@ SELECT * FROM t1;
a b
1 12345
2 23456
-# Connection default
+connection default;
SELECT * FROM t1;
a b
1 12345
2 23456
DROP TABLE t1;
+disconnect con1;
#
# Bug#13417754 ASSERT IN ROW_DROP_DATABASE_FOR_MYSQL DURING DROP SCHEMA
#
@@ -198,25 +212,29 @@ DROP TABLE IF EXISTS t1;
DROP DATABASE IF EXISTS db1;
CREATE TABLE t1(a int) engine=InnoDB;
CREATE DATABASE db1;
-# Connection con1
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
SET DEBUG_SYNC= 'after_innobase_rename_table SIGNAL locked WAIT_FOR continue';
# Sending:
ALTER TABLE t1 RENAME db1.t1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# DROP DATABASE db1 should now be blocked by ALTER TABLE
# Sending:
DROP DATABASE db1;
-# Connection default
+connection default;
# Check that DROP DATABASE is blocked by IX lock on db1
# Resume ALTER TABLE
SET DEBUG_SYNC= 'now SIGNAL continue';
-# Connection con1
+connection con1;
# Reaping: ALTER TABLE t1 RENAME db1.t1;
-# Connection con2
+connection con2;
# Reaping: DROP DATABASE db1
-# Connection default;
+connection default;
SET DEBUG_SYNC= 'RESET';
+disconnect con1;
+disconnect con2;
#
# WL#5534 Online ALTER, Phase 1
#
@@ -226,18 +244,19 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT PRIMARY KEY, b INT) engine=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
SET DEBUG_SYNC= 'RESET';
+connect con1, localhost, root;
SET SESSION lock_wait_timeout= 1;
#
# 1: In-place + writes blocked.
#
-# Connection default
+connection default;
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
SET DEBUG_SYNC= 'alter_table_inplace_before_commit SIGNAL beforecommit WAIT_FOR continue3';
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue4';
# Sending:
ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= SHARED;
-# Connection con1;
+connection con1;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
# At this point, neither reads nor writes should be blocked.
SELECT * FROM t1;
@@ -267,7 +286,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (6,6);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL continue4';
-# Connection default
+connection default;
# Reaping ALTER TABLE ...
SET DEBUG_SYNC= 'RESET';
DELETE FROM t1 WHERE a= 3;
@@ -279,7 +298,7 @@ SET DEBUG_SYNC= 'alter_table_copy_after_lock_upgrade SIGNAL upgraded WAIT_FOR co
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue3';
# Sending:
ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= COPY, LOCK= SHARED;
-# Connection con1;
+connection con1;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
# At this point, neither reads nor writes should be blocked.
SELECT * FROM t1;
@@ -305,7 +324,7 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (5,5);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL continue3';
-# Connection default
+connection default;
# Reaping ALTER TABLE ...
Warnings:
Note 1831 Duplicate index 'i2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
@@ -318,14 +337,14 @@ DELETE FROM t1 WHERE a= 3;
#
# 4: In-place + reads and writes blocked.
#
-# Connection default
+connection default;
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
SET DEBUG_SYNC= 'alter_table_inplace_before_commit SIGNAL beforecommit WAIT_FOR continue3';
SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue4';
# Sending:
ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE;
-# Connection con1;
+connection con1;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
# At this point, neither reads nor writes should be blocked.
SELECT * FROM t1;
@@ -355,17 +374,20 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t1 VALUES (6,6);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL continue4';
-# Connection default
+connection default;
# Reaping ALTER TABLE ...
Warnings:
Note 1831 Duplicate index 'i4' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
SET DEBUG_SYNC= 'RESET';
+connection default;
+disconnect con1;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
#
#BUG#13975225:ONLINE OPTIMIZE TABLE FOR INNODB TABLES
#
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_downgrade SIGNAL downgraded WAIT_FOR continue';
+connect con1,localhost,root,,;
#Setting up INNODB table.
CREATE TABLE t1(fld1 INT, fld2 INT, fld3 INT) ENGINE= INNODB;
INSERT INTO t1 VALUES (155, 45, 55);
@@ -542,5 +564,6 @@ ALTER TABLE t1 FORCE;
connection con1;
SET DEBUG_SYNC= 'now WAIT_FOR rebuild';
connection default;
+disconnect con1;
SET DEBUG_SYNC= 'RESET';
DROP TABLE t1;
diff --git a/mysql-test/r/insert_notembedded.result b/mysql-test/r/insert_notembedded.result
index 41e31508fe0..d7ec70d36f8 100644
--- a/mysql-test/r/insert_notembedded.result
+++ b/mysql-test/r/insert_notembedded.result
@@ -8,6 +8,8 @@ ERROR HY000: 'test.v1' is not BASE TABLE
drop table t1;
drop view v1;
CREATE DATABASE meow;
+connect root,localhost,root,,meow;
+connection root;
CREATE TABLE table_target ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
CREATE TABLE table_target2 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
CREATE TABLE table_target3 ( mexs_id CHAR(8), messzeit TIMESTAMP, PRIMARY KEY (mexs_id));
@@ -27,6 +29,8 @@ GRANT SELECT ON view_stations TO user20989@localhost;
GRANT SELECT ON table_target TO user20989@localhost;
GRANT SELECT ON table_target2 TO user20989@localhost;
GRANT INSERT,DELETE,SELECT ON view_target3 TO user20989@localhost;
+connect user20989,localhost,user20989,,meow;
+connection user20989;
REPLACE INTO table_target
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
FROM table_source
@@ -51,9 +55,13 @@ ON table_source.id = stations.icao
LEFT JOIN view_target3 AS old
USING (mexs_id);
ERROR HY000: View 'meow.view_target3' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+connection root;
+disconnect user20989;
GRANT INSERT,DELETE ON table_target TO user20989@localhost;
GRANT INSERT,DELETE,SELECT ON view_target2 TO user20989@localhost;
GRANT INSERT,DELETE,SELECT ON table_target3 TO user20989@localhost;
+connect user20989,localhost,user20989,,meow;
+connection user20989;
REPLACE INTO table_target
SELECT stations.mexs_id AS mexs_id, datetime AS messzeit
FROM table_source
@@ -86,6 +94,8 @@ INNER JOIN view_stations AS stations
ON table_source.id = stations.icao
LEFT JOIN view_target3 AS old
USING (mexs_id);
+connection root;
+disconnect user20989;
SELECT * FROM table_target;
mexs_id messzeit
87654321 2006-07-12 07:50:00
@@ -106,24 +116,34 @@ DROP TABLE table_target3;
DROP VIEW view_target2;
DROP VIEW view_target3;
DROP USER user20989@localhost;
+disconnect root;
+connection default;
DROP DATABASE meow;
connection: default
set low_priority_updates=1;
drop table if exists t1;
create table t1 (a int, b int, unique key t1$a (a));
lock table t1 read;
+connect update,localhost,root,,;
+connection update;
connection: update
set low_priority_updates=1;
show variables like 'low_priority_updates';
Variable_name Value
low_priority_updates ON
insert into t1 values (1, 2) ON DUPLICATE KEY UPDATE b = 2;;
+connection default;
+connect select,localhost,root,,;
connection: select
select * from t1;
a b
+connection default;
connection: default
select * from t1;
a b
+connection default;
+disconnect update;
+disconnect select;
unlock tables;
drop table t1;
set low_priority_updates=default;
diff --git a/mysql-test/r/ipv4_and_ipv6.result b/mysql-test/r/ipv4_and_ipv6.result
index f15aeba65fa..447c20536e2 100644
--- a/mysql-test/r/ipv4_and_ipv6.result
+++ b/mysql-test/r/ipv4_and_ipv6.result
@@ -20,6 +20,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'::1';
RENAME USER testuser@'::1' to testuser1@'::1';
SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
@@ -49,6 +52,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
diff --git a/mysql-test/r/ipv4_as_ipv6.result b/mysql-test/r/ipv4_as_ipv6.result
index 82bca393d71..b92b545da86 100644
--- a/mysql-test/r/ipv4_as_ipv6.result
+++ b/mysql-test/r/ipv4_as_ipv6.result
@@ -20,6 +20,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'127.0.0.1';
RENAME USER testuser@'127.0.0.1' to testuser1@'127.0.0.1';
SET PASSWORD FOR testuser1@'127.0.0.1' = PASSWORD ('9876');
@@ -49,6 +52,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:FFFF:127.0.0.1';
RENAME USER testuser@'0:0:0:0:0:FFFF:127.0.0.1' to testuser1@'0:0:0:0:0:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0:0:0:0:0:FFFF:127.0.0.1' = PASSWORD ('9876');
@@ -78,6 +84,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
RENAME USER testuser@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' to testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
@@ -107,6 +116,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1';
RENAME USER testuser@'0:0000:0000:0:0000:FFFF:127.0.0.1' to testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0:0000:0000:0:0000:FFFF:127.0.0.1' = PASSWORD ('9876');
@@ -136,6 +148,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'0::0000:FFFF:127.0.0.1';
RENAME USER testuser@'0::0000:FFFF:127.0.0.1' to testuser1@'0::0000:FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'0::0000:FFFF:127.0.0.1' = PASSWORD ('9876');
@@ -166,6 +181,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'::FFFF:127.0.0.1';
RENAME USER testuser@'::FFFF:127.0.0.1' to testuser1@'::FFFF:127.0.0.1';
SET PASSWORD FOR testuser1@'::FFFF:127.0.0.1' = PASSWORD ('9876');
diff --git a/mysql-test/r/ipv6.result b/mysql-test/r/ipv6.result
index 1ff51fcc831..1540b4825e5 100644
--- a/mysql-test/r/ipv6.result
+++ b/mysql-test/r/ipv6.result
@@ -20,6 +20,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'::1';
RENAME USER testuser@'::1' to testuser1@'::1';
SET PASSWORD FOR testuser1@'::1' = PASSWORD ('9876');
@@ -50,6 +53,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'0000:0000:0000:0000:0000:0000:0000:0001';
RENAME USER testuser@'0000:0000:0000:0000:0000:0000:0000:0001' to testuser1@'0000:0000:0000:0000:0000:0000:0000:0001';
SET PASSWORD FOR testuser1@'0000:0000:0000:0000:0000:0000:0000:0001' = PASSWORD ('9876');
@@ -79,6 +85,9 @@ SELECT current_user();
current_user()
root@localhost
SHOW PROCESSLIST;
+connect con1, $IPv6, root, , test, $MASTER_MYPORT;
+connection default;
+disconnect con1;
REVOKE ALL ON test.* FROM testuser@'0:0:0:0:0:0:0:1';
RENAME USER testuser@'0:0:0:0:0:0:0:1' to testuser1@'0:0:0:0:0:0:0:1';
SET PASSWORD FOR testuser1@'0:0:0:0:0:0:0:1' = PASSWORD ('9876');
diff --git a/mysql-test/r/kill-2.result b/mysql-test/r/kill-2.result
index c2bcc979441..daaba2c092a 100644
--- a/mysql-test/r/kill-2.result
+++ b/mysql-test/r/kill-2.result
@@ -2,6 +2,8 @@
# MDEV-6896 kill user command cause MariaDB crash!
#
create user foo@'127.0.0.1';
+connect con1,127.0.0.1,foo,,;
+connection default;
select user from information_schema.processlist;
user
foo
diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result
index d40c4ee758c..0f01bf3f714 100644
--- a/mysql-test/r/kill.result
+++ b/mysql-test/r/kill.result
@@ -9,11 +9,18 @@ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION BEGIN END;
KILL tid;
RETURN (SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE ID = tid);
END|
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
+connection con2;
+connection con1;
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read';
+connection con2;
SET DEBUG_SYNC='now WAIT_FOR con1_read';
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
SET DEBUG_SYNC = 'RESET';
+connection con1;
SELECT 1;
Got one of the listed errors
SELECT 1;
@@ -22,16 +29,23 @@ SELECT 1;
SELECT @id != CONNECTION_ID();
@id != CONNECTION_ID()
1
+connection con2;
SELECT 4;
4
4
+connection default;
KILL (SELECT COUNT(*) FROM mysql.user);
ERROR 42000: KILL does not support subqueries or stored functions.
+connection con1;
+connection con2;
+connection con1;
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
SET DEBUG_SYNC= 'before_do_command_net_read SIGNAL con1_read WAIT_FOR kill';
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR con1_read';
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
SET DEBUG_SYNC = 'RESET';
+connection con1;
SELECT 1;
Got one of the listed errors
SELECT 1;
@@ -40,9 +54,11 @@ SELECT 1;
SELECT @id != CONNECTION_ID();
@id != CONNECTION_ID()
1
+connection con2;
SELECT 4;
4
4
+connection default;
CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT);
CREATE TABLE t2 (id INT UNSIGNED NOT NULL);
INSERT INTO t1 VALUES
@@ -52,25 +68,36 @@ INSERT INTO t1 VALUES
(0),(0),(0),(0),(0),(0),(0),(0), (0),(0),(0),(0),(0),(0),(0),(0);
INSERT t1 SELECT 0 FROM t1 AS a1, t1 AS a2 LIMIT 4032;
INSERT INTO t2 SELECT id FROM t1;
+connection con1;
+connection con2;
+connection con1;
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync';
SELECT id FROM t1 WHERE id IN
(SELECT DISTINCT a.id FROM t2 a, t2 b, t2 c, t2 d
GROUP BY ACOS(1/a.id), b.id, c.id, d.id
HAVING a.id BETWEEN 10 AND 20);
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL @id;
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+connection con1;
Got one of the listed errors
SELECT 1;
1
1
+connection default;
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1, t2;
+connection con1;
+connection con2;
+connection con1;
SET DEBUG_SYNC= 'before_acos_function SIGNAL in_sync WAIT_FOR kill';
SELECT ACOS(0);
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ACOS(0)
1.5707963267948966
SELECT 1;
@@ -79,6 +106,7 @@ SELECT 1;
SELECT @id = CONNECTION_ID();
@id = CONNECTION_ID()
1
+connection default;
SET DEBUG_SYNC = 'RESET';
CREATE TABLE t1 (f1 INT);
CREATE FUNCTION bug27563() RETURNS INT(11)
@@ -89,40 +117,58 @@ DECLARE CONTINUE HANDLER FOR SQLEXCEPTION SET @a:= 'exception';
SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
RETURN 1;
END|
+connection con1;
+connection con2;
+connection con1;
INSERT INTO t1 VALUES (bug27563());
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1
+connection default;
SET DEBUG_SYNC = 'RESET';
INSERT INTO t1 VALUES(0);
+connection con1;
UPDATE t1 SET f1= bug27563();
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1
0
+connection default;
SET DEBUG_SYNC = 'RESET';
INSERT INTO t1 VALUES(1);
+connection con1;
DELETE FROM t1 WHERE bug27563() IS NULL;
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1
0
1
+connection default;
SET DEBUG_SYNC = 'RESET';
+connection con1;
SELECT * FROM t1 WHERE f1= bug27563();
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1
0
1
+connection default;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION bug27563;
CREATE TABLE t2 (f2 INT);
@@ -134,9 +180,12 @@ INSERT INTO t2 VALUES(0);
SET DEBUG_SYNC= 'now SIGNAL in_sync WAIT_FOR kill';
INSERT INTO t2 VALUES(1);
END|
+connection con1;
INSERT INTO t1 VALUES(2),(3);
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ERROR 70100: Query execution was interrupted
SELECT * FROM t1;
f1
@@ -145,26 +194,34 @@ f1
SELECT * FROM t2;
f2
0
+connection default;
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1, t2;
+connection con1;
+connection con2;
+connection con1;
SET SESSION optimizer_search_depth=0;
SET DEBUG_SYNC= 'before_join_optimize SIGNAL in_sync';
PREPARE stmt FROM 'EXPLAIN SELECT * FROM t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16,t17,t18,t19,t20,t21,t22,t23,t24,t25,t26,t27,t28,t29,t30,t31,t32,t33,t34,t35,t36,t37,t38,t39,t40 WHERE a1=a2 AND a2=a3 AND a3=a4 AND a4=a5 AND a5=a6 AND a6=a7 AND a7=a8 AND a8=a9 AND a9=a10 AND a10=a11 AND a11=a12 AND a12=a13 AND a13=a14 AND a14=a15 AND a15=a16 AND a16=a17 AND a17=a18 AND a18=a19 AND a19=a20 AND a20=a21 AND a21=a22 AND a22=a23 AND a23=a24 AND a24=a25 AND a25=a26 AND a26=a27 AND a27=a28 AND a28=a29 AND a29=a30 AND a30=a31 AND a31=a32 AND a32=a33 AND a33=a34 AND a34=a35 AND a35=a36 AND a36=a37 AND a37=a38 AND a38=a39 AND a39=a40 ';
EXECUTE stmt;
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR in_sync';
KILL QUERY @id;
+connection con1;
ERROR 70100: Query execution was interrupted
+connection default;
SET DEBUG_SYNC = 'RESET';
#
# Bug#19723: kill of active connection yields different error code
# depending on platform.
#
-
-# Connection: con1.
+connection con1;
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
KILL @id;
ERROR 70100: Connection was killed
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR con1_end';
+connection con1;
# ER_SERVER_SHUTDOWN, CR_SERVER_GONE_ERROR, CR_SERVER_LOST,
# depending on the timing of close of the connection socket
SELECT 1;
@@ -175,6 +232,7 @@ SELECT 1;
SELECT @id != CONNECTION_ID();
@id != CONNECTION_ID()
1
+connection default;
SET DEBUG_SYNC = 'RESET';
#
# Additional test for WL#3726 "DDL locking for all metadata objects"
@@ -185,96 +243,99 @@ SET DEBUG_SYNC = 'RESET';
#
drop tables if exists t1, t2, t3;
create table t1 (i int primary key);
+connect blocker, localhost, root, , ;
+connect dml, localhost, root, , ;
+connect ddl, localhost, root, , ;
# Test for RENAME TABLE
-# Switching to connection 'blocker'
+connection blocker;
lock table t1 read;
-# Switching to connection 'ddl'
+connection ddl;
rename table t1 to t2;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
# Test for DROP TABLE
drop table t1;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
# Test for CREATE TRIGGER
create trigger t1_bi before insert on t1 for each row set @a:=1;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
#
# Tests for various kinds of ALTER TABLE
#
# Full-blown ALTER which should copy table
alter table t1 add column j int;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
# Two kinds of simple ALTER
alter table t1 rename to t2;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
alter table t1 disable keys;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
# Fast ALTER
alter table t1 alter column i set default 100;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
# Special case which is triggered only for MERGE tables.
-# Switching to connection 'blocker'
+connection blocker;
unlock tables;
create table t2 (i int primary key) engine=merge union=(t1);
lock tables t2 read;
-# Switching to connection 'ddl'
+connection ddl;
alter table t2 alter column i set default 100;
-# Switching to connection 'default'
+connection default;
kill query ID;
-# Switching to connection 'ddl'
+connection ddl;
ERROR 70100: Query execution was interrupted
# Test for DML waiting for meta-data lock
-# Switching to connection 'blocker'
+connection blocker;
unlock tables;
lock tables t1 read;
-# Switching to connection 'ddl'
+connection ddl;
truncate table t1;
-# Switching to connection 'dml'
+connection dml;
insert into t1 values (1);
-# Switching to connection 'default'
+connection default;
kill query ID2;
-# Switching to connection 'dml'
+connection dml;
ERROR 70100: Query execution was interrupted
-# Switching to connection 'blocker'
+connection blocker;
unlock tables;
-# Switching to connection 'ddl'
+connection ddl;
# Test for DML waiting for tables to be flushed
-# Switching to connection 'blocker'
+connection blocker;
lock tables t1 read;
-# Switching to connection 'ddl'
+connection ddl;
# Let us mark locked table t1 as old
flush tables;
-# Switching to connection 'dml'
+connection dml;
select * from t1;
-# Switching to connection 'default'
+connection default;
kill query ID2;
-# Switching to connection 'dml'
+connection dml;
ERROR 70100: Query execution was interrupted
-# Switching to connection 'blocker'
+connection blocker;
unlock tables;
-# Switching to connection 'ddl'
+connection ddl;
# Cleanup.
-# Switching to connection 'default'
+connection default;
drop table t1;
drop table t2;
#
@@ -282,6 +343,9 @@ drop table t2;
#
grant ALL on test.* to test@localhost;
grant ALL on test.* to test2@localhost;
+connect con3, localhost, test,,;
+connect con4, localhost, test2,,;
+connection default;
kill hard query user test2@nohost;
affected rows: 0
kill soft query user test@localhost;
@@ -296,16 +360,21 @@ revoke all privileges on test.* from test@localhost;
revoke all privileges on test.* from test2@localhost;
drop user test@localhost;
drop user test2@localhost;
+connection con3;
select 1;
Got one of the listed errors
+connection con4;
select 1;
Got one of the listed errors
+connection default;
#
# MDEV-4911 - add KILL query id, and add query id information to
# processlist
#
SELECT SLEEP(1000);
+connection con1;
KILL QUERY ID @id;
+connection default;
SLEEP(1000)
1
KILL QUERY ID 0;
@@ -316,11 +385,16 @@ ERROR HY000: Unknown query id: 0
#
CREATE USER u1@localhost;
SELECT SLEEP(1000);
+connection con1;
+connect con5, localhost, u1,,;
KILL QUERY ID ID;
ERROR HY000: You are not owner of query ID
+connection con1;
KILL QUERY ID @id;
+connection default;
SLEEP(1000)
1
+disconnect con5;
DROP USER u1@localhost;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
diff --git a/mysql-test/r/loaddata.result b/mysql-test/r/loaddata.result
index 8cd3b0a7ac8..16572dd95c5 100644
--- a/mysql-test/r/loaddata.result
+++ b/mysql-test/r/loaddata.result
@@ -524,9 +524,15 @@ DROP TABLE t1;
# Bug #52512 : Assertion `! is_set()' in
# Diagnostics_area::set_ok_status on LOAD DATA
#
+connect con1,localhost,root,,test;
CREATE TABLE t1 (id INT NOT NULL);
LOAD DATA LOCAL INFILE 'tb.txt' INTO TABLE t1;
+connection default;
+disconnect con1;
+connect con1,localhost,root,,test;
DROP TABLE t1;
+connection default;
+disconnect con1;
#
# Bug#11765139 58069: LOAD DATA INFILE: VALGRIND REPORTS INVALID MEMORY READS AND WRITES WITH U
#
diff --git a/mysql-test/r/loadxml.result b/mysql-test/r/loadxml.result
index 1128caf9122..c3b4c867c98 100644
--- a/mysql-test/r/loadxml.result
+++ b/mysql-test/r/loadxml.result
@@ -57,8 +57,11 @@ a b
select 1 as xml;
xml
1
+connect addconroot, localhost, root,,;
+connection addconroot;
create table t2(fl text);
LOAD XML LOCAL INFILE "MYSQLTEST_VARDIR/tmp/loadxml-dump.xml" INTO TABLE t2 ROWS IDENTIFIED BY '<person>';;
+connection default;
drop table t1;
drop table t2;
create table t1 (
diff --git a/mysql-test/r/lock.result b/mysql-test/r/lock.result
index 501c379b257..381667745d8 100644
--- a/mysql-test/r/lock.result
+++ b/mysql-test/r/lock.result
@@ -272,20 +272,24 @@ drop view v1;
#
drop table if exists t1;
create table t1 (a int);
+connect con1,localhost,root,,;
set autocommit= 0;
insert into t1 values (1);
lock table t1 write;
-# Disconnect
# Ensure that metadata locks will be released if there is an open
# transaction (autocommit=off) in conjunction with lock tables.
+disconnect con1;
+connection default;
drop table t1;
# Same problem but now for BEGIN
drop table if exists t1;
create table t1 (a int);
+connect con1,localhost,root,,;
begin;
insert into t1 values (1);
-# Disconnect
# Ensure that metadata locks held by the transaction are released.
+disconnect con1;
+connection default;
drop table t1;
#
# Coverage for situations when we try to execute DDL on tables
@@ -451,32 +455,42 @@ DROP TABLE t1;
# Bug#43685 Lock table affects other non-related tables
#
DROP TABLE IF EXISTS t1, t2;
+connect con2, localhost, root;
CREATE TABLE t1 (id INT);
CREATE TABLE t2 (id INT);
-# Connection default
+connection default;
LOCK TABLE t1 WRITE;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
-# Connection con2
+connection con2;
LOCK TABLE t2 WRITE;
# This used to hang until the first connection
# unlocked t1.
FLUSH TABLE t2;
UNLOCK TABLES;
-# Connection default
+connection default;
UNLOCK TABLES;
DROP TABLE t1, t2;
+disconnect con2;
#
# End of 6.0 tests.
#
create table t1 (a int) engine=myisam;
lock tables t1 write concurrent, t1 as t2 read;
+connect con1,localhost,root,,;
+connection con1;
lock tables t1 read local;
unlock tables;
+connection default;
unlock tables;
+connection con1;
lock tables t1 read local;
+connection default;
lock tables t1 write concurrent, t1 as t2 read;
unlock tables;
+connection con1;
unlock tables;
+disconnect con1;
+connection default;
drop table t1;
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 12960a4f5f6..d4e0edaf1c2 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -1,85 +1,125 @@
drop table if exists t1,t2;
drop DATABASE if exists mysqltest_1;
+connect locker,localhost,root,,;
+connect locker2,localhost,root,,;
+connect reader,localhost,root,,;
+connect writer,localhost,root,,;
+connection locker;
create table t1(n int);
insert into t1 values (1);
+connection locker2;
select get_lock("mysqltest_lock", 100);
get_lock("mysqltest_lock", 100)
1
+connection locker;
update t1 set n = 2 and get_lock('mysqltest_lock', 100);
+connection writer;
update low_priority t1 set n = 4;
+connection reader;
select n from t1;
+connection locker2;
select release_lock("mysqltest_lock");
release_lock("mysqltest_lock")
1
+connection locker;
select release_lock("mysqltest_lock");
release_lock("mysqltest_lock")
1
+connection writer;
+connection reader;
n
4
drop table t1;
+connection locker;
create table t1(n int);
insert into t1 values (1),(2);
+connection locker2;
select get_lock("mysqltest_lock", 100);
get_lock("mysqltest_lock", 100)
1
+connection locker;
select n from t1 where get_lock('mysqltest_lock', 100);
+connection writer;
update low_priority t1 set n = 4;
+connection reader;
select n from t1;
n
1
2
+connection locker2;
select release_lock("mysqltest_lock");
release_lock("mysqltest_lock")
1
+connection locker;
n
1
2
select release_lock("mysqltest_lock");
release_lock("mysqltest_lock")
1
+connection writer;
drop table t1;
+connection locker;
create table t1 (a int, b int);
create table t2 (c int, d int);
insert into t1 values(1,1);
insert into t1 values(2,2);
insert into t2 values(1,2);
lock table t1 read;
+connection writer;
update t1,t2 set c=a where b=d;
+connection reader;
select c from t2;
c
2
+connection locker;
unlock tables;
drop table t1;
drop table t2;
+connection locker;
create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write;
+connection reader;
insert t1 select * from t2;
+connection locker;
drop table t2;
unlock tables;
+connection reader;
ERROR 42S02: Table 'test.t2' doesn't exist
+connection locker;
drop table t1;
+connection locker;
create table t1 (a int);
create table t2 (a int);
lock table t1 write, t2 write, t1 as t1_2 write, t2 as t2_2 write;
+connection reader;
insert t1 select * from t2;
+connection locker;
drop table t2;
unlock tables;
+connection reader;
ERROR 42S02: Table 'test.t2' doesn't exist
+connection locker;
drop table t1;
End of 4.1 tests
create table t1(a int);
lock tables t1 write;
+connection reader;
show columns from t1;
Field Type Null Key Default Extra
a int(11) YES NULL
+connection locker;
unlock tables;
drop table t1;
+connection locker;
USE mysql;
LOCK TABLES columns_priv WRITE, db WRITE, host WRITE, user WRITE;
FLUSH TABLES;
+connection reader;
USE mysql;
SELECT user.Select_priv FROM user, db WHERE user.user = db.user LIMIT 1;
+connection locker;
OPTIMIZE TABLES columns_priv, db, host, user;
Table Op Msg_type Msg_text
mysql.columns_priv optimize status OK
@@ -87,157 +127,238 @@ mysql.db optimize status OK
mysql.host optimize status OK
mysql.user optimize status OK
UNLOCK TABLES;
+connection reader;
Select_priv
N
USE test;
+connection locker;
use test;
+connection default;
+connection writer;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
+connection locker;
FLUSH TABLES WITH READ LOCK;
+connection writer;
CREATE TABLE t2 (c1 int);
ERROR HY000: Table 't2' was not locked with LOCK TABLES
UNLOCK TABLES;
+connection locker;
UNLOCK TABLES;
+connection default;
DROP TABLE t1;
+connection writer;
CREATE TABLE t1 (c1 int);
LOCK TABLE t1 WRITE;
+connection locker;
FLUSH TABLES WITH READ LOCK;
+connection writer;
CREATE TABLE t2 AS SELECT * FROM t1;
ERROR HY000: Table 't2' was not locked with LOCK TABLES
UNLOCK TABLES;
+connection locker;
UNLOCK TABLES;
+connection default;
DROP TABLE t1;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
CREATE DATABASE mysqltest_1;
FLUSH TABLES WITH READ LOCK;
+connection con2;
DROP DATABASE mysqltest_1;
+connection con1;
DROP DATABASE mysqltest_1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
UNLOCK TABLES;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
DROP DATABASE mysqltest_1;
ERROR HY000: Can't drop database 'mysqltest_1'; database doesn't exist
+connection locker;
set sql_mode="";
create table t1 (f1 int(12) unsigned not null auto_increment, primary key(f1)) engine=innodb;
set sql_mode=default;
lock tables t1 write;
+connection writer;
alter table t1 auto_increment=0;
+connection reader;
alter table t1 auto_increment=0;
+connection locker;
unlock tables;
+connection writer;
+connection reader;
+connection locker;
drop table t1;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connect con4,localhost,root,,;
+connect con5,localhost,root,,;
create table t1 (a int);
create table t2 like t1;
-# con1
+connection con1;
lock tables t1 write;
-# con2
+connection con2;
flush tables with read lock;
-# con5
+connection con5;
# global read lock is taken
-# con3
+connection con3;
select * from t2 for update;
+connection con5;
# waiting for release of read lock
-# con4
+connection con4;
# would hang and later cause a deadlock
flush tables t2;
+connection con1;
# clean up
unlock tables;
+connection con2;
unlock tables;
+connection con3;
a
+connection default;
+disconnect con5;
+disconnect con4;
+disconnect con3;
+disconnect con2;
+disconnect con1;
drop table t1,t2;
#
# Lightweight version:
# Ensure that the wait for a GRL is done before opening tables.
#
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
create table t1 (a int);
create table t2 like t1;
#
# UPDATE
#
-# default
+connection default;
flush tables with read lock;
-# con1
+connection con1;
update t2 set a = 1;
-# default
+connection default;
# statement is waiting for release of read lock
-# con2
+connection con2;
flush table t2;
-# default
+connection default;
unlock tables;
-# con1
+connection con1;
#
# LOCK TABLES .. WRITE
#
-# default
+connection default;
flush tables with read lock;
-# con1
+connection con1;
lock tables t2 write;
-# default
+connection default;
# statement is waiting for release of read lock
-# con2
+connection con2;
flush table t2;
-# default
+connection default;
unlock tables;
-# con1
+connection con1;
unlock tables;
+connection default;
+disconnect con2;
+disconnect con1;
drop table t1,t2;
End of 5.0 tests
create table t1 (i int);
+connection locker;
lock table t1 read;
+connection writer;
update t1 set i= 10;
+connection reader;
select * from t1;
+connection default;
kill query ID;
+connection reader;
i
+connection writer;
ERROR 70100: Query execution was interrupted
+connection locker;
unlock tables;
+connection default;
drop table t1;
+disconnect locker;
+disconnect locker2;
+disconnect reader;
+disconnect writer;
drop table if exists t1;
create table t1 (i int);
-connection: default
+connect flush,localhost,root,,test,,;
+connection default;
lock tables t1 write;
-connection: flush
+connection flush;
flush tables with read lock;;
-connection: default
+connection default;
alter table t1 add column j int;
-connection: insert
+connect insert,localhost,root,,test,,;
+connection insert;
insert into t1 values (1,2);;
-connection: default
+connection default;
unlock tables;
-connection: flush
+connection flush;
select * from t1;
i j
unlock tables;
+connection insert;
+connection default;
select * from t1;
i j
1 2
drop table t1;
+disconnect flush;
+disconnect insert;
drop table if exists t1;
create table t1 (i int);
-connection: default
+connect flush,localhost,root,,test,,;
+connection default;
lock tables t1 write;
-connection: flush
+connection flush;
flush tables with read lock;;
-connection: default
+connection default;
flush tables;
unlock tables;
+connection flush;
+connection default;
+disconnect flush;
drop table t1;
drop table if exists t1,t2;
create table t1 (a int);
flush status;
lock tables t1 read;
+connect waiter,localhost,root,,;
+connection waiter;
insert into t1 values(1);
+connection default;
unlock tables;
+connection waiter;
+connection default;
drop table t1;
+disconnect waiter;
select @tlwa < @tlwb;
@tlwa < @tlwb
1
End of 5.1 tests
drop table if exists t1;
create table t1 (i int);
-connection: default
+connect flush,localhost,root,,test,,;
+connection default;
lock tables t1 write;
-connection: flush
+connection flush;
flush tables with read lock;;
-connection: default
+connection default;
flush tables;
drop table t1;
+connection flush;
+connection default;
+disconnect flush;
#
# Test for bug #46272 "MySQL 5.4.4, new MDL: unnecessary deadlock".
#
@@ -246,15 +367,14 @@ create table t1 (c1 int primary key, c2 int, c3 int);
insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0);
begin;
update t1 set c3=c3+1 where c2=3;
-#
-# Switching to connection 'con46272'.
+connect con46272,localhost,root,,test,,;
+connection con46272;
# The below ALTER TABLE statement should wait till transaction
# in connection 'default' is complete and then succeed.
# It should not deadlock or fail with ER_LOCK_DEADLOCK error.
# Sending:
alter table t1 add column c4 int;;
-#
-# Switching to connection 'default'.
+connection default;
# Wait until the above ALTER TABLE gets blocked because this
# connection holds SW metadata lock on table to be altered.
# The below statement should succeed. It should not
@@ -262,11 +382,10 @@ alter table t1 add column c4 int;;
update t1 set c3=c3+1 where c2=4;
# Unblock ALTER TABLE by committing transaction.
commit;
-#
-# Switching to connection 'con46272'.
+connection con46272;
# Reaping ALTER TABLE.
-#
-# Switching to connection 'default'.
+connection default;
+disconnect con46272;
drop table t1;
#
# Bug#47249 assert in MDL_global_lock::is_lock_type_compatible
@@ -292,10 +411,11 @@ DROP VIEW v1;
#
CREATE TABLE t1 ( f1 integer );
CREATE VIEW v1 AS SELECT f1 FROM t1 ;
-# Connection 2
+connect con2,localhost,root;
LOCK TABLES t1 WRITE, v1 READ;
FLUSH TABLE t1;
-# Connection 1
+disconnect con2;
+connection default;
LOCK TABLES t1 WRITE;
FLUSH TABLE t1;
DROP TABLE t1;
@@ -306,15 +426,17 @@ DROP VIEW v1;
#
drop table if exists t1;
drop view if exists v1;
+connect con50913,localhost,root;
+connection default;
create table t1 (i int);
create view v1 as select i from t1;
begin;
select * from t1;
i
-# Switching to connection 'con50913'.
+connection con50913;
# Sending:
alter table t1 add column j int;
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE gets blocked.
# The below statement should try to acquire SW lock on 't1'
# and therefore should get ER_LOCK_DEADLOCK error. Before
@@ -323,16 +445,16 @@ delete a from t1 as a where i = 1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Unblock ALTER TABLE.
commit;
-# Switching to connection 'con50913'.
+connection con50913;
# Reaping ALTER TABLE;
-# Switching to connection 'default'.
+connection default;
begin;
select * from v1;
i
-# Switching to connection 'con50913'.
+connection con50913;
# Sending:
alter table t1 drop column j;
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE gets blocked.
# The below statement should try to acquire SW lock on 't1'
# and therefore should get ER_LOCK_DEADLOCK error. Before
@@ -341,9 +463,10 @@ insert into v1 values (1);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Unblock ALTER TABLE.
commit;
-# Switching to connection 'con50913'.
+connection con50913;
# Reaping ALTER TABLE;
-# Switching to connection 'default'.
+connection default;
+disconnect con50913;
drop view v1;
drop table t1;
#
@@ -354,113 +477,122 @@ drop table t1;
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id int);
+connect con2, localhost, root,,;
SET SESSION lock_wait_timeout= 1;
#
# Test 1: acquire exclusive lock
#
-# Connection default
+connection default;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
-# Connection 2
+connection con2;
DROP TABLE t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
COMMIT;
#
# Test 2: upgrade shared lock
#
-# Connection default
+connection default;
START TRANSACTION;
SELECT * FROM t1;
id
1
-# Connection 2
+connection con2;
ALTER TABLE t1 RENAME TO t2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
COMMIT;
#
# Test 3: acquire shared lock
#
-# Connection default
+connection default;
LOCK TABLE t1 WRITE;
-# Connection 2
+connection con2;
INSERT INTO t1(id) VALUES (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
UNLOCK TABLES;
#
# Test 4: table level locks
#
-# Connection default
+connection default;
LOCK TABLE t1 READ;
-# Connection 2
+connection con2;
INSERT INTO t1(id) VALUES(4);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
UNLOCK TABLES;
#
# Test 5: Waiting on Table Definition Cache (TDC)
#
-# Connection default
+connect con3, localhost, root;
+connection default;
LOCK TABLE t1 READ;
-# Connection con3
+connection con3;
# Sending:
FLUSH TABLES;
-# Connection con2
+connection con2;
SELECT * FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con3
+connection con3;
# Reaping: FLUSH TABLES
#
# Test 6: Timeouts in I_S queries
#
-# Connection default
+connection default;
CREATE TABLE t2 (id INT);
LOCK TABLE t2 WRITE;
-# Connection con3
+connection con3;
# Sending:
DROP TABLE t1, t2;
-# Connection con2
+connection con2;
SELECT table_name, table_comment FROM information_schema.tables
WHERE table_schema= 'test' AND table_name= 't1';
table_name table_comment
t1 Lock wait timeout exceeded; try restarting transaction
Warnings:
Warning 1205 Lock wait timeout exceeded; try restarting transaction
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con3
+connection con3;
# Reaping: DROP TABLE t1, t2
-# Connection default
+connection default;
# Cleanup
+disconnect con2;
+disconnect con3;
#
# Test for bug #51134 "Crash in MDL_lock::destroy on a concurrent
# DDL workload".
#
drop tables if exists t1, t2, t3;
+connect con1, localhost, root, , ;
+connect con2, localhost, root, , ;
+connection default;
create table t3 (i int);
-# Switching to connection 'con1'
+connection con1;
# Lock 't3' so upcoming RENAME is blocked.
lock table t3 read;
-# Switching to connection 'con2'
+connection con2;
# Remember ID for this connection.
# Start statement which will try to acquire two instances
# of X metadata lock on the same object.
# Sending:
rename tables t1 to t2, t2 to t3;;
-# Switching to connection 'default'
+connection default;
# Wait until RENAME TABLE is blocked on table 't3'.
# Kill RENAME TABLE.
kill query ID;
-# Switching to connection 'con2'
+connection con2;
# RENAME TABLE should be aborted but should not crash.
ERROR 70100: Query execution was interrupted
-# Switching to connection 'con1'
+connection con1;
unlock tables;
-# Switching to connection 'default'
+connection default;
+disconnect con1;
+disconnect con2;
drop table t3;
#
# Test for the bug where upgradable metadata locks was acquired
@@ -470,9 +602,10 @@ drop table t3;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT);
LOCK TABLE t1 WRITE;
-# Connection con1
+connect con1, localhost, root;
CREATE TEMPORARY TABLE t1 (id INT);
ALTER TABLE t1 ADD COLUMN j INT;
-# Connection default
+connection default;
+disconnect con1;
UNLOCK TABLES;
DROP TABLE t1;
diff --git a/mysql-test/r/lock_multi_bug38499.result b/mysql-test/r/lock_multi_bug38499.result
index 6922312b298..521ea010816 100644
--- a/mysql-test/r/lock_multi_bug38499.result
+++ b/mysql-test/r/lock_multi_bug38499.result
@@ -1,5 +1,8 @@
SET @odl_sync_frm = @@global.sync_frm;
SET @@global.sync_frm = OFF;
+connect locker,localhost,root,,;
+connect writer,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1( a INT, b INT );
CREATE TABLE t2( a INT, b INT );
@@ -11,7 +14,9 @@ INSERT INTO t2 VALUES (1, 1), (2, 2), (3, 3), (4, 4);
# 1.1.2. PS mode
# 1.2. test altering of columns that multiupdate uses
# 1.2.1. normal mode
+connection default;
# 1.2.2. PS mode
+connection default;
ALTER TABLE t1 ADD COLUMN a INT;
# 2. test UNIONs
# 2.1. test altering of columns that multiupdate doesn't use
@@ -19,6 +24,10 @@ ALTER TABLE t1 ADD COLUMN a INT;
# 2.1.2. PS mode
# 2.2. test altering of columns that multiupdate uses
# 2.2.1. normal mode
+connection default;
# 2.2.2. PS mode
+connection default;
DROP TABLE t1,t2;
+disconnect locker;
+disconnect writer;
SET @@global.sync_frm = @odl_sync_frm;
diff --git a/mysql-test/r/lock_multi_bug38691.result b/mysql-test/r/lock_multi_bug38691.result
index d0aa1c0277c..55836e161f4 100644
--- a/mysql-test/r/lock_multi_bug38691.result
+++ b/mysql-test/r/lock_multi_bug38691.result
@@ -1,5 +1,8 @@
SET @odl_sync_frm = @@global.sync_frm;
SET @@global.sync_frm = OFF;
+connect locker,localhost,root,,;
+connect writer,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1,t2,t3;
CREATE TABLE t1 (
a int(11) unsigned default NULL,
@@ -15,6 +18,10 @@ CREATE TABLE t3 SELECT * FROM t1;
# PS mode
# test altering of columns that multiupdate uses
# normal mode
+connection default;
# PS mode
+connection default;
DROP TABLE t1, t2, t3;
+disconnect locker;
+disconnect writer;
SET @@global.sync_frm = @odl_sync_frm;
diff --git a/mysql-test/r/lock_sync.result b/mysql-test/r/lock_sync.result
index 219cc08342e..f075262c3db 100644
--- a/mysql-test/r/lock_sync.result
+++ b/mysql-test/r/lock_sync.result
@@ -23,6 +23,9 @@ select @@global.concurrent_insert;
ALWAYS
# Prepare playground by creating tables, views,
# routines and triggers used in tests.
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection default;
drop table if exists t0, t1, t2, t3, t4, t5;
drop view if exists v1, v2;
drop procedure if exists p1;
@@ -201,7 +204,7 @@ end|
# Set common variables to be used by the scripts
# called below.
#
-# Switch to connection 'con1'.
+connection con1;
# Cache all functions used in the tests below so statements
# calling them won't need to open and lock mysql.proc table
# and we can assume that each statement locks its tables
@@ -226,7 +229,7 @@ show create function f14;
show create function f15;
show create function f16;
show create function f17;
-# Switch back to connection 'default'.
+connection default;
#
# 1. Statements that read tables and do not use subqueries.
#
@@ -236,6 +239,7 @@ show create function f17;
# No locks are necessary as this statement won't be written
# to the binary log and thanks to how MyISAM works SELECT
# will see version of the table prior to concurrent insert.
+connection default;
Success: 'select * from t1' allows concurrent inserts into 't1'.
#
# 1.2 Multi-UPDATE statement.
@@ -243,11 +247,13 @@ Success: 'select * from t1' allows concurrent inserts into 't1'.
# Has to take shared locks on rows in the table being read as this
# statement will be written to the binary log and therefore should
# be serialized with concurrent statements.
+connection default;
Success: 'update t2, t1 set j= j - 1 where i = j' doesn't allow concurrent inserts into 't1'.
#
# 1.3 Multi-DELETE statement.
#
# The above is true for this statement as well.
+connection default;
Success: 'delete t2 from t1, t2 where i = j' doesn't allow concurrent inserts into 't1'.
#
# 1.4 DESCRIBE statement.
@@ -256,20 +262,20 @@ Success: 'delete t2 from t1, t2 where i = j' doesn't allow concurrent inserts in
# target table and thus does not take any lock on it.
# We check this for completeness of coverage.
lock table t1 write;
-# Switching to connection 'con1'.
+connection con1;
# This statement should not be blocked.
describe t1;
-# Switching to connection 'default'.
+connection default;
unlock tables;
#
# 1.5 SHOW statements.
#
# The above is true for SHOW statements as well.
lock table t1 write;
-# Switching to connection 'con1'.
+connection con1;
# These statements should not be blocked.
show keys from t1;
-# Switching to connection 'default'.
+connection default;
unlock tables;
#
# 2. Statements which read tables through subqueries.
@@ -280,6 +286,7 @@ unlock tables;
# A strong lock is not necessary as this statement is not
# written to the binary log as a whole (it is written
# statement-by-statement).
+connection default;
Success: 'call p1((select i + 5 from t1 where i = 1))' allows concurrent inserts into 't1'.
#
# 2.2 CREATE TABLE with a subquery.
@@ -287,24 +294,29 @@ Success: 'call p1((select i + 5 from t1 where i = 1))' allows concurrent inserts
# Has to take a strong lock on the table being read as
# this statement is written to the binary log and therefore
# should be serialized with concurrent statements.
+connection default;
Success: 'create table t0 select * from t1' doesn't allow concurrent inserts into 't1'.
drop table t0;
+connection default;
Success: 'create table t0 select j from t2 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
drop table t0;
#
# 2.3 DELETE with a subquery.
#
# The above is true for this statement as well.
+connection default;
Success: 'delete from t2 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
#
# 2.4 MULTI-DELETE with a subquery.
#
# Same is true for this statement as well.
+connection default;
Success: 'delete t2 from t3, t2 where k = j and j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
#
# 2.5 DO with a subquery.
#
# A strong lock is not necessary as it is not logged.
+connection default;
Success: 'do (select i from t1 where i = 1)' allows concurrent inserts into 't1'.
#
# 2.6 INSERT with a subquery.
@@ -312,18 +324,23 @@ Success: 'do (select i from t1 where i = 1)' allows concurrent inserts into 't1'
# Has to take a strong lock on the table being read as
# this statement is written to the binary log and therefore
# should be serialized with concurrent inserts.
+connection default;
Success: 'insert into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'insert into t2 values ((select i+5 from t1 where i = 4))' doesn't allow concurrent inserts into 't1'.
#
# 2.7 LOAD DATA with a subquery.
#
# The above is true for this statement as well.
+connection default;
Success: 'load data infile '../../std_data/rpl_loaddata.dat' into table t2 (@a, @b) set j= @b + (select i from t1 where i = 1)' doesn't allow concurrent inserts into 't1'.
#
# 2.8 REPLACE with a subquery.
#
# Same is true for this statement as well.
+connection default;
Success: 'replace into t2 select i+5 from t1' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' doesn't allow concurrent inserts into 't1'.
#
# 2.9 SELECT with a subquery.
@@ -331,17 +348,21 @@ Success: 'replace into t2 values ((select i+5 from t1 where i = 4))' doesn't all
# Strong locks are not necessary as this statement is not written
# to the binary log and thanks to how MyISAM works this statement
# sees a version of the table prior to the concurrent insert.
+connection default;
Success: 'select * from t2 where j in (select i from t1)' allows concurrent inserts into 't1'.
#
# 2.10 SET with a subquery.
#
# The same is true for this statement as well.
+connection default;
Success: 'set @a:= (select i from t1 where i = 1)' allows concurrent inserts into 't1'.
#
# 2.11 SHOW with a subquery.
#
# And for this statement too.
+connection default;
Success: 'show tables from test where Tables_in_test = 't2' and (select i from t1 where i = 1)' allows concurrent inserts into 't1'.
+connection default;
Success: 'show columns from t2 where (select i from t1 where i = 1)' allows concurrent inserts into 't1'.
#
# 2.12 UPDATE with a subquery.
@@ -349,11 +370,13 @@ Success: 'show columns from t2 where (select i from t1 where i = 1)' allows conc
# Has to take a strong lock on the table being read as
# this statement is written to the binary log and therefore
# should be serialized with concurrent inserts.
+connection default;
Success: 'update t2 set j= j-10 where j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
#
# 2.13 MULTI-UPDATE with a subquery.
#
# Same is true for this statement as well.
+connection default;
Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' doesn't allow concurrent inserts into 't1'.
#
# 3. Statements which read tables through a view.
@@ -364,9 +387,13 @@ Success: 'update t2, t3 set j= j -10 where j=k and j in (select i from t1)' does
# Since this statement is not written to the binary log and
# an old version of the table is accessible thanks to how MyISAM
# handles concurrent insert, no locking is necessary.
+connection default;
Success: 'select * from v1' allows concurrent inserts into 't1'.
+connection default;
Success: 'select * from v2' allows concurrent inserts into 't1'.
+connection default;
Success: 'select * from t2 where j in (select i from v1)' allows concurrent inserts into 't1'.
+connection default;
Success: 'select * from t3 where k in (select j from v2)' allows concurrent inserts into 't1'.
#
# 3.2 Statements which modify a table and use views.
@@ -374,9 +401,13 @@ Success: 'select * from t3 where k in (select j from v2)' allows concurrent inse
# Since such statements are going to be written to the binary
# log they need to be serialized against concurrent statements
# and therefore should take strong locks on the data read.
+connection default;
Success: 'update t2 set j= j-10 where j in (select i from v1)' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'update t3 set k= k-10 where k in (select j from v2)' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'update t2, v1 set j= j-10 where j = i' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'update v2 set j= j-10 where j = 3' doesn't allow concurrent inserts into 't1'.
#
# 4. Statements which read tables through stored functions.
@@ -388,7 +419,9 @@ Success: 'update v2 set j= j-10 where j = 3' doesn't allow concurrent inserts in
# There is no need to take strong locks on the table
# being selected from in SF as the call to such function
# won't get into the binary log.
+connection default;
Success: 'select f1()' allows concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f1()' allows concurrent inserts into 't1'.
#
# 4.2 INSERT (or other statement which modifies data) with
@@ -399,6 +432,7 @@ Success: 'set @a:= f1()' allows concurrent inserts into 't1'.
# be serialized with concurrent statements affecting the data
# it uses. Therefore it should take strong lock on the data
# it reads.
+connection default;
Success: 'insert into t2 values (f1() + 5)' doesn't allow concurrent inserts into 't1'.
#
# 4.3 SELECT/SET with a stored function which
@@ -408,7 +442,9 @@ Success: 'insert into t2 values (f1() + 5)' doesn't allow concurrent inserts int
# it should be serialized with concurrent statements affecting
# the data it uses. Hence, a strong lock on the data read
# should be taken.
+connection default;
Success: 'select f2()' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f2()' doesn't allow concurrent inserts into 't1'.
#
# 4.4. SELECT/SET with a stored function which does not
@@ -417,9 +453,13 @@ Success: 'set @a:= f2()' doesn't allow concurrent inserts into 't1'.
#
# Call to this function won't get to the
# binary log and thus no strong lock is needed.
+connection default;
Success: 'select f3()' allows concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f3()' allows concurrent inserts into 't1'.
+connection default;
Success: 'select f4()' allows concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f4()' allows concurrent inserts into 't1'.
#
# 4.5. INSERT (or other statement which modifies data) with
@@ -431,7 +471,9 @@ Success: 'set @a:= f4()' allows concurrent inserts into 't1'.
# be serialized with concurrent statements affecting data it
# uses. Therefore it should take a strong lock on the data
# it reads.
+connection default;
Success: 'insert into t2 values (f3() + 5)' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'insert into t2 values (f4() + 6)' doesn't allow concurrent inserts into 't1'.
#
# 4.6 SELECT/SET which uses a stored function with
@@ -440,7 +482,9 @@ Success: 'insert into t2 values (f4() + 6)' doesn't allow concurrent inserts int
# Since call to such function is written to the binary log
# it should be serialized with concurrent statements.
# Hence reads should take a strong lock.
+connection default;
Success: 'select f5()' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f5()' doesn't allow concurrent inserts into 't1'.
#
# 4.7 SELECT/SET which uses a stored function which
@@ -450,9 +494,13 @@ Success: 'set @a:= f5()' doesn't allow concurrent inserts into 't1'.
# Calls to such functions won't get into
# the binary log and thus don't need strong
# locks.
+connection default;
Success: 'select f6()' allows concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f6()' allows concurrent inserts into 't1'.
+connection default;
Success: 'select f7()' allows concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f7()' allows concurrent inserts into 't1'.
#
# 4.8 INSERT which uses stored function which
@@ -463,7 +511,9 @@ Success: 'set @a:= f7()' allows concurrent inserts into 't1'.
# should be serialized with concurrent statements affecting
# the data it uses. Therefore it should take a strong lock on
# the table it reads.
+connection default;
Success: 'insert into t3 values (f6() + 5)' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'insert into t3 values (f7() + 5)' doesn't allow concurrent inserts into 't1'.
#
# 4.9 SELECT which uses a stored function which
@@ -472,7 +522,9 @@ Success: 'insert into t3 values (f7() + 5)' doesn't allow concurrent inserts int
# Since a call to such function is written to the binary log
# it should be serialized with concurrent statements.
# Hence, reads should take strong locks.
+connection default;
Success: 'select f8()' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'select f9()' doesn't allow concurrent inserts into 't1'.
#
# 4.10 SELECT which uses a stored function which doesn't modify
@@ -481,6 +533,7 @@ Success: 'select f9()' doesn't allow concurrent inserts into 't1'.
#
# Calls to such functions won't get into the binary
# log and thus don't need to acquire strong locks.
+connection default;
Success: 'select f10()' allows concurrent inserts into 't1'.
#
# 4.11 INSERT which uses a stored function which doesn't modify
@@ -490,6 +543,7 @@ Success: 'select f10()' allows concurrent inserts into 't1'.
# Since such statement is written to the binary log, it should
# be serialized with concurrent statements affecting the data it
# uses. Therefore it should take strong locks on data it reads.
+connection default;
Success: 'insert into t2 values (f10() + 5)' doesn't allow concurrent inserts into 't1'.
#
# 4.12 SELECT which uses a stored function which modifies
@@ -499,6 +553,7 @@ Success: 'insert into t2 values (f10() + 5)' doesn't allow concurrent inserts in
# Since a call to such function is written to the binary log
# it should be serialized from concurrent statements.
# Hence, read should take a strong lock.
+connection default;
Success: 'select f11()' doesn't allow concurrent inserts into 't1'.
#
# 4.13 SELECT that reads a table through a subquery passed
@@ -509,6 +564,7 @@ Success: 'select f11()' doesn't allow concurrent inserts into 't1'.
# binary log, values of its parameters are written as literals.
# So there is no need to acquire strong locks for tables used in
# the subquery.
+connection default;
Success: 'select f12((select i+10 from t1 where i=1))' allows concurrent inserts into 't1'.
#
# 4.14 INSERT that reads a table via a subquery passed
@@ -518,6 +574,7 @@ Success: 'select f12((select i+10 from t1 where i=1))' allows concurrent inserts
# Since this statement is written to the binary log it should
# be serialized with concurrent statements affecting the data it
# uses. Therefore it should take strong locks on the data it reads.
+connection default;
Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't allow concurrent inserts into 't1'.
#
# 4.15 SELECT/SET with a stored function which
@@ -527,7 +584,9 @@ Success: 'insert into t2 values (f13((select i+10 from t1 where i=1)))' doesn't
# Since this statement is written to the binary log it should
# be serialized with concurrent statements affecting the data it
# uses. Therefore it should take strong locks on the data it reads.
+connection default;
Success: 'select f16()' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f16()' doesn't allow concurrent inserts into 't1'.
#
# 4.16 SELECT/SET with a stored function which call procedure
@@ -537,7 +596,9 @@ Success: 'set @a:= f16()' doesn't allow concurrent inserts into 't1'.
# Since this statement is written to the binary log it should
# be serialized with concurrent statements affecting the data it
# uses. Therefore it should take strong locks on the data it reads.
+connection default;
Success: 'select f17()' doesn't allow concurrent inserts into 't1'.
+connection default;
Success: 'set @a:= f17()' doesn't allow concurrent inserts into 't1'.
#
# 5. Statements that read tables through stored procedures.
@@ -548,6 +609,7 @@ Success: 'set @a:= f17()' doesn't allow concurrent inserts into 't1'.
# Since neither this statement nor its components are
# written to the binary log, there is no need to take
# strong locks on the data it reads.
+connection default;
Success: 'call p2(@a)' allows concurrent inserts into 't1'.
#
# 5.2 Function that modifies data and uses CALL,
@@ -556,6 +618,7 @@ Success: 'call p2(@a)' allows concurrent inserts into 't1'.
# Since a call to such function is written to the binary
# log, it should be serialized with concurrent statements.
# Hence, in this case reads should take strong locks on data.
+connection default;
Success: 'select f14()' doesn't allow concurrent inserts into 't1'.
#
# 5.3 SELECT that calls a function that doesn't modify data and
@@ -563,6 +626,7 @@ Success: 'select f14()' doesn't allow concurrent inserts into 't1'.
#
# Calls to such functions won't get into the binary
# log and thus don't need to acquire strong locks.
+connection default;
Success: 'select f15()' allows concurrent inserts into 't1'.
#
# 5.4 INSERT which calls function which doesn't modify data and
@@ -571,6 +635,7 @@ Success: 'select f15()' allows concurrent inserts into 't1'.
# Since such statement is written to the binary log it should
# be serialized with concurrent statements affecting data it
# uses. Therefore it should take strong locks on data it reads.
+connection default;
Success: 'insert into t2 values (f15()+5)' doesn't allow concurrent inserts into 't1'.
#
# 6. Statements that use triggers.
@@ -582,30 +647,35 @@ Success: 'insert into t2 values (f15()+5)' doesn't allow concurrent inserts into
# be serialized with concurrent statements affecting the data
# it uses. Therefore, it should take strong locks on the data
# it reads.
+connection default;
Success: 'insert into t4 values (2)' doesn't allow concurrent inserts into 't1'.
#
# 6.2 Statement invoking a trigger that reads table through
# a subquery in a control construct.
#
# The above is true for this statement as well.
+connection default;
Success: 'update t4 set l= 2 where l = 1' doesn't allow concurrent inserts into 't1'.
#
# 6.3 Statement invoking a trigger that reads a table through
# a view.
#
# And for this statement.
+connection default;
Success: 'delete from t4 where l = 1' doesn't allow concurrent inserts into 't1'.
#
# 6.4 Statement invoking a trigger that reads a table through
# a stored function.
#
# And for this statement.
+connection default;
Success: 'insert into t5 values (2)' doesn't allow concurrent inserts into 't1'.
#
# 6.5 Statement invoking a trigger that reads a table through
# stored procedure.
#
# And for this statement.
+connection default;
Success: 'update t5 set l= 2 where l = 1' doesn't allow concurrent inserts into 't1'.
# Clean-up.
drop function f1;
@@ -630,6 +700,8 @@ drop procedure p1;
drop procedure p2;
drop procedure p3;
drop table t1, t2, t3, t4, t5;
+disconnect con1;
+disconnect con2;
set @@global.concurrent_insert= @old_concurrent_insert;
#
# Test for bug #45143 "All connections hang on concurrent ALTER TABLE".
@@ -641,6 +713,10 @@ set @@global.concurrent_insert= @old_concurrent_insert;
drop table if exists t1;
drop view if exists v1;
# Create auxiliary connections used through the test.
+connect con_bug45143_1,localhost,root,,test,,;
+connect con_bug45143_3,localhost,root,,test,,;
+connect con_bug45143_2,localhost,root,,test,,;
+connection default;
# Reset DEBUG_SYNC facility before using it.
set debug_sync= 'RESET';
# Turn off logging so calls to locking subsystem performed
@@ -657,10 +733,10 @@ insert into t1 values (1);
select get_lock("lock_bug45143_wait", 0);
get_lock("lock_bug45143_wait", 0)
1
-# Switch to connection 'con_bug45143_1'.
+connection con_bug45143_1;
# Sending:
insert into t1 values (get_lock("lock_bug45143_wait", 100));;
-# Switch to connection 'con_bug45143_2'.
+connection con_bug45143_2;
# Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1'
# and then gets blocked on user lock 'lock_bug45143_wait'.
# Ensure that upcoming SELECT waits after acquiring TL_WRITE_ALLOW_WRITE
@@ -668,13 +744,13 @@ insert into t1 values (get_lock("lock_bug45143_wait", 100));;
set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
# Sending:
select count(*) > 0 from t1 as a, t1 as b for update;;
-# Switch to connection 'con_bug45143_3'.
+connection con_bug45143_3;
# Wait until the above SELECT ... FOR UPDATE is blocked after
# acquiring lock for the the first instance of 't1'.
set debug_sync= 'now WAIT_FOR parked';
# Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1':
lock table v1 write;;
-# Switch to connection 'default'.
+connection default;
# Wait until this LOCK TABLES statement starts waiting for table lock.
# Allow SELECT ... FOR UPDATE to resume.
# Since it already has TL_WRITE_ALLOW_WRITE lock on the first instance
@@ -682,25 +758,28 @@ lock table v1 write;;
# waiting, even although there is another thread which has such lock
# on this table and also there is a thread waiting for a TL_WRITE on it.
set debug_sync= 'now SIGNAL go';
-# Switch to connection 'con_bug45143_2'.
+connection con_bug45143_2;
# Reap SELECT ... FOR UPDATE
count(*) > 0
1
-# Switch to connection 'default'.
+connection default;
# Resume execution of the INSERT statement.
select release_lock("lock_bug45143_wait");
release_lock("lock_bug45143_wait")
1
-# Switch to connection 'con_bug45143_1'.
+connection con_bug45143_1;
# Reap INSERT statement.
# In Statement and Mixed replication mode we get here "Unsafe
# for binlog" warnings. In row mode there are no warnings.
# Hide the discrepancy.
-# Switch to connection 'con_bug45143_3'.
+connection con_bug45143_3;
# Reap LOCK TABLES statement.
unlock tables;
-# Switch to connection 'default'.
+connection default;
# Do clean-up.
+disconnect con_bug45143_1;
+disconnect con_bug45143_2;
+disconnect con_bug45143_3;
set debug_sync= 'RESET';
set @@global.general_log= @old_general_log;
drop view v1;
@@ -711,38 +790,40 @@ drop table t1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1(id INT);
CREATE TABLE t2(id INT);
-# Connection con2
+connect con2, localhost, root;
START TRANSACTION;
SELECT * FROM t1;
id
-# Connection default
+connection default;
# Sending:
ALTER TABLE t1 ADD COLUMN j INT;
-# Connection con2
+connection con2;
# This used to cause a deadlock.
INSERT INTO t2 SELECT * FROM t1;
COMMIT;
-# Connection default
+connection default;
# Reaping ALTER TABLE t1 ADD COLUMN j INT
DROP TABLE t1, t2;
+disconnect con2;
#
# Bug#51391 Deadlock involving events during rqg_info_schema test
#
CREATE EVENT e1 ON SCHEDULE EVERY 5 HOUR DO SELECT 1;
CREATE EVENT e2 ON SCHEDULE EVERY 5 HOUR DO SELECT 2;
-# Connection con1
+connect con1, localhost, root;
SET DEBUG_SYNC="before_lock_tables_takes_lock SIGNAL drop WAIT_FOR query";
# Sending:
DROP EVENT e1;;
-# Connection default
+connection default;
SET DEBUG_SYNC="now WAIT_FOR drop";
SELECT name FROM mysql.event, INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE definer = VARIABLE_VALUE;
name
SET DEBUG_SYNC="now SIGNAL query";
-# Connection con1
+connection con1;
# Reaping: DROP EVENT t1
-# Connection default
+disconnect con1;
+connection default;
DROP EVENT e2;
SET DEBUG_SYNC="RESET";
#
@@ -752,20 +833,22 @@ SET DEBUG_SYNC="RESET";
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT) engine=InnoDB;
INSERT INTO t1 VALUES (1), (2);
-# Connection con1
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
SET SESSION lock_wait_timeout= 1;
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze';
# Sending:
OPTIMIZE TABLE t1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate';
SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock';
# Sending:
INSERT INTO t1 VALUES (3);
-# Connection default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR thrlock';
SET DEBUG_SYNC= 'now SIGNAL opti_analyze';
-# Connection con1
+connection con1;
# Reaping: OPTIMIZE TABLE t1
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
@@ -774,9 +857,11 @@ test.t1 optimize status Operation failed
Warnings:
Error 1205 Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL release_thrlock';
-# Connection con2
+disconnect con1;
+connection con2;
# Reaping: INSERT INTO t1 VALUES (3)
-# Connection default
+disconnect con2;
+connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
#
@@ -789,28 +874,31 @@ CREATE TABLE t1(a INT);
CREATE FUNCTION f1() RETURNS INTEGER RETURN 1;
CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1() = 1;
DROP FUNCTION f1;
-# Connection con1
+connect con2, localhost, root;
+connect con1, localhost, root;
SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped EXECUTE 2';
# Sending:
SHOW CREATE VIEW v1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'now SIGNAL dropped';
SET DEBUG_SYNC= 'now WAIT_FOR opened';
# Sending:
FLUSH TABLES;
-# Connection default
+connection default;
# Waiting for FLUSH TABLES to be blocked.
SET DEBUG_SYNC= 'now SIGNAL dropped';
-# Connection con1
+connection con1;
# Reaping: SHOW CREATE VIEW v1
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`f1`() = 1) latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-# Connection con2
+connection con2;
# Reaping: FLUSH TABLES
-# Connection default
+connection default;
SET DEBUG_SYNC= 'RESET';
DROP VIEW v1;
DROP TABLE t1;
+disconnect con1;
+disconnect con2;
diff --git a/mysql-test/r/lock_tables_lost_commit.result b/mysql-test/r/lock_tables_lost_commit.result
index df4b6eff5cf..769e9734c7a 100644
--- a/mysql-test/r/lock_tables_lost_commit.result
+++ b/mysql-test/r/lock_tables_lost_commit.result
@@ -1,8 +1,15 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT) ENGINE=innodb;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES(10);
+disconnect con1;
+connection con2;
SELECT * FROM t1;
a
10
DROP TABLE t1;
+connection default;
+disconnect con2;
diff --git a/mysql-test/r/locked_temporary-5955.result b/mysql-test/r/locked_temporary-5955.result
index 8999bdd39c4..ee2a9f499b2 100644
--- a/mysql-test/r/locked_temporary-5955.result
+++ b/mysql-test/r/locked_temporary-5955.result
@@ -1,2 +1,4 @@
+connect con1,localhost,root,,;
CREATE TEMPORARY TABLE tmp (i INT) ENGINE=InnoDB;
LOCK TABLES tmp AS p WRITE;
+disconnect con1;
diff --git a/mysql-test/r/log_state.result b/mysql-test/r/log_state.result
index 6e3ab8a991a..8d79601d954 100644
--- a/mysql-test/r/log_state.result
+++ b/mysql-test/r/log_state.result
@@ -31,8 +31,8 @@ where Variable_name = 'general_log' or Variable_name = 'slow_query_log';
Variable_name Value
general_log ON
slow_query_log OFF
-# Establish connection con1 (user=root)
-# Switch to connection con1
+connect con1,localhost,root,,;
+connection con1;
set @long_query_time = <long_query_time>;
set session long_query_time = @long_query_time;
select sleep(@long_query_time + 1);
@@ -40,10 +40,10 @@ sleep(@long_query_time + 1)
0
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
-# Switch to connection default
+connection default;
set global slow_query_log= ON;
set local slow_query_log= ON;
-# Switch to connection con1
+connection con1;
set session long_query_time = @long_query_time;
select sleep(@long_query_time + 1);
sleep(@long_query_time + 1)
@@ -57,7 +57,7 @@ sleep(@long_query_time + 2)
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
start_time user_host query_time lock_time rows_sent rows_examined db last_insert_id insert_id server_id sql_text thread_id rows_affected
TIMESTAMP USER_HOST QUERY_TIME 00:00:00.000000 1 0 test 0 0 1 select sleep(@long_query_time + 2) THREAD_ID 0
-# Switch to connection default
+connection default;
show global variables
where Variable_name = 'general_log' or Variable_name = 'slow_query_log';
Variable_name Value
@@ -226,6 +226,7 @@ TRUNCATE TABLE mysql.slow_log;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (b INT, PRIMARY KEY (b));
INSERT INTO t2 VALUES (3),(4);
+connect con2,localhost,root,,;
INSERT INTO t1 VALUES (1+sleep(.02)),(2);
INSERT INTO t1 SELECT b+sleep(.02) from t2;
UPDATE t1 SET a=a+sleep(.02) WHERE a>2;
@@ -242,6 +243,8 @@ rows_examined sql_text
1 UPDATE t2 set b=b+sleep(.02) limit 1
4 UPDATE t1 SET a=a+sleep(.02) WHERE a in (SELECT b from t2)
6 DELETE FROM t1 WHERE a=a+sleep(.02) ORDER BY a LIMIT 2
+disconnect con2;
+connection default;
DROP TABLE t1,t2;
TRUNCATE TABLE mysql.slow_log;
# end of bug#49756
@@ -270,7 +273,8 @@ SELECT @@general_log_file = @my_glf;
@@general_log_file = @my_glf
1
SET GLOBAL general_log_file = @old_general_log_file;
-# Close connection con1
+disconnect con1;
+connection default;
SET GLOBAL long_query_time = DEFAULT;
SET GLOBAL log_output = @old_log_output;
SET global general_log = @old_general_log;
diff --git a/mysql-test/r/log_tables.result b/mysql-test/r/log_tables.result
index ff5055e1ae4..46997361bbe 100644
--- a/mysql-test/r/log_tables.result
+++ b/mysql-test/r/log_tables.result
@@ -507,14 +507,47 @@ call proc25422_alter_slow(@iterations);
"Serial test (proc25422_alter_general)"
call proc25422_alter_general(@iterations);
"Parallel test"
+connect addconroot1, localhost, root,,;
+connect addconroot2, localhost, root,,;
+connect addconroot3, localhost, root,,;
+connect addconroot4, localhost, root,,;
+connect addconroot5, localhost, root,,;
+connect addconroot6, localhost, root,,;
+connect addconroot7, localhost, root,,;
+connect addconroot8, localhost, root,,;
+connection addconroot1;
call proc25422_truncate_slow(@iterations);
+connection addconroot2;
call proc25422_truncate_slow(@iterations);
+connection addconroot3;
call proc25422_truncate_general(@iterations);
+connection addconroot4;
call proc25422_truncate_general(@iterations);
+connection addconroot5;
call proc25422_alter_slow(@iterations);
+connection addconroot6;
call proc25422_alter_slow(@iterations);
+connection addconroot7;
call proc25422_alter_general(@iterations);
+connection addconroot8;
call proc25422_alter_general(@iterations);
+connection addconroot1;
+connection addconroot2;
+connection addconroot3;
+connection addconroot4;
+connection addconroot5;
+connection addconroot6;
+connection addconroot7;
+connection addconroot8;
+connection default;
+disconnect addconroot1;
+disconnect addconroot2;
+disconnect addconroot3;
+disconnect addconroot4;
+disconnect addconroot5;
+disconnect addconroot6;
+disconnect addconroot7;
+disconnect addconroot8;
drop procedure proc25422_truncate_slow;
drop procedure proc25422_truncate_general;
drop procedure proc25422_alter_slow;
diff --git a/mysql-test/r/lowercase_fs_off.result b/mysql-test/r/lowercase_fs_off.result
index dea4670d2c7..12da5127629 100644
--- a/mysql-test/r/lowercase_fs_off.result
+++ b/mysql-test/r/lowercase_fs_off.result
@@ -1,8 +1,12 @@
set GLOBAL sql_mode="";
set LOCAL sql_mode="";
+connect master,localhost,root,,;
+connection master;
create database d1;
grant all on d1.* to 'sample'@'localhost' identified by 'password';
flush privileges;
+connect sample,localhost,sample,password,d1;
+connection sample;
select database();
database()
d1
@@ -10,22 +14,31 @@ create database d2;
ERROR 42000: Access denied for user 'sample'@'localhost' to database 'd2'
create database D1;
ERROR 42000: Access denied for user 'sample'@'localhost' to database 'D1'
+disconnect sample;
+connection master;
drop user 'sample'@'localhost';
drop database if exists d1;
+disconnect master;
+connection default;
CREATE DATABASE d1;
USE d1;
CREATE TABLE T1(f1 INT);
CREATE TABLE t1(f1 INT);
GRANT SELECT ON T1 to user_1@localhost;
+connect con1,localhost,user_1,,d1;
select * from t1;
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't1'
select * from T1;
f1
+connection default;
GRANT SELECT ON t1 to user_1@localhost;
+connection con1;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
'user_1'@'localhost' def d1 T1 SELECT NO
'user_1'@'localhost' def d1 t1 SELECT NO
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
DROP USER user_1@localhost;
DROP DATABASE d1;
@@ -38,17 +51,22 @@ GRANT USAGE ON db1.* to user_1@localhost;
GRANT EXECUTE ON PROCEDURE db1.P1 to user_1@localhost;
GRANT EXECUTE ON FUNCTION db1.f1 to user_1@localhost;
GRANT UPDATE ON db1.* to USER_1@localhost;
+connect con1,localhost,user_1,,db1;
call p1();
call P1();
select f1(1);
f1(1)
2
+connect con2,localhost,USER_1,,db1;
call p1();
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.p1'
call P1();
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.P1'
select f1(1);
ERROR 42000: execute command denied to user 'USER_1'@'localhost' for routine 'db1.f1'
+connection default;
+disconnect con1;
+disconnect con2;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user_1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM USER_1@localhost;
DROP FUNCTION f1;
diff --git a/mysql-test/r/mdev-504.result b/mysql-test/r/mdev-504.result
index 4d93e77c6e8..9b8b6795e0f 100644
--- a/mysql-test/r/mdev-504.result
+++ b/mysql-test/r/mdev-504.result
@@ -16,6 +16,7 @@ BEGIN
RETURN ROUND(3 * RAND() + 0.5);
END |
SET GLOBAL use_stat_tables = PREFERABLY;
+connection default;
DROP TABLE A;
DROP PROCEDURE p_analyze;
DROP FUNCTION rnd3;
diff --git a/mysql-test/r/mdev375.result b/mysql-test/r/mdev375.result
index 426336e5939..d7a66ebd6dd 100644
--- a/mysql-test/r/mdev375.result
+++ b/mysql-test/r/mdev375.result
@@ -1,12 +1,15 @@
SET GLOBAL log_warnings=4;
SET GLOBAL max_connections=2;
+connect con1,localhost,root,,;
SELECT 1;
1
1
+connect con2,localhost,root,,;
SELECT 2;
2
2
ERROR HY000: Too many connections
+connection default;
SELECT 0;
0
0
diff --git a/mysql-test/r/mdl_sync.result b/mysql-test/r/mdl_sync.result
index 206ad509e37..865e874f63e 100644
--- a/mysql-test/r/mdl_sync.result
+++ b/mysql-test/r/mdl_sync.result
@@ -1,28 +1,46 @@
SET DEBUG_SYNC= 'RESET';
+connect con1,localhost,root,,test,,;
+connect con2,localhost,root,,test,,;
+connect con3,localhost,root,,test,,;
+connection default;
drop table if exists t1,t2,t3;
create table t1 (i int);
create table t2 (i int);
connection: default
lock tables t2 read;
+connection con1;
connection: con1
set debug_sync='mdl_upgrade_lock SIGNAL parked WAIT_FOR go';
alter table t1 rename t3;
+connection default;
connection: default
set debug_sync= 'now WAIT_FOR parked';
+connection con2;
connection: con2
set debug_sync='mdl_acquire_lock_wait SIGNAL go';
drop table t1,t2;
+connection con1;
connection: con1
+connection default;
connection: default
unlock tables;
+connection con2;
connection: con2
ERROR 42S02: Unknown table 'test.t1'
+connection default;
drop table t3;
+disconnect con1;
+disconnect con2;
+disconnect con3;
SET DEBUG_SYNC= 'RESET';
#
# Basic test coverage for type-of-operation aware metadata locks.
#
drop table if exists t1, t2, t3;
+connect mdl_con1,localhost,root,,;
+connect mdl_con2,localhost,root,,;
+connect mdl_con3,localhost,root,,;
+connection default;
set debug_sync= 'RESET';
create table t1 (c1 int);
#
@@ -36,7 +54,7 @@ create table t1 (c1 int);
#
handler t1 open;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that S, SH, SR and SW locks are compatible with it.
handler t1 open t;
handler t close;
@@ -66,62 +84,62 @@ unlock tables;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME is blocked because of S lock.
#
-# Switching to connection 'default'.
+connection default;
# Unblock RENAME TABLE.
handler t1 close;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE.
# Restore the original state of the things.
rename table t2 to t1;
#
-# Switching to connection 'default'.
+connection default;
handler t1 open;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that upgrade from SNW to X is blocked by presence of S lock.
# Sending:
alter table t1 add column c2 int;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER TABLE is blocked because of S lock.
#
-# Switching to connection 'default'.
+connection default;
# Unblock ALTER TABLE.
handler t1 close;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
# Restore the original state of the things.
alter table t1 drop column c2;
#
-# Switching to connection 'default'.
+connection default;
handler t1 open;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that upgrade from SNRW to X is blocked by presence of S lock.
lock table t1 write;
# Sending:
alter table t1 add column c2 int;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above upgrade of SNRW to X in ALTER TABLE is blocked
# because of S lock.
#
-# Switching to connection 'default'.
+connection default;
# Unblock ALTER TABLE.
handler t1 close;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
# Restore the original state of the things.
alter table t1 drop column c2;
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
#
# 2) Acquire SH (shared high-priority) lock on the table.
# We have to involve DEBUG_SYNC facility for this as usually
@@ -131,7 +149,7 @@ set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
# Sending:
select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t1';;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that S, SH, SR and SW locks are compatible with it.
handler t1 open;
@@ -162,76 +180,76 @@ unlock tables;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME is blocked because of SH lock.
# Unblock RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping SELECT ... FROM I_S.
table_name table_type auto_increment table_comment
t1 BASE TABLE NULL
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE.
# Restore the original state of the things.
rename table t2 to t1;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
# Sending:
select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t1';;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that upgrade from SNW to X is blocked by presence of SH lock.
# Sending:
alter table t1 add column c2 int;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER TABLE is blocked because of SH lock.
# Unblock RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping SELECT ... FROM I_S.
table_name table_type auto_increment table_comment
t1 BASE TABLE NULL
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
# Restore the original state of the things.
alter table t1 drop column c2;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t1';;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that upgrade from SNRW to X is blocked by presence of S lock.
lock table t1 write;
# Sending:
alter table t1 add column c2 int;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above upgrade of SNRW to X in ALTER TABLE is blocked
# because of S lock.
# Unblock RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping SELECT ... FROM I_S.
table_name table_type auto_increment table_comment
t1 BASE TABLE NULL
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
# Restore the original state of the things.
alter table t1 drop column c2;
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
#
#
# 3) Acquire SR lock on the table.
@@ -242,7 +260,7 @@ select count(*) from t1;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that S, SH, SR and SW locks are compatible with it.
handler t1 open;
handler t1 close;
@@ -268,58 +286,58 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
# Sending:
lock table t1 write;;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above LOCK TABLES is blocked because of SR lock.
# Unblock LOCK TABLES.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLES.
delete from t1 limit 1;
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
begin;
select count(*) from t1;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that X lock is incompatible with SR lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME is blocked because of SR lock.
#
-# Switching to connection 'default'.
+connection default;
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE.
# Restore the original state of the things.
rename table t2 to t1;
#
-# Switching to connection 'default'.
+connection default;
begin;
select count(*) from t1;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that upgrade from SNW to X is blocked by presence of SR lock.
# Sending:
alter table t1 add column c2 int;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER TABLE is blocked because of SR lock.
#
-# Switching to connection 'default'.
+connection default;
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
# Restore the original state of the things.
alter table t1 drop column c2;
@@ -328,7 +346,7 @@ alter table t1 drop column c2;
# by presence of SR lock because SNRW is incompatible with SR anyway.
#
#
-# Switching to connection 'default'.
+connection default;
#
#
# 4) Acquire SW lock on the table.
@@ -337,7 +355,7 @@ alter table t1 drop column c2;
begin;
insert into t1 values (1);
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that S, SH, SR and SW locks are compatible with it.
handler t1 open;
handler t1 close;
@@ -360,51 +378,51 @@ ERROR 42000: Key column 'not_exist' doesn't exist in table
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above ALTER TABLE is blocked because of SW lock.
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'default'.
+connection default;
begin;
insert into t1 values (1);
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that SNRW lock is not compatible with SW lock.
# Sending:
lock table t1 write;;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above LOCK TABLES is blocked because of SW lock.
# Unblock LOCK TABLES.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLES.
delete from t1 limit 2;
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
begin;
insert into t1 values (1);
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that X lock is incompatible with SW lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME is blocked because of SW lock.
#
-# Switching to connection 'default'.
+connection default;
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE.
# Restore the original state of the things.
rename table t2 to t1;
@@ -414,7 +432,7 @@ rename table t2 to t1;
# with SW anyway.
#
#
-# Switching to connection 'default'.
+connection default;
#
#
# 5) Acquire SU lock on the table. We have to use DEBUG_SYNC for
@@ -424,7 +442,7 @@ set debug_sync= 'alter_opened_table SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that S, SH, SR and SW locks are compatible with it.
handler t1 open;
@@ -441,67 +459,67 @@ delete from t1 limit 1;
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER is blocked because of SU lock.
# Unblock ALTERs.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping first ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping another ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'alter_opened_table SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that SNRW lock is incompatible with SU lock.
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above LOCK TABLES is blocked because of SU lock.
# Unblock ALTER and thus LOCK TABLES.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLES
insert into t1 values (1);
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'alter_opened_table SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that X lock is incompatible with SU lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME is blocked because of SU lock.
# Unblock ALTER and thus RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Now we have ALTER TABLE with SU->SNW and RENAME TABLE with pending
# X-lock. In this case ALTER TABLE should be chosen as victim.
# Reaping ALTER TABLE.
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE
# Revert back to original state of things.
rename table t2 to t1;
@@ -510,7 +528,7 @@ rename table t2 to t1;
# blocked by presence of another SU lock because SNW/SNRW is
# incompatible with SU anyway.
#
-# Switching to connection 'default'.
+connection default;
#
#
# 6) Acquire SNW lock on the table. We have to use DEBUG_SYNC for
@@ -520,7 +538,7 @@ set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR fini
# Sending:
alter table t1 add primary key (c1), lock=shared, algorithm=copy;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that S, SH and SR locks are compatible with it.
handler t1 open;
@@ -536,39 +554,39 @@ count(*)
# Sending:
delete from t1 limit 2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above DELETE is blocked because of SNW lock.
# Unblock ALTER and thus DELETE.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping DELETE.
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1), lock=shared, algorithm=copy;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that SU lock is incompatible with SNW lock.
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER is blocked because of SNW lock.
# Unblock ALTERs.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping first ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping another ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
@@ -576,52 +594,52 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
# SNW is only used by ALTER TABLE after upgrading from SU
# and SU is also incompatible with SNW.
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1), lock=shared, algorithm=copy;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that SNRW lock is incompatible with SNW lock.
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above LOCK TABLES is blocked because of SNW lock.
# Unblock ALTER and thus LOCK TABLES.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLES
insert into t1 values (1);
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1), algorithm=copy, lock=shared;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
# Check that X lock is incompatible with SNW lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME is blocked because of SNW lock.
# Unblock ALTER and thus RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE
# Revert back to original state of things.
rename table t2 to t1;
@@ -630,7 +648,7 @@ rename table t2 to t1;
# blocked by presence of another SNW lock because SNW/SNRW is
# incompatible with SNW anyway.
#
-# Switching to connection 'default'.
+connection default;
#
#
# 7) Acquire SNRW lock on the table.
@@ -638,7 +656,7 @@ rename table t2 to t1;
#
lock table t1 write;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that S and SH locks are compatible with it.
handler t1 open;
handler t1 close;
@@ -650,46 +668,46 @@ c1
# Sending:
select count(*) from t1;;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above SELECT is blocked because of SNRW lock.
# Unblock SELECT.
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping SELECT.
count(*)
4
#
-# Switching to connection 'default'.
+connection default;
lock table t1 write;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that SW lock is incompatible with SNRW lock.
# Sending:
delete from t1 limit 1;;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above DELETE is blocked because of SNRW lock.
# Unblock DELETE.
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping DELETE.
#
-# Switching to connection 'default'.
+connection default;
lock table t1 write;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that SU lock is incompatible with SNRW lock.
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above ALTER is blocked because of SNRW lock.
# Unblock ALTER.
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
@@ -697,38 +715,38 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
# SNW is only used by ALTER TABLE after upgrading from SU
# and SU is also incompatible with SNRW.
#
-# Switching to connection 'default'.
+connection default;
lock table t1 write;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that SNRW lock is incompatible with SNRW lock.
# Sending:
lock table t1 write;;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above LOCK TABLES is blocked because of SNRW lock.
# Unblock waiting LOCK TABLES.
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLES
insert into t1 values (1);
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
lock table t1 write;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that X lock is incompatible with SNRW lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'default'.
+connection default;
# Check that the above RENAME is blocked because of SNRW lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME TABLE
# Revert back to original state of things.
rename table t2 to t1;
@@ -737,7 +755,7 @@ rename table t2 to t1;
# blocked by presence of another SNRW lock because SNW/SNRW is
# incompatible with SNRW anyway.
#
-# Switching to connection 'default'.
+connection default;
#
#
# 8) Now do the same round of tests for X lock. We use additional
@@ -745,144 +763,144 @@ rename table t2 to t1;
#
create table t2 (c1 int);
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Take a lock on t2, so RENAME TABLE t1 TO t2 will get blocked
# after acquiring X lock on t1.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that S lock in incompatible with X lock.
# Sending:
handler t1 open;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above HANDLER statement is blocked because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping HANDLER.
handler t1 close;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Prepare for blocking RENAME TABLE.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that SH lock in incompatible with X lock.
# Sending:
select column_name from information_schema.columns where table_schema='test' and table_name='t1';;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above SELECT ... FROM I_S ... statement is blocked
# because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping SELECT ... FROM I_S.
column_name
c1
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Prepare for blocking RENAME TABLE.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that SR lock in incompatible with X lock.
# Sending:
select count(*) from t1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above SELECT statement is blocked
# because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping SELECT.
count(*)
4
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Prepare for blocking RENAME TABLE.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that SW lock in incompatible with X lock.
# Sending:
delete from t1 limit 1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above DELETE statement is blocked
# because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping DELETE.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Prepare for blocking RENAME TABLE.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that SU lock is incompatible with X lock.
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER statement is blocked
# because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
@@ -890,59 +908,59 @@ ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
# SNW is only used by ALTER TABLE after upgrading from SU
# and SU is also incompatible with X.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Prepare for blocking RENAME TABLE.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that SNRW lock is incompatible with X lock.
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above LOCK TABLE statement is blocked
# because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLE.
unlock tables;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Prepare for blocking RENAME TABLE.
lock tables t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME has acquired X lock on t1 and is waiting for t2.
# Check that X lock is incompatible with X lock.
# Sending:
rename table t1 to t3;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above RENAME statement is blocked
# because of X lock.
# Unblock RENAME TABLE
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping RENAME.
rename table t3 to t1;
#
@@ -954,7 +972,7 @@ rename table t3 to t1;
# even stronger active or pending lock.
#
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
#
# 1) Check compatibility for pending SNW lock.
#
@@ -962,12 +980,12 @@ rename table t3 to t1;
begin;
insert into t1 values (1);
#
-# Switching to connection 'default'.
+connection default;
# Add pending SNW lock.
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that ALTER TABLE is waiting with pending SNW lock.
# Check that S, SH and SR locks are compatible with pending SNW
handler t1 open t;
@@ -983,23 +1001,23 @@ count(*)
# Sending:
delete from t1 limit 1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above DELETE is blocked because of pending SNW lock.
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping DELETE.
#
# We can't do similar check for SNW, SNRW and X locks because
# they will also be blocked by active SW lock.
#
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
#
# 2) Check compatibility for pending SNRW lock.
#
@@ -1009,12 +1027,12 @@ select count(*) from t1;
count(*)
3
#
-# Switching to connection 'default'.
+connection default;
# Add pending SNRW lock.
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that LOCK TABLE is waiting with pending SNRW lock.
# Check that S and SH locks are compatible with pending SNRW
handler t1 open t;
@@ -1027,72 +1045,72 @@ c1
# Sending:
select count(*) from t1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above SELECT is blocked because of pending SNRW lock.
# Unblock LOCK TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping LOCK TABLE.
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping SELECT.
count(*)
3
# Restore pending SNRW lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
begin;
select count(*) from t1;
count(*)
3
#
-# Switching to connection 'default'.
+connection default;
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that LOCK TABLE is waiting with pending SNRW lock.
# Check that SW is incompatible with pending SNRW
# Sending:
insert into t1 values (1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above INSERT is blocked because of pending SNRW lock.
# Unblock LOCK TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping LOCK TABLE.
unlock tables;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping INSERT.
# Restore pending SNRW lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
begin;
select count(*) from t1;
count(*)
4
#
-# Switching to connection 'default'.
+connection default;
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that LOCK TABLE is waiting with pending SNRW lock.
# Check that SNW is compatible with pending SNRW
# So ALTER TABLE statements are not starved by LOCK TABLEs.
alter table t1 add primary key (c1);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Unblock LOCK TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping LOCK TABLE.
unlock tables;
#
@@ -1100,7 +1118,7 @@ unlock tables;
# they will also be blocked by active SR lock.
#
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
#
# 3) Check compatibility for pending X lock.
#
@@ -1110,12 +1128,12 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'default'.
+connection default;
# Add pending X lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME TABLE is waiting with pending X lock.
# Check that SH locks are compatible with pending X
select column_name from information_schema.columns where
@@ -1126,143 +1144,143 @@ c1
# Sending:
handler t1 open;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above HANDLER OPEN is blocked because of pending X lock.
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping HANDLER t1 OPEN.
handler t1 close;
# Restore pending X lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
begin;
select count(*) from t1;
count(*)
4
#
-# Switching to connection 'default'.
+connection default;
# Add pending X lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME TABLE is waiting with pending X lock.
# Check that SR is incompatible with pending X
# Sending:
select count(*) from t1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above SELECT is blocked because of pending X lock.
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping SELECT.
count(*)
4
# Restore pending X lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
begin;
select count(*) from t1;
count(*)
4
#
-# Switching to connection 'default'.
+connection default;
# Add pending X lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME TABLE is waiting with pending X lock.
# Check that SW is incompatible with pending X
# Sending:
delete from t1 limit 1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above DELETE is blocked because of pending X lock.
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping DELETE.
# Restore pending X lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
begin;
select count(*) from t1;
count(*)
3
#
-# Switching to connection 'default'.
+connection default;
# Add pending X lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME TABLE is waiting with pending X lock.
# Check that SNW is incompatible with pending X
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above ALTER TABLE is blocked because of pending X lock.
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
# Restore pending X lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
handler t1 open;
#
-# Switching to connection 'default'.
+connection default;
# Add pending X lock.
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that RENAME TABLE is waiting with pending X lock.
# Check that SNRW is incompatible with pending X
# Sending:
lock table t1 write;;
#
-# Switching to connection 'mdl_con3'.
+connection mdl_con3;
# Check that the above LOCK TABLES is blocked because of pending X lock.
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Unblock RENAME TABLE.
handler t1 close;
#
-# Switching to connection 'default'.
+connection default;
# Reaping RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reaping LOCK TABLES.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
#
#
# C) Now let us test how type-of-operation locks are handled in
@@ -1283,7 +1301,7 @@ select count(*) from t1;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create an active SNW lock on t2.
# We have to use DEBUG_SYNC facility as otherwise SNW lock
# will be immediately released (or upgraded to X lock).
@@ -1292,7 +1310,7 @@ set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR fini
# Sending:
alter table t2 add primary key (c1), algorithm=copy, lock=shared;;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'now WAIT_FOR locked';
# SR lock should be acquired without any waiting.
select count(*) from t2;
@@ -1307,16 +1325,16 @@ count(*)
# Sending:
insert into t2 values (1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above INSERT is blocked.
# Unblock ALTER TABLE and thus INSERT.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'default'.
+connection default;
# Reap INSERT.
commit;
#
@@ -1331,13 +1349,13 @@ select count(*) from t1;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create an active SNW lock on t1.
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
# Sending:
alter table t1 add primary key (c1), algorithm=copy, lock=shared;;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'now WAIT_FOR locked';
# We should still be able to get SR lock without waiting.
select count(*) from t1;
@@ -1349,16 +1367,16 @@ count(*)
# Sending:
insert into t1 values (1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above INSERT is blocked.
# Unblock ALTER TABLE and thus INSERT.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'default'.
+connection default;
# Reap INSERT.
commit;
#
@@ -1369,12 +1387,12 @@ commit;
begin;
insert into t1 values (1);
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create pending SNW lock on t1.
# Sending:
alter table t1 add primary key (c1);;
#
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE starts waiting for SNW lock.
# We should still be able to get both SW and SR locks without waiting.
select count(*) from t1;
@@ -1384,11 +1402,11 @@ delete from t1 limit 1;
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap ALTER TABLE.
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
#
-# Switching to connection 'default'.
+connection default;
#
# 2) Now similar tests for active SNW lock which is being upgraded
# to X lock.
@@ -1400,7 +1418,7 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Start transaction which will prevent SNW -> X upgrade from
# completing immediately.
begin;
@@ -1408,26 +1426,26 @@ select count(*) from t2;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create SNW lock pending upgrade to X on t2.
# Sending:
alter table t2 add column c2 int;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE starts waiting X lock.
# Check that attempt to acquire SR lock on t2 causes waiting.
# Sending:
select count(*) from t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above SELECT is blocked.
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap ALTER TABLE.
#
-# Switching to connection 'default'.
+connection default;
# Reap SELECT.
count(*)
3
@@ -1438,7 +1456,7 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Start transaction which will prevent SNW -> X upgrade from
# completing immediately.
begin;
@@ -1446,26 +1464,26 @@ select count(*) from t2;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create SNW lock pending upgrade to X on t2.
# Sending:
alter table t2 drop column c2;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE starts waiting X lock.
# Check that attempt to acquire SW lock on t2 causes waiting.
# Sending:
insert into t2 values (1);;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above INSERT is blocked.
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap ALTER TABLE.
#
-# Switching to connection 'default'.
+connection default;
# Reap INSERT.
commit;
#
@@ -1477,12 +1495,12 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create SNW lock pending upgrade to X.
# Sending:
alter table t1 add column c2 int;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE starts waiting X lock.
# Check that transaction is still able to acquire SR lock.
select count(*) from t1;
@@ -1495,10 +1513,10 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Unblock ALTER TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap ALTER TABLE.
#
-# Switching to connection 'default'.
+connection default;
#
# 3) Check how various locks used within transactional context
# interact with active/pending SNRW lock.
@@ -1510,21 +1528,21 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
lock table t2 write;
#
-# Switching to connection 'default'.
+connection default;
# Attempt to acquire SR should be blocked. It should
# not cause errors as it does not creates deadlock.
# Sending:
select count(*) from t2;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that the above SELECT is blocked
# Unblock SELECT.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reap SELECT.
count(*)
4
@@ -1535,21 +1553,21 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
lock table t2 write;
#
-# Switching to connection 'default'.
+connection default;
# Again attempt to acquire SW should be blocked and should
# not cause any errors.
# Sending:
delete from t2 limit 1;;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Check that the above DELETE is blocked
# Unblock DELETE.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reap DELETE.
commit;
#
@@ -1564,11 +1582,11 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Sending:
lock table t1 write;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until LOCK TABLE is blocked creating pending request for X lock.
# Check that another instance of SR lock is granted without waiting.
select count(*) from t1;
@@ -1581,22 +1599,22 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Unblock LOCK TABLES.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap LOCK TABLES.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
#
# **) Now case when transaction has a SW lock.
#
begin;
delete from t1 limit 1;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Sending:
lock table t1 write;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until LOCK TABLE is blocked creating pending request for X lock.
# Check that both SR and SW locks are granted without waiting
# and errors.
@@ -1607,11 +1625,11 @@ insert into t1 values (1, 1);
# Unblock LOCK TABLES.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap LOCK TABLES.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
#
# 4) Check how various locks used within transactional context
# interact with active/pending X lock.
@@ -1623,7 +1641,7 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Start transaction which will prevent X lock from going away
# immediately.
begin;
@@ -1631,26 +1649,26 @@ select count(*) from t2;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create pending X lock on t2.
# Sending:
rename table t2 to t3;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until RENAME TABLE starts waiting with pending X lock.
# Check that attempt to acquire SR lock on t2 causes waiting.
# Sending:
select count(*) from t2;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above SELECT is blocked.
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap RENAME TABLE.
#
-# Switching to connection 'default'.
+connection default;
# Reap SELECT.
ERROR 42S02: Table 'test.t2' doesn't exist
commit;
@@ -1661,7 +1679,7 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Start transaction which will prevent X lock from going away
# immediately.
begin;
@@ -1669,26 +1687,26 @@ select count(*) from t2;
count(*)
3
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Create pending X lock on t2.
# Sending:
rename table t2 to t3;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until RENAME TABLE starts waiting with pending X lock.
# Check that attempt to acquire SW lock on t2 causes waiting.
# Sending:
delete from t2 limit 1;;
#
-# Switching to connection 'mdl_con2'.
+connection mdl_con2;
# Check that the above DELETE is blocked.
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap RENAME TABLE.
#
-# Switching to connection 'default'.
+connection default;
# Reap DELETE.
ERROR 42S02: Table 'test.t2' doesn't exist
commit;
@@ -1705,11 +1723,11 @@ select count(*) from t1;
count(*)
4
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until RENAME TABLE is blocked creating pending request for X lock.
# Check that another instance of SR lock is granted without waiting.
select count(*) from t1;
@@ -1722,22 +1740,22 @@ ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'default'.
+connection default;
#
# **) The second case is when transaction has a SW lock.
#
begin;
delete from t1 limit 1;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Sending:
rename table t1 to t2;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until RENAME TABLE is blocked creating pending request for X lock.
# Check that both SR and SW locks are granted without waiting
# and errors.
@@ -1748,12 +1766,15 @@ insert into t1 values (1, 1);
# Unblock RENAME TABLE.
commit;
#
-# Switching to connection 'mdl_con1'.
+connection mdl_con1;
# Reap RENAME TABLE.
ERROR 42S01: Table 't2' already exists
#
-# Switching to connection 'default'.
+connection default;
# Clean-up.
+disconnect mdl_con1;
+disconnect mdl_con2;
+disconnect mdl_con3;
set debug_sync= 'RESET';
drop table t1, t2;
#
@@ -1762,6 +1783,9 @@ drop table t1, t2;
# have caused deadlocks.
#
drop table if exists t1, t2;
+connect handler_con1,localhost,root,,;
+connect handler_con2,localhost,root,,;
+connection default;
create table t1 (i int);
create table t2 (j int);
insert into t1 values (1);
@@ -1772,24 +1796,24 @@ insert into t1 values (1);
#
handler t1 open;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
lock table t1 write;
# Upgrade SNRW to X lock.
# Sending:
alter table t1 add column j int;;
#
-# Switching to connection 'handler_con2'.
+connection handler_con2;
# Wait until ALTER is blocked during upgrade.
#
-# Switching to connection 'default'.
+connection default;
# The below statement should not cause deadlock.
handler t1 read first;;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Reap ALTER TABLE.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reap HANDLER READ.
i j
1 NULL
@@ -1801,64 +1825,64 @@ handler t1 close;
#
handler t1 open;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
lock table t1 write, t2 read;
#
-# Switching to connection 'default'.
+connection default;
# Execute statement which will be blocked on table-level lock
# owned by connection 'handler_con1'.
# Sending:
insert into t2 values (1);;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Wait until INSERT is blocked on table-level lock.
# Sending 'alter table t1 drop column j'. It should not cause
# deadlock.
alter table t1 drop column j;
-# Switching to connection 'handler_con2'.
+connection handler_con2;
# Wait until ALTER is blocked during upgrade.
#
-# Switching to connection 'default'.
+connection default;
# Reap INSERT.
ERROR HY000: Wait on a lock was aborted due to a pending exclusive lock
handler t1 close;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Reaping 'alter table t1 drop column j'
unlock tables;
-# Switching to connection 'default'.
+connection default;
# Then, check the scenario in which upgrade of SNRW lock to X
# lock is blocked by HANDLER which is open in connection currently
# waiting to get SW lock on the same table.
#
handler t1 open;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
lock table t1 write;
#
-# Switching to connection 'default'.
+connection default;
# The below insert should be blocked because active SNRW lock on 't1'.
# Sending:
insert into t1 values (1);;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Wait until INSERT is blocked because of SNRW lock.
# The below ALTER TABLE will be blocked because of presence of HANDLER.
# Sending:
alter table t1 add column j int;;
#
-# Switching to connection 'default'.
+connection default;
# INSERT should be chosen as victim for resolving deadlock.
# Reaping INSERT.
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Close HANDLER to unblock ALTER TABLE.
handler t1 close;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Reaping ALTER TABLE.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
#
# Finally, test in which upgrade of SNRW lock to X lock is blocked
# by HANDLER which is open in connection currently waiting to get
@@ -1866,33 +1890,35 @@ unlock tables;
#
handler t1 open;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
lock table t1 write, t2 write;
#
-# Switching to connection 'default'.
+connection default;
# The below insert should be blocked because active SNRW lock on 't1'.
# Sending:
insert into t2 values (1);;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Wait until INSERT is blocked because of SNRW lock.
# The below ALTER TABLE will be blocked because of presence of HANDLER.
# Sending:
alter table t1 drop column j;;
#
-# Switching to connection 'default'.
+connection default;
# INSERT should be chosen as victim for resolving deadlock.
# Reaping INSERT.
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
# Close HANDLER to unblock ALTER TABLE.
handler t1 close;
#
-# Switching to connection 'handler_con1'.
+connection handler_con1;
# Reaping ALTER TABLE.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Clean-up.
+disconnect handler_con1;
+disconnect handler_con2;
drop tables t1, t2;
#
# Test coverage for basic deadlock detection in metadata
@@ -1900,6 +1926,10 @@ drop tables t1, t2;
#
drop tables if exists t0, t1, t2, t3, t4, t5;
set debug_sync= 'RESET';
+connect deadlock_con1,localhost,root,,;
+connect deadlock_con2,localhost,root,,;
+connect deadlock_con3,localhost,root,,;
+connection default;
create table t1 (i int);
create table t2 (j int);
create table t3 (k int);
@@ -1908,19 +1938,19 @@ create table t4 (k int);
# Test for the case in which no deadlock occurs.
#
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
begin;
insert into t1 values (1);
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
begin;
insert into t2 values (1);
#
-# Switching to connection 'default'.
+connection default;
# Send:
rename table t2 to t0, t3 to t2, t0 to t3;;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait until the above RENAME TABLE is blocked because it has to wait
# for 'deadlock_con2' which holds shared metadata lock on 't2'.
# The below statement should wait for exclusive metadata lock
@@ -1929,21 +1959,21 @@ rename table t2 to t0, t3 to t2, t0 to t3;;
# Send:
select * from t2;;
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait until the above SELECT * FROM t2 is starts waiting
# for an exclusive metadata lock to go away.
#
# Unblock RENAME TABLE by releasing shared metadata lock on t2.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reap RENAME TABLE.
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Reap SELECT.
k
#
-# Switching to connection 'default'.
+connection default;
#
# Let us check that in the process of waiting for conflicting lock
# on table 't2' to go away transaction in connection 'deadlock_con1'
@@ -1951,28 +1981,28 @@ k
# Send:
rename table t1 to t0, t3 to t1, t0 to t3;;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait until the above RENAME TABLE is blocked because it has to wait
# for 'deadlock_con1' which should still hold shared metadata lock on
# table 't1'.
# Commit transaction to unblock RENAME TABLE.
commit;
#
-# Switching to connection 'default'.
+connection default;
# Reap RENAME TABLE.
#
# Test for case when deadlock occurs and should be detected immediately.
#
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
begin;
insert into t2 values (2);
#
-# Switching to connection 'default'.
+connection default;
# Send:
rename table t2 to t0, t1 to t2, t0 to t1;;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait until the above RENAME TABLE is blocked because it has to wait
# for 'deadlock_con1' which holds shared metadata lock on 't2'.
#
@@ -1982,50 +2012,50 @@ rename table t2 to t0, t1 to t2, t0 to t1;;
select * from t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
#
-# Switching to connection 'default'.
+connection default;
# Reap RENAME TABLE.
#
# Test for the case in which deadlock also occurs but not immediately.
#
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
begin;
insert into t2 values (1);
#
-# Switching to connection 'default'.
+connection default;
lock table t1 write;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# The below SELECT statement should wait for metadata lock
# on table 't1' and should not produce ER_LOCK_DEADLOCK
# immediately as no deadlock is possible at the moment.
select * from t1;;
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait until the above SELECT * FROM t1 is starts waiting
# for an UNRW metadata lock to go away.
# Send RENAME TABLE statement that will deadlock with the
# SELECT statement and thus should abort the latter.
rename table t1 to t0, t2 to t1, t0 to t2;;
#
-# Switching to connection 'default'.
+connection default;
# Wait till above RENAME TABLE is blocked while holding
# pending X lock on t1.
# Allow the above RENAME TABLE to acquire lock on t1 and
# create pending lock on t2 thus creating deadlock.
unlock tables;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Since the latest RENAME TABLE entered in deadlock with SELECT
# statement the latter should be aborted and emit ER_LOCK_DEADLOCK
# error and transaction should be rolled back.
# Reap SELECT * FROM t1.
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Reap RENAME TABLE ... .
#
-# Switching to connection 'default'.
+connection default;
drop tables t1, t2, t3, t4;
#
# Now, test case which shows that deadlock detection empiric
@@ -2040,17 +2070,17 @@ select * from t1;
i
1
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
begin;
select * from t1;
i
1
#
-# Switching to connection 'default'.
+connection default;
# Send:
alter table t1 add column j int, rename to t2;;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait until the above ALTER TABLE ... RENAME acquires exclusive
# metadata lock on 't2' and starts waiting for connection
# 'deadlock_con1' which holds shared lock on 't1'.
@@ -2060,7 +2090,7 @@ alter table t1 add column j int, rename to t2;;
select * from t2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
#
-# Switching to connection 'default'.
+connection default;
# Reap ALTER TABLE ... RENAME.
drop table t2;
#
@@ -2079,23 +2109,23 @@ set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
# Sending:
select * from t2, t1;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait till SELECT acquires MDL on 't2' and starts waiting for signal.
set debug_sync= 'now WAIT_FOR locked';
# Sending:
lock tables t1 write, t2 write;
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait until LOCK TABLES acquires SNRW lock on 't1' and is blocked
# while trying to acquire SNRW lock on 't1'.
# Resume SELECT execution, this should eventually unblock LOCK TABLES.
set debug_sync= 'now SIGNAL finish';
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Reaping LOCK TABLES.
unlock tables;
#
-# Switching to connection 'default'.
+connection default;
# Reaping SELECT. It succeed and not report ER_LOCK_DEADLOCK error.
j i
drop tables t1, t2;
@@ -2110,7 +2140,7 @@ set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL parked1 WAIT_FOR go1'
# Sending:
alter table t1 add column j int;
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait till ALTER acquires SNW lock and stops.
set debug_sync='now WAIT_FOR parked1';
# Ensure that INSERT is paused once it detects that there is
@@ -2120,7 +2150,7 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL parked2 WAIT_FOR go2';
# Sending:
insert into t1 values ();
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait till INSERT is paused.
set debug_sync='now WAIT_FOR parked2';
# Resume ALTER execution. Eventually it will release its
@@ -2128,13 +2158,13 @@ set debug_sync='now WAIT_FOR parked2';
# satisified.
set debug_sync='now SIGNAL go1';
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER TABLE.
# Add a new request for SNW lock to waiting graph.
# Sending:
alter table t1 drop column j;
#
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait until ALTER is blocked.
# Resume INSERT so it can start deadlock detection.
#
@@ -2148,10 +2178,10 @@ alter table t1 drop column j;
# and ended with ER_LOCK_DEADLOCK error.
set debug_sync='now SIGNAL go2';
#
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Reaping INSERT.
#
-# Switching to connection 'default'.
+connection default;
# Reaping ALTER. It should succeed and not produce ER_LOCK_DEADLOCK.
drop table t1;
#
@@ -2167,30 +2197,30 @@ create table t2(j int);
# waits in MDL and TDC.
#
set debug_sync= 'RESET';
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Start a statement, which will acquire SR metadata lock on t1, open it
# and then stop, before trying to acquire SW lock on t2 and opening it.
set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go';
# Sending:
select * from t1 where i in (select j from t2 for update);
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait till the above SELECT stops.
set debug_sync='now WAIT_FOR parked';
# The below FLUSH TABLES WITH READ LOCK should acquire
# SNW locks on t1 and t2 and wait till SELECT closes t1.
# Sending:
flush tables t1, t2 with read lock;
-# Switching to connection 'deadlock_con3'.
+connection deadlock_con3;
# Wait until FLUSH TABLES WITH t1, t2 READ LOCK starts waiting
# for SELECT to close t1.
# Resume SELECT, so it tries to acquire SW lock on t1 and blocks,
# creating a deadlock. This deadlock should be detected and resolved
# by backing-off SELECT. As a result FTWRL should be able to finish.
set debug_sync='now SIGNAL go';
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Reap FLUSH TABLES WITH READ LOCK.
unlock tables;
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Reap SELECT.
i
#
@@ -2199,29 +2229,29 @@ i
# for flush waits is important.
#
set debug_sync= 'RESET';
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
set debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked WAIT_FOR go';
# The below FLUSH TABLES WITH READ LOCK should acquire
# SNW locks on t1 and t2 and wait on debug sync point.
# Sending:
flush tables t1, t2 with read lock;
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Wait till FLUSH TABLE WITH READ LOCK stops.
set debug_sync='now WAIT_FOR parked';
# Start statement which will acquire SR metadata lock on t1, open
# it and then will block while trying to acquire SW lock on t2.
# Sending:
select * from t1 where i in (select j from t2 for update);
-# Switching to connection 'deadlock_con3'.
+connection deadlock_con3;
# Wait till the above SELECT blocks.
# Resume FLUSH TABLES, so it tries to flush t1, thus creating
# a deadlock. This deadlock should be detected and resolved by
# backing-off SELECT. As a result FTWRL should be able to finish.
set debug_sync='now SIGNAL go';
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Reap FLUSH TABLES WITH READ LOCK.
unlock tables;
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Reap SELECT.
i
#
@@ -2229,81 +2259,89 @@ i
# waiting for MDL and one for TDC.
#
set debug_sync= 'RESET';
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Start a statement which will acquire SR metadata lock on t2, open it
# and then stop, before trying to acquire SR on t1 and opening it.
set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go';
# Sending:
select * from t2, t1;
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Wait till the above SELECT stops.
set debug_sync='now WAIT_FOR parked';
# The below FLUSH TABLES WITH READ LOCK should acquire
# SNW locks on t2 and wait till SELECT closes t2.
# Sending:
flush tables t2 with read lock;
-# Switching to connection 'deadlock_con3'.
+connection deadlock_con3;
# Wait until FLUSH TABLES WITH READ LOCK starts waiting
# for SELECT to close t2.
# The below DROP TABLES should acquire X lock on t1 and start
# waiting for X lock on t2.
# Sending:
drop tables t1, t2;
-# Switching to connection 'default'.
+connection default;
# Wait until DROP TABLES starts waiting for X lock on t2.
# Resume SELECT, so it tries to acquire SR lock on t1 and blocks,
# creating a deadlock. This deadlock should be detected and resolved
# by backing-off SELECT. As a result, FTWRL should be able to finish.
set debug_sync='now SIGNAL go';
-# Switching to connection 'deadlock_con2'.
+connection deadlock_con2;
# Reap FLUSH TABLES WITH READ LOCK.
# Unblock DROP TABLES.
unlock tables;
-# Switching to connection 'deadlock_con3'.
+connection deadlock_con3;
# Reap DROP TABLES.
-# Switching to connection 'deadlock_con1'.
+connection deadlock_con1;
# Reap SELECT. It should emit error about missing table.
ERROR 42S02: Table 'test.t2' doesn't exist
-# Switching to connection 'default'.
+connection default;
set debug_sync= 'RESET';
+disconnect deadlock_con1;
+disconnect deadlock_con2;
+disconnect deadlock_con3;
#
# Test for a scenario in which FLUSH TABLES <list> WITH READ LOCK
# used to erroneously release metadata locks.
#
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection default;
drop tables if exists t1, t2;
set debug_sync= 'RESET';
create table t1(i int);
create table t2(j int);
-# Switching to connection 'con2'.
+connection con2;
set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go';
# The below FLUSH TABLES <list> WITH READ LOCK should acquire
# SNW locks on t1 and t2, open table t1 and block on the debug
# sync point.
# Sending:
flush tables t1, t2 with read lock;
-# Switching to connection 'con1'.
+connection con1;
# Wait till FLUSH TABLES <list> WITH READ LOCK stops.
set debug_sync='now WAIT_FOR parked';
# Start a statement which will flush all tables and thus
# invalidate table t1 open by FLUSH TABLES <list> WITH READ LOCK.
# Sending:
flush tables;
-# Switching to connection 'default'.
+connection default;
# Wait till the above FLUSH TABLES blocks.
# Resume FLUSH TABLES <list> WITH READ LOCK, so it tries to open t2
# discovers that its t1 is obsolete and tries to reopen all tables.
# Such reopen should not cause releasing of SNW metadata locks
# which would result in assertion failures.
set debug_sync='now SIGNAL go';
-# Switching to connection 'con2'.
+connection con2;
# Reap FLUSH TABLES <list> WITH READ LOCK.
unlock tables;
-# Switching to connection 'con1'.
+connection con1;
# Reap FLUSH TABLES.
# Clean-up.
-# Switching to connection 'default'.
+connection default;
drop tables t1, t2;
set debug_sync= 'RESET';
+disconnect con1;
+disconnect con2;
#
# Test for bug #46748 "Assertion in MDL_context::wait_for_locks()
# on INSERT + CREATE TRIGGER".
@@ -2312,6 +2350,9 @@ drop tables if exists t1, t2, t3, t4, t5;
# Let us simulate scenario in which we open some tables from extended
# part of prelocking set but then encounter conflicting metadata lock,
# so have to back-off and wait for it to go away.
+connect con1root,localhost,root,,test,,;
+connect con2root,localhost,root,,test,,;
+connection default;
create table t1 (i int);
create table t2 (j int);
create table t3 (k int);
@@ -2321,31 +2362,33 @@ insert into t2 values (new.i);
create trigger t2_bi before insert on t2 for each row
insert into t3 values (new.j);
#
-# Switching to connection 'con1root'.
+connection con1root;
lock tables t4 read;
#
-# Switching to connection 'con2root'.
+connection con2root;
# Send :
rename table t3 to t5, t4 to t3;;
#
-# Switching to connection 'default'.
+connection default;
# Wait until the above RENAME TABLE adds pending requests for exclusive
# metadata lock on its tables and blocks due to 't4' being used by LOCK
# TABLES.
# Send :
insert into t1 values (1);;
#
-# Switching to connection 'con1root'.
+connection con1root;
# Wait until INSERT statement waits due to encountering pending
# exclusive metadata lock on 't3'.
unlock tables;
#
-# Switching to connection 'con2root'.
+connection con2root;
# Reap RENAME TABLE.
#
-# Switching to connection 'default'.
+connection default;
# Reap INSERT.
# Clean-up.
+disconnect con1root;
+disconnect con2root;
drop tables t1, t2, t3, t5;
#
# Bug#42546 - Backup: RESTORE fails, thinking it finds an existing table
@@ -2353,15 +2396,16 @@ drop tables t1, t2, t3, t5;
DROP TABLE IF EXISTS t1;
set @save_log_output=@@global.log_output;
set global log_output=file;
+connect con2, localhost, root,,;
#
# Test 1: CREATE TABLE
#
-# Connection 2
+connection con2;
# Start insert on the not-yet existing table
# Wait after taking the MDL lock
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
INSERT INTO t1 VALUES(1,"def");
-# Connection 1
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Now INSERT has a MDL on the non-existent table t1.
#
@@ -2369,10 +2413,10 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL finish';
# Try to create that table.
CREATE TABLE t1 (c1 INT, c2 VARCHAR(100), KEY(c1));
-# Connection 2
# Insert fails
+connection con2;
ERROR 42S02: Table 'test.t1' doesn't exist
-# Connection 1
+connection default;
SET DEBUG_SYNC= 'RESET';
SHOW TABLES;
Tables_in_test
@@ -2382,12 +2426,12 @@ DROP TABLE IF EXISTS t1;
# Test 2: CREATE TABLE LIKE
#
CREATE TABLE t2 (c1 INT, c2 VARCHAR(100), KEY(c1));
-# Connection 2
+connection con2;
# Start insert on the not-yet existing table
# Wait after taking the MDL
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
INSERT INTO t1 VALUES(1,"def");
-# Connection 1
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Now INSERT has a MDL on the non-existent table t1.
#
@@ -2395,16 +2439,17 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL finish';
# Try to create that table.
CREATE TABLE t1 LIKE t2;
-# Connection 2
# Insert fails
+connection con2;
ERROR 42S02: Table 'test.t1' doesn't exist
-# Connection 1
+connection default;
SET DEBUG_SYNC= 'RESET';
SHOW TABLES;
Tables_in_test
t1
t2
DROP TABLE t2;
+disconnect con2;
DROP TABLE IF EXISTS t1;
set global log_output=@save_log_output;
#
@@ -2412,20 +2457,24 @@ set global log_output=@save_log_output;
# FOR UPDATE"
#
drop tables if exists t1, t2;
+connect con46044, localhost, root,,;
+connect con46044_2, localhost, root,,;
+connect con46044_3, localhost, root,,;
+connection default;
create table t1 (i int);
insert into t1 values(1);
# Let us check that we won't deadlock if during filling
# of I_S table we encounter conflicting metadata lock
# which owner is in its turn waiting for our connection.
lock tables t1 read;
-# Switching to connection 'con46044_2'.
+connection con46044_2;
# Sending:
update t1 set i = 2;
-# Switching to connection 'con46044'.
+connection con46044;
# Waiting until UPDATE t1 SET ... is blocked.
# Sending:
create table t2 select * from t1;;
-# Switching to connection 'default'.
+connection default;
# Waiting until CREATE TABLE ... SELECT ... is blocked.
# First let us check that SHOW FIELDS/DESCRIBE doesn't
# gets blocked and emits and error.
@@ -2449,11 +2498,12 @@ table_name table_type auto_increment table_comment
t2 BASE TABLE NULL Table 'test'.'t2' was skipped since its definition is being modified by concurrent DDL statement
Warnings:
Warning 1684 Table 'test'.'t2' was skipped since its definition is being modified by concurrent DDL statement
-# Switching to connection 'default'.
+connection default;
unlock tables;
-# Switching to connection 'con46044'.
+connection con46044;
# Reaping CREATE TABLE ... SELECT ... .
drop table t2;
+connection con46044_2;
# Reaping UPDATE t1 statement
#
# Let us also check that queries to I_S wait for conflicting metadata
@@ -2462,84 +2512,90 @@ drop table t2;
# and ease of use points of view.
#
# We check same three queries to I_S in this new situation.
-# Switching to connection 'con46044_2'.
+connection con46044_2;
lock tables t1 read;
-# Switching to connection 'con46044_3'.
+connection con46044_3;
# Sending:
update t1 set i = 3;
-# Switching to connection 'con46044'.
+connection con46044;
# Waiting until UPDATE t1 SET ... is blocked.
# Sending:
create table t2 select * from t1;;
-# Switching to connection 'default'.
+connection default;
# Waiting until CREATE TABLE ... SELECT ... is blocked.
# Let us check that SHOW FIELDS/DESCRIBE gets blocked.
# Sending:
show fields from t2;;
-# Switching to connection 'con46044_2'.
+connection con46044_2;
# Wait until SHOW FIELDS gets blocked.
unlock tables;
-# Switching to connection 'con46044'.
+connection con46044;
# Reaping CREATE TABLE ... SELECT ... .
-# Switching to connection 'default'.
+connection default;
# Reaping SHOW FIELDS ...
Field Type Null Key Default Extra
i int(11) YES NULL
drop table t2;
+connection con46044_3;
# Reaping UPDATE t1 statement
-# Switching to connection 'con46044_2'.
+connection con46044_2;
lock tables t1 read;
-# Switching to connection 'con46044_3'.
+connection con46044_3;
# Sending:
update t1 set i = 4;
-# Switching to connection 'con46044'.
+connection con46044;
# Waiting until UPDATE t1 SET ... is blocked.
# Sending:
create table t2 select * from t1;;
-# Switching to connection 'default'.
+connection default;
# Waiting until CREATE TABLE ... SELECT ... is blocked.
# Check that I_S query which reads only .FRMs gets blocked.
# Sending:
select column_name from information_schema.columns where table_schema='test' and table_name='t2';;
-# Switching to connection 'con46044_2'.
+connection con46044_2;
# Wait until SELECT COLUMN_NAME FROM I_S.COLUMNS gets blocked.
unlock tables;
-# Switching to connection 'con46044'.
+connection con46044;
# Reaping CREATE TABLE ... SELECT ... .
-# Switching to connection 'default'.
+connection default;
# Reaping SELECT COLUMN_NAME FROM I_S.COLUMNS
column_name
i
drop table t2;
+connection con46044_3;
# Reaping UPDATE t1 statement
-# Switching to connection 'con46044_2'.
+connection con46044_2;
lock tables t1 read;
-# Switching to connection 'con46044_3'.
+connection con46044_3;
# Sending:
update t1 set i = 5;
-# Switching to connection 'con46044'.
+connection con46044;
# Waiting until UPDATE t1 SET ... is blocked.
# Sending:
create table t2 select * from t1;;
-# Switching to connection 'default'.
+connection default;
# Waiting until CREATE TABLE ... SELECT ... is blocked.
# Finally, check that I_S query which does full-blown table open
# also gets blocked.
# Sending:
select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t2';;
-# Switching to connection 'con46044_2'.
+connection con46044_2;
# Wait until SELECT ... FROM I_S.TABLES gets blocked.
unlock tables;
-# Switching to connection 'con46044'.
+connection con46044;
# Reaping CREATE TABLE ... SELECT ... .
-# Switching to connection 'default'.
+connection default;
# Reaping SELECT ... FROM I_S.TABLES
table_name table_type auto_increment table_comment
t2 BASE TABLE NULL
drop table t2;
+connection con46044_3;
# Reaping UPDATE t1 statement
-# Switching to connection 'default'.
+connection default;
# Clean-up.
+disconnect con46044;
+disconnect con46044_2;
+disconnect con46044_3;
drop table t1;
#
# Test for bug #46273 "MySQL 5.4.4 new MDL: Bug#989 is not fully fixed
@@ -2547,6 +2603,8 @@ drop table t1;
#
drop table if exists t1;
set debug_sync= 'RESET';
+connect con46273,localhost,root,,test,,;
+connection default;
create table t1 (c1 int primary key, c2 int, c3 int);
insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0);
begin;
@@ -2554,11 +2612,11 @@ select * from t1 where c2 = 3;
c1 c2 c3
3 3 0
#
-# Switching to connection 'con46273'.
+connection con46273;
set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL alter_table_locked WAIT_FOR alter_go';
alter table t1 add column e int, rename to t2;;
#
-# Switching to connection 'default'.
+connection default;
set debug_sync='now WAIT_FOR alter_table_locked';
set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go';
# The below statement should get ER_LOCK_DEADLOCK error
@@ -2567,10 +2625,11 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go';
update t1 set c3=c3+1 where c2 = 3;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
#
-# Switching to connection 'con46273'.
+connection con46273;
# Reap ALTER TABLE.
#
-# Switching to connection 'default'.
+connection default;
+disconnect con46273;
# Clean-up.
set debug_sync= 'RESET';
drop table t2;
@@ -2579,64 +2638,70 @@ drop table t2;
# and DML".
#
drop tables if exists t1;
+connect con46673, localhost, root,,;
+connection default;
create table t1 (i int);
-# Switching to connection 'con46673'.
+connection con46673;
begin;
insert into t1 values (1);
-# Switching to connection 'default'.
+connection default;
# Statement below should not get blocked. And if after some
# changes to code it is there should not be a deadlock between
# it and transaction from connection 'con46673'.
flush tables with read lock;
unlock tables;
-# Switching to connection 'con46673'.
+connection con46673;
delete from t1 where i = 1;
commit;
-# Switching to connection 'default'.
+connection default;
# Clean-up
+disconnect con46673;
drop table t1;
#
# Bug#48210 FLUSH TABLES WITH READ LOCK deadlocks
# against concurrent CREATE PROCEDURE
#
+connect con2, localhost, root;
# Test 1: CREATE PROCEDURE
-# Connection 1
+connection default;
# Start CREATE PROCEDURE and open mysql.proc
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait';
CREATE PROCEDURE p1() SELECT 1;
-# Connection 2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
# Check that FLUSH must wait to get the GRL
# and let CREATE PROCEDURE continue
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK;
-# Connection 1
-# Connection 2
+connection default;
+connection con2;
UNLOCK TABLES;
-# Connection 1
+connection default;
SET DEBUG_SYNC= 'RESET';
# Test 2: DROP PROCEDURE
+connection default;
# Start DROP PROCEDURE and open tables
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait';
DROP PROCEDURE p1;
-# Connection 2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
# Check that FLUSH must wait to get the GRL
# and let DROP PROCEDURE continue
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
FLUSH TABLES WITH READ LOCK;
-# Connection 1
+connection default;
# Once FLUSH TABLES WITH READ LOCK starts waiting
# DROP PROCEDURE will be waked up and will drop
# procedure. Global read lock will be granted after
# this statement ends.
#
# Reaping DROP PROCEDURE.
-# Connection 2
+connection con2;
# Reaping FTWRL.
UNLOCK TABLES;
-# Connection 1
+connection default;
SET DEBUG_SYNC= 'RESET';
+disconnect con2;
#
# Bug#50786 Assertion `thd->mdl_context.trans_sentinel() == __null'
# failed in open_ltable()
@@ -2644,6 +2709,10 @@ SET DEBUG_SYNC= 'RESET';
# Supress warnings written to the log file
call mtr.add_suppression("Wait on a lock was aborted due to a pending exclusive lock");
DROP TABLE IF EXISTS t1, t2;
+connect con1,localhost,root;
+connect con2,localhost,root;
+connect con3,localhost,root;
+connection default;
CREATE TABLE t1 (i INT);
CREATE TABLE t2 (i INT);
SET @old_general_log= @@global.general_log;
@@ -2653,34 +2722,47 @@ SET @@global.log_output= 'TABLE';
SET @old_sql_log_off= @@session.sql_log_off;
SET @@session.sql_log_off= 1;
# connection: con1
+connection con1;
HANDLER t1 OPEN;
# connection: con3
+connection con3;
SET @@session.sql_log_off= 1;
# connection: con2
+connection con2;
SET DEBUG_SYNC= 'thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
# Sending:
SELECT 1;
# connection: con3
+connection con3;
SET DEBUG_SYNC= 'now WAIT_FOR parked';
# connection: con1
+connection con1;
# Sending:
SELECT 1;
# connection: con3
+connection con3;
ALTER TABLE t1 ADD COLUMN j INT;
# connection: default
+connection default;
SET DEBUG_SYNC= 'now SIGNAL go';
# connection: con1
+connection con1;
# Reaping SELECT 1
1
1
HANDLER t1 CLOSE;
# connection: con2
+connection con2;
# Reaping SELECT 1
1
1
# connection: default
+connection default;
DROP TABLE t1, t2;
SET DEBUG_SYNC= 'RESET';
+disconnect con1;
+disconnect con2;
+disconnect con3;
SET @@global.general_log= @old_general_log;
SET @@global.log_output= @old_log_output;
SET @@session.sql_log_off= @old_sql_log_off;
@@ -2691,12 +2773,15 @@ SET @@session.sql_log_off= @old_sql_log_off;
#
drop table if exists t1;
set debug_sync= 'RESET';
+connect con50913_1,localhost,root;
+connect con50913_2,localhost,root;
+connection default;
create table t1 (i int) engine=InnoDB;
-# Switching to connection 'con50913_1'.
+connection con50913_1;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL parked WAIT_FOR go';
# Sending:
alter table t1 add column j int, ALGORITHM=COPY;
-# Switching to connection 'default'.
+connection default;
# Wait until ALTER TABLE gets blocked on a sync point after
# acquiring thr_lock.c lock.
set debug_sync= 'now WAIT_FOR parked';
@@ -2704,14 +2789,16 @@ set debug_sync= 'now WAIT_FOR parked';
# thr_lock.c lock.
# Sending:
truncate table t1;
-# Switching to connection 'con50913_2'.
+connection con50913_2;
# Wait until TRUNCATE TABLE is blocked on MDL lock.
# Unblock ALTER TABLE.
set debug_sync= 'now SIGNAL go';
-# Switching to connection 'con50913_1'.
+connection con50913_1;
# Reaping ALTER TABLE.
-# Switching to connection 'default'.
+connection default;
# Reaping TRUNCATE TABLE.
+disconnect con50913_1;
+disconnect con50913_2;
set debug_sync= 'RESET';
drop table t1;
#
@@ -2723,30 +2810,34 @@ drop table t1;
# should be performed.
drop table if exists t1;
set debug_sync= 'RESET';
+connect con1,localhost,root;
+connect con2,localhost,root;
+connect con3,localhost,root;
+connection default;
create table t1 (i int);
-# Switching to connection 'con1'.
+connection con1;
begin;
select * from t1;
i
-# Switching to connection 'con2'.
+connection con2;
begin;
select * from t1;
i
-# Switching to connection 'default'.
+connection default;
# Start ALTER TABLE which will acquire SNW lock and
# table lock and get blocked on sync point.
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL parked WAIT_FOR go';
# Sending:
alter table t1 add column j int;
-# Switching to connection 'con1'.
+connection con1;
# Wait until ALTER TABLE gets blocked on a sync point.
set debug_sync= 'now WAIT_FOR parked';
# Sending:
insert into t1 values (1);
-# Switching to connection 'con2'.
+connection con2;
# Sending:
insert into t1 values (1);
-# Switching to connection 'con3'.
+connection con3;
# Wait until both 'con1' and 'con2' are blocked trying to acquire
# SW lock on the table.
# Unblock ALTER TABLE. Since it will try to upgrade SNW to X lock
@@ -2754,17 +2845,21 @@ insert into t1 values (1);
# should be found and DML statements in both 'con1' and 'con2'
# should be aborted with ER_LOCK_DEADLOCK errors.
set debug_sync= 'now SIGNAL go';
-# Switching to connection 'con1'.
+connection con1;
# Reaping INSERT. It should end with ER_LOCK_DEADLOCK error and
# not wait indefinitely (as it happened before the bugfix).
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
commit;
-# Switching to connection 'con2'.
+connection con2;
# Reaping INSERT.
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
commit;
-# Switching to connection 'default'.
+connection default;
# Reap ALTER TABLE.
+disconnect con1;
+disconnect con2;
+disconnect con3;
+connection default;
set debug_sync= 'RESET';
drop table t1;
#
@@ -2772,137 +2867,151 @@ drop table t1;
#
# Ensure that a acquired lock is not given up due to a conflict.
#
+connect con1,localhost,root,,test,,;
+connect con2,localhost,root,,test,,;
+connect con3,localhost,root,,test,,;
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
-# Connection: con1
+connection con1;
LOCK TABLES t1 WRITE;
SET debug_sync='upgrade_lock_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
TRUNCATE TABLE t1;
-# Connection: default
+connection default;
SET debug_sync='now WAIT_FOR parked_truncate';
-# Connection: con2
+connection con2;
SET debug_sync='after_open_table_ignore_flush SIGNAL parked_show WAIT_FOR go_show';
SHOW FIELDS FROM t1;
-# Connection: default
+connection default;
SET debug_sync='now WAIT_FOR parked_show';
-# Connection: con3
+connection con3;
SET debug_sync='after_flush_unlock SIGNAL parked_flush WAIT_FOR go_flush';
FLUSH TABLES t1;
-# Connection: default
+connection default;
SET debug_sync='now WAIT_FOR parked_flush';
SET debug_sync='now SIGNAL go_truncate';
# Ensure that truncate waits for a exclusive lock
SET debug_sync= 'now SIGNAL go_show';
-# Connection: con1 (TRUNCATE)
+connection con1;
# Reaping...
UNLOCK TABLES;
-# Connection: con2 (SHOW FIELDS FROM t1)
+connection con2;
# Reaping...
Field Type Null Key Default Extra
a int(11) YES NULL
-# Connection: default
+connection default;
SET debug_sync= 'now SIGNAL go_flush';
-# Connection: con3 (FLUSH TABLES t1)
+connection con3;
# Reaping...
-# Connection: default
+disconnect con1;
+disconnect con2;
+disconnect con3;
+connection default;
SET debug_sync= 'RESET';
DROP TABLE t1;
#
# Bug#52856 concurrent show columns or show full columns causes a crash!!!
#
CREATE TABLE t1(a CHAR(255));
+connect con1, localhost, root;
SET DEBUG_SYNC= "get_schema_column SIGNAL waiting WAIT_FOR completed";
SHOW FULL COLUMNS FROM t1;
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR waiting";
SHOW FULL COLUMNS FROM t1;
Field Type Collation Null Key Default Extra Privileges Comment
a char(255) latin1_swedish_ci YES NULL #
SET DEBUG_SYNC= "now SIGNAL completed";
+connection con1;
Field Type Collation Null Key Default Extra Privileges Comment
a char(255) latin1_swedish_ci YES NULL #
+connection default;
DROP TABLE t1;
+disconnect con1;
#
# Tests for schema-scope locks
#
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
+connect con2, localhost, root;
+connect con3, localhost, root;
# Test 1:
# CREATE DATABASE blocks database DDL on the same database, but
# not database DDL on different databases. Tests X vs X lock.
#
-# Connection default
+connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
CREATE DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
CREATE DATABASE db1;
-# Connection con3
+connection con3;
CREATE DATABASE db2;
ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: CREATE DATABASE db1
-# Connection con2
+connection con2;
# Reaping: CREATE DATABASE db1
ERROR HY000: Can't create database 'db1'; database exists
# Test 2:
# ALTER DATABASE blocks database DDL on the same database, but
# not database DDL on different databases. Tests X vs X lock.
#
-# Connection default
+connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
ALTER DATABASE db1 DEFAULT CHARACTER SET utf8;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
ALTER DATABASE db1 DEFAULT CHARACTER SET utf8;
-# Connection con3
+connection con3;
CREATE DATABASE db2;
ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
-# Connection con2
+connection con2;
# Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
-# Connection default
+connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
ALTER DATABASE db1 DEFAULT CHARACTER SET utf8;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
DROP DATABASE db1;
-# Connection con3
+connection con3;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
-# Connection con2
+connection con2;
# Reaping: DROP DATABASE db1
CREATE DATABASE db1;
# Test 3:
# Two ALTER..UPGRADE of the same database are mutually exclusive, but
# two ALTER..UPGRADE of different databases are not. Tests X vs X lock.
#
-# Connection default
+connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME;
-# Connection con3
+connection con3;
ALTER DATABASE `#mysql50#a-b-c-d` UPGRADE DATA DIRECTORY NAME;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: ALTER DATABASE '#mysql50#a-b-c' UPGRADE DATA DIRECTORY NAME
-# Connection con2
+connection con2;
# Reaping: ALTER DATABASE '#mysql50#a-b-c' UPGRADE DATA DIRECTORY NAME
ERROR 42000: Unknown database '#mysql50#a-b-c'
DROP DATABASE `a-b-c`;
@@ -2911,96 +3020,96 @@ DROP DATABASE `a-b-c-d`;
# DROP DATABASE blocks database DDL on the same database, but
# not database DDL on different databases. Tests X vs X lock.
#
-# Connection default
+connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
DROP DATABASE db1;
-# Connection con3
+connection con3;
CREATE DATABASE db2;
ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
-# Connection con2
+connection con2;
# Reaping: DROP DATABASE db1
ERROR HY000: Can't drop database 'db1'; database doesn't exist
-# Connection default
+connection default;
CREATE DATABASE db1;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
ALTER DATABASE db1 DEFAULT CHARACTER SET utf8;
-# Connection con3
+connection con3;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
-# Connection con2
+connection con2;
# Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
Got one of the listed errors
# Test 5:
# Locked database name prevents CREATE of tables in that database.
# Tests X vs IX lock.
#
-# Connection default
+connection default;
CREATE DATABASE db1;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
CREATE TABLE db1.t1 (a INT);
-# Connection con3
+connection con3;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
-# Connection con2
+connection con2;
# Reaping: CREATE TABLE db1.t1 (a INT)
ERROR 42000: Unknown database 'db1'
# Test 6:
# Locked database name prevents RENAME of tables to/from that database.
# Tests X vs IX lock.
#
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
RENAME TABLE db1.t1 TO test.t1;
-# Connection con3
+connection con3;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
-# Connection con2
+connection con2;
# Reaping: RENAME TABLE db1.t1 TO test.t1
ERROR 42S02: Table 'db1.t1' doesn't exist
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE TABLE test.t2 (a INT);
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
RENAME TABLE test.t2 TO db1.t2;
-# Connection con3
+connection con3;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
-# Connection con2
+connection con2;
# Reaping: RENAME TABLE test.t2 TO db1.t2
Got one of the listed errors
DROP TABLE test.t2;
@@ -3008,24 +3117,26 @@ DROP TABLE test.t2;
# Locked database name prevents DROP of tables in that database.
# Tests X vs IX lock.
#
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# Sending:
DROP TABLE db1.t1;
-# Connection con3
+connection con3;
SET DEBUG_SYNC= 'now SIGNAL blocked';
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
-# Connection con2
+connection con2;
# Reaping: DROP TABLE db1.t1
ERROR 42S02: Unknown table 'db1.t1'
-# Connection default
+connection default;
+disconnect con2;
+disconnect con3;
SET DEBUG_SYNC= 'RESET';
#
# End of tests for schema-scope locks
@@ -3035,30 +3146,34 @@ SET DEBUG_SYNC= 'RESET';
#
CREATE DATABASE db1;
CREATE TABLE db1.t1(a INT);
-# Connection default
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection default;
FLUSH TABLE WITH READ LOCK;
-# Connection con2
+connection con2;
CREATE TABLE db1.t2(a INT);
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con2
+connection con2;
# Reaping CREATE TABLE db1.t2(a INT)
-# Connection default
+connection default;
FLUSH TABLE WITH READ LOCK;
-# Connection con2
+connection con2;
ALTER DATABASE db1 DEFAULT CHARACTER SET utf8;
-# Connection default
+connection default;
UNLOCK TABLES;
-# Connection con2
+connection con2;
# Reaping ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
-# Connection default
+connection default;
FLUSH TABLE WITH READ LOCK;
-# Connection con2
+connection con2;
FLUSH TABLE WITH READ LOCK;
UNLOCK TABLES;
-# Connection default
+connection default;
UNLOCK TABLES;
DROP DATABASE db1;
+disconnect con2;
+disconnect con3;
#
# Bug#56292 Deadlock with ALTER TABLE and MERGE tables
#
@@ -3068,35 +3183,43 @@ CREATE TABLE t2(a INT) engine=MyISAM;
CREATE TABLE m1(a INT) engine=MERGE UNION=(t1, t2);
INSERT INTO t1 VALUES (1), (2);
INSERT INTO t2 VALUES (3), (4);
-# Connection con1
+connect con1, localhost, root;
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection con1;
# We need EXECUTE 2 since ALTER TABLE does SU => SNW => X and we want
# to stop at the second upgrade.
SET DEBUG_SYNC= 'mdl_upgrade_lock SIGNAL upgrade WAIT_FOR continue EXECUTE 2';
# Sending:
ALTER TABLE m1 engine=MERGE UNION=(t2, t1);
-# Connection con2
+connection con2;
# Waiting for ALTER TABLE to try lock upgrade
SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
SET DEBUG_SYNC= 'now SIGNAL continue';
SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
# Sending:
DELETE FROM t2 WHERE a = 3;
-# Connection default
+connection con3;
# Check that DELETE is waiting on a metadata lock and not a table lock.
# Now that DELETE blocks on a metadata lock, we should be able to do
# SELECT * FROM m1 here. SELECT used to be blocked by a DELETE table
# lock request.
SELECT * FROM m1 WHERE a < 3;
+connection default;
# Resuming ALTER TABLE
SET DEBUG_SYNC= 'now SIGNAL continue';
-# Connection con1
+connection con1;
# Reaping: ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
-# Connection con2
+connection con2;
# Reaping: DELETE FROM t2 WHERE a = 3
+connection con3;
# Reaping: SELECT * FROM m1 WHERE a < 3
a
1
2
-# Connection default
+connection default;
DROP TABLE m1, t1, t2;
SET DEBUG_SYNC= 'RESET';
+disconnect con1;
+disconnect con2;
+disconnect con3;
diff --git a/mysql-test/r/merge-big.result b/mysql-test/r/merge-big.result
index b17140a7c79..3b6e116986e 100644
--- a/mysql-test/r/merge-big.result
+++ b/mysql-test/r/merge-big.result
@@ -6,11 +6,11 @@ drop table if exists t1,t2,t3,t4,t5,t6;
#
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
LOCK TABLE t1 WRITE;
-# connection con1
+connect con1,localhost,root,,;
SET @orig_debug=@@debug;
SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open";
INSERT INTO t1 VALUES (1);
-# connection default
+connection default;
# Let INSERT go into thr_multi_lock().
# Kick INSERT out of thr_multi_lock().
FLUSH TABLES;
@@ -21,7 +21,8 @@ FLUSH TABLES;
SELECT * FROM t1;
c1
UNLOCK TABLES;
-# connection con1
+connection con1;
SET GLOBAL debug_dbug=@orig_debug;
-# connection default
+disconnect con1;
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 804313af701..93b16896380 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -1121,31 +1121,46 @@ c1
2
UNLOCK TABLES;
DROP TABLE t1, t2, t3, t4;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection default;
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
CREATE TABLE t2 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1) INSERT_METHOD= LAST;
REPAIR TABLE t1;
+connection con1;
INSERT INTO t2 VALUES (1);
+connection default;
Table Op Msg_type Msg_text
test.t1 repair status OK
DROP TABLE t1, t2;
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
CREATE TABLE t2 (c1 INT) ENGINE= MRG_MYISAM UNION= (t1) INSERT_METHOD= LAST;
LOCK TABLE t1 WRITE;
+connection con1;
INSERT INTO t2 VALUES (1);
+connection default;
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
UNLOCK TABLES;
+connection con1;
+connection default;
DROP TABLE t1, t2;
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
LOCK TABLE t1 WRITE;
+connection con1;
INSERT INTO t1 VALUES (1);
+connection default;
FLUSH TABLES;
FLUSH TABLES;
SELECT * FROM t1;
c1
UNLOCK TABLES;
+connection con1;
+connection default;
DROP TABLE t1;
+disconnect con1;
+disconnect con2;
#
# Extra tests for Bug#26379 - Combination of FLUSH TABLE and
# REPAIR TABLE corrupts a MERGE table
@@ -1964,9 +1979,14 @@ COUNT(*)
SELECT COUNT(*) FROM t3;
COUNT(*)
210
+connect con1,localhost,root,,;
SELECT COUNT(DISTINCT a1.id) FROM t3 AS a1, t3 AS a2
WHERE a1.id = a2.id GROUP BY a2.grp;
+connection default;
TRUNCATE TABLE t1;
+connection con1;
+disconnect con1;
+connection default;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -2824,10 +2844,15 @@ INSERT INTO t2 VALUES(2);
INSERT INTO t3 VALUES(3);
INSERT INTO t4 VALUES(4);
INSERT INTO t5 VALUES(5);
+connect con1,localhost,root,,;
UPDATE t2, tm1 SET t2.c1=f1();
+connection default;
FLUSH TABLES;
FLUSH TABLES;
UNLOCK TABLES;
+connection con1;
+disconnect con1;
+connection default;
SELECT * FROM tm1;
c1
1
@@ -3556,7 +3581,7 @@ DROP TABLE t1, t2, t3, t4, m1, m2;
# HANDLER ... OPEN.
# The general case.
DROP TABLE IF EXISTS t1, t2, t3;
-# Connection con1.
+connect con1,localhost,root,,;
CREATE TABLE t1 (c1 int);
CREATE TABLE t2 (c1 int);
CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
@@ -3564,10 +3589,11 @@ START TRANSACTION;
HANDLER t3 OPEN;
ERROR HY000: Storage engine MRG_MyISAM of the table `test`.`t3` doesn't have this option
DROP TABLE t1, t2, t3;
-# Connection default.
-# Disconnecting con1, all mdl_tickets must have been released.
+connection default;
+# all mdl_tickets must have been released.
+disconnect con1;
# The bug-specific case.
-# Connection con1.
+connect con1,localhost,root,,;
CREATE TABLE t1 (c1 int);
CREATE TABLE t2 (c1 int);
CREATE TABLE t3 (c1 int) ENGINE = MERGE UNION (t1,t2);
@@ -3576,8 +3602,9 @@ START TRANSACTION;
HANDLER t3 OPEN;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP TABLE t1, t3;
-# Connection default.
-# Disconnecting con1, all mdl_tickets must have been released.
+connection default;
+# all mdl_tickets must have been released.
+disconnect con1;
#
# A test case for Bug#47648 main.merge fails sporadically
#
diff --git a/mysql-test/r/mix2_myisam.result b/mysql-test/r/mix2_myisam.result
index bf706b1445d..25434b71ca2 100644
--- a/mysql-test/r/mix2_myisam.result
+++ b/mysql-test/r/mix2_myisam.result
@@ -2064,23 +2064,36 @@ delete t1 from t1,t2 where f1=f3 and f4='cc';
select * from t1;
f1 f2
drop table t1,t2;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, c int, d int, primary key(a)) engine=MyISAM;
insert into t1(a) values (1),(2),(3);
commit;
+connection b;
set autocommit = 0;
update t1 set b = 5 where a = 2;
commit;
+connection a;
create trigger t1t before insert on t1 for each row begin set NEW.b = NEW.a * 10 + 5, NEW.c = NEW.a / 10; end |
set autocommit = 0;
+connection a;
insert into t1(a) values (10),(20),(30),(40),(50),(60),(70),(80),(90),(100),
(11),(21),(31),(41),(51),(61),(71),(81),(91),(101),
(12),(22),(32),(42),(52),(62),(72),(82),(92),(102),
(13),(23),(33),(43),(53),(63),(73),(83),(93),(103),
(14),(24),(34),(44),(54),(64),(74),(84),(94),(104);
+connection b;
commit;
+connection a;
commit;
drop trigger t1t;
drop table t1;
+disconnect a;
+disconnect b;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, c int, d int, primary key(a)) engine=MyISAM;
create table t2(a int not null, b int, c int, d int, primary key(a)) engine=MyISAM;
create table t3(a int not null, b int, c int, d int, primary key(a)) engine=MyISAM;
@@ -2113,6 +2126,7 @@ update t3 set b = b + 5 where a = 1;
update t4 set b = b + 5 where a = 1;
insert into t5(a) values(20);
commit;
+connection b;
set autocommit = 0;
insert into t1(a) values(7);
insert into t2(a) values(8);
@@ -2124,6 +2138,9 @@ drop trigger t2t;
drop trigger t3t;
drop trigger t4t;
drop table t1, t2, t3, t4, t5;
+connection default;
+disconnect a;
+disconnect b;
create table t1(a date) engine=MyISAM;
create table t2(a date, key(a)) engine=MyISAM;
insert into t1 values('2005-10-01');
@@ -2148,20 +2165,29 @@ select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
where mm.id is null lock in share mode;
id f_id f
drop table t1,t2;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine=MyISAM;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1;
+connection b;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select * from t1 where a = 7 and b = 3 for update;
a b
7 3
+connection a;
commit;
+connection b;
commit;
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
CREATE TABLE t1 ( a int ) ENGINE=MyISAM;
BEGIN;
INSERT INTO t1 VALUES (1);
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index c680339536b..204596bf20b 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -418,6 +418,8 @@ select * from t2;
c2_id c2_p_id c2_note c2_active
1 1 A Note 1
drop table t1, t2;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key (a));
create table mysqltest.t2 (a int, b int, primary key (a));
@@ -425,12 +427,18 @@ create table mysqltest.t3 (a int, b int, primary key (a));
create user mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,mysqltest,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user1;
update t1, t2 set t1.b=1 where t1.a=t2.a;
update t1, t2 set t1.b=(select t3.b from t3 where t1.a=t3.a) where t1.a=t2.a;
+connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
delete from mysql.user where user=_binary'mysqltest_1';
drop database mysqltest;
+connection default;
+disconnect user1;
+disconnect root;
create table t1 (a int, primary key (a));
create table t2 (a int, primary key (a));
create table t3 (a int, primary key (a));
@@ -487,10 +495,19 @@ insert into t1 values (1, 2), (2, 3), (3, 4);
create table t2 (a int);
insert into t2 values (10), (20), (30);
create view v1 as select a as b, a/10 as a from t2;
+connect locker,localhost,root,,test;
+connection locker;
lock table t1 write;
+connect changer,localhost,root,,test;
+connection changer;
alter table t1 add column c int default 100 after a;
+connect updater,localhost,root,,test;
+connection updater;
update t1, v1 set t1.b=t1.a+t1.b+v1.b where t1.a=v1.a;
+connection locker;
unlock tables;
+connection changer;
+connection updater;
select * from t1;
a c b
1 100 13
@@ -503,6 +520,10 @@ a
30
drop view v1;
drop table t1, t2;
+connection default;
+disconnect locker;
+disconnect changer;
+disconnect updater;
create table t1 (i1 int, i2 int, i3 int);
create table t2 (id int, c1 varchar(20), c2 varchar(20));
insert into t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
diff --git a/mysql-test/r/myisam-big.result b/mysql-test/r/myisam-big.result
index 95a6e91d766..fd0bcb1224b 100644
--- a/mysql-test/r/myisam-big.result
+++ b/mysql-test/r/myisam-big.result
@@ -34,7 +34,13 @@ insert into t1 select * from t1;
select count(*) from t1;
count(*)
131072
+connect con2,localhost,root,,;
+connection con2;
alter table t1 add index (id), add index(sometext), add index(sometext,id);
alter table t1 disable keys;
alter table t1 enable keys;
+connection default;
+connection con2;
+disconnect con2;
+connection default;
drop table t1,t2;
diff --git a/mysql-test/r/myisam-optimize.result b/mysql-test/r/myisam-optimize.result
index 9451046fe08..9de3c24301f 100644
--- a/mysql-test/r/myisam-optimize.result
+++ b/mysql-test/r/myisam-optimize.result
@@ -3,6 +3,7 @@
#
create table t1 (pk int primary key, i int) engine=MyISAM;
insert into t1 values (1,1),(2,2);
+connect con1,localhost,root,,;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -13,6 +14,8 @@ t1 CREATE TABLE `t1` (
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+disconnect con1;
+connect con1,localhost,root,,;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -23,6 +26,8 @@ t1 CREATE TABLE `t1` (
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
+disconnect con1;
+connect con1,localhost,root,,;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -33,9 +38,12 @@ t1 CREATE TABLE `t1` (
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
+disconnect con1;
+connection default;
DROP TABLE t1;
create table t1 (pk int primary key, i int) engine=aria;
insert into t1 values (1,1),(2,2);
+connect con1,localhost,root,,;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -46,6 +54,8 @@ t1 CREATE TABLE `t1` (
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+disconnect con1;
+connect con1,localhost,root,,;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -56,6 +66,8 @@ t1 CREATE TABLE `t1` (
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
+disconnect con1;
+connect con1,localhost,root,,;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -66,4 +78,6 @@ t1 CREATE TABLE `t1` (
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status Table is already up to date
+disconnect con1;
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/r/myisam.result b/mysql-test/r/myisam.result
index 093de1339f3..67a63d7a08a 100644
--- a/mysql-test/r/myisam.result
+++ b/mysql-test/r/myisam.result
@@ -548,7 +548,10 @@ select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
a a b
1 1 1
2 2 1
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
insert into t2 values(2,0);
+disconnect root;
+connection default;
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
a a b
1 1 1
@@ -563,7 +566,11 @@ LOCK TABLES t1 READ LOCAL, t2 READ LOCAL;
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
t1c1 t2c1
+connect con1,localhost,root,,;
+connection con1;
INSERT INTO t2 VALUES ('test000001'), ('test000005');
+disconnect con1;
+connection default;
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
t1c1 t2c1
@@ -1706,12 +1713,17 @@ set global concurrent_insert=1;
create table t1 (a int);
insert into t1 values (1),(2),(3),(4),(5);
lock table t1 read local;
+connect con1,localhost,root,,;
+connection con1;
insert into t1 values(6),(7);
+connection default;
unlock tables;
delete from t1 where a>=3 and a<=4;
lock table t1 read local;
+connection con1;
set global concurrent_insert=2;
insert into t1 values (8),(9);
+connection default;
unlock tables;
insert into t1 values (10),(11),(12);
select * from t1;
@@ -1730,15 +1742,21 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+disconnect con1;
create table t1 (a int, b varchar(30) default "hello");
insert into t1 (a) values (1),(2),(3),(4),(5);
lock table t1 read local;
+connect con1,localhost,root,,;
+connection con1;
insert into t1 (a) values(6),(7);
+connection default;
unlock tables;
delete from t1 where a>=3 and a<=4;
lock table t1 read local;
+connection con1;
set global concurrent_insert=2;
insert into t1 (a) values (8),(9);
+connection default;
unlock tables;
insert into t1 (a) values (10),(11),(12);
select a from t1;
@@ -1757,6 +1775,7 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+disconnect con1;
set global concurrent_insert=@save_concurrent_insert;
create table t1 (a int, key(a));
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
diff --git a/mysql-test/r/myisam_debug.result b/mysql-test/r/myisam_debug.result
index 36a8fe6c724..39cbd69cdb0 100644
--- a/mysql-test/r/myisam_debug.result
+++ b/mysql-test/r/myisam_debug.result
@@ -1,6 +1,7 @@
#
# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
#
+CONNECT insertConn, localhost, root,,;
CREATE TABLE `t1` (
`id` BIGINT(20) ,
`id1` BIGINT(20) AUTO_INCREMENT,
@@ -12,11 +13,11 @@ CREATE TABLE `t2` (
KEY (id1), KEY(id)
) ENGINE=MyISAM;
INSERT INTO t2 (id) VALUES (123);
-# Switch to insert Connection
+connection insertConn;
SET SESSION debug_dbug='+d,wait_in_enable_indexes';
# Send insert data
INSERT INTO t1(id) SELECT id FROM t2;
-# Switch to default Connection
+connection default;
# Wait for insert data to reach the debug point
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_in_enable_indexes' AND
@@ -27,3 +28,4 @@ CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1,t2;
+disconnect insertConn;
diff --git a/mysql-test/r/myisam_icp_notembedded.result b/mysql-test/r/myisam_icp_notembedded.result
index d965cbd980d..789259d62f1 100644
--- a/mysql-test/r/myisam_icp_notembedded.result
+++ b/mysql-test/r/myisam_icp_notembedded.result
@@ -14,6 +14,9 @@ KEY (c, b)
CREATE TABLE t2 ( a INT ) ENGINE=MyISAM;
INSERT INTO t2 VALUES
(7),(3),(7),(3);
+connect con2,127.0.0.1,root,,test;
# Now run a number of ICP queries while trying to kill them
+disconnect con2;
+connection default;
DROP TABLE t1,t2;
set optimizer_switch=@myisam_icp_notembedded_tmp;
diff --git a/mysql-test/r/myisam_optimize.result b/mysql-test/r/myisam_optimize.result
index ae0c5b59d06..b769c4ac3e9 100644
--- a/mysql-test/r/myisam_optimize.result
+++ b/mysql-test/r/myisam_optimize.result
@@ -13,12 +13,19 @@ CCCCCCCCCC 3
CCCCCCCCCC 4
set debug_sync='myisam_before_repair_by_sort wait_for go';
optimize table t1;
+connect con1,localhost,root,,;
select a, left(b,10) from t1 order by a;
+connect con2,localhost,root,,;
set debug_sync='now signal go';
+connection default;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+connection con1;
a left(b,10)
3 CCCCCCCCCC
4 CCCCCCCCCC
+disconnect con1;
+disconnect con2;
+connection default;
drop table t1;
set debug_sync='reset';
diff --git a/mysql-test/r/myisam_recover.result b/mysql-test/r/myisam_recover.result
index 0829c1e8b82..2e239cfc392 100644
--- a/mysql-test/r/myisam_recover.result
+++ b/mysql-test/r/myisam_recover.result
@@ -9,9 +9,8 @@
# have effect on merge children.
# For that, we set the table cache to minimal size and populate it
# in a concurrent connection.
-#
-# Switching to connection con1
-#
+connect con1,localhost,root,,test,,;
+connection con1;
#
# Minimal values.
#
@@ -42,9 +41,7 @@ end while;
end|
call p_create();
drop procedure p_create;
-#
-# Switching to connection 'default'
-#
+connection default;
#
# We have to disable the ps-protocol, to avoid
# "Prepared statement needs to be re-prepared" errors
@@ -94,21 +91,22 @@ Error 1034 Number of rows changed from 3 to 6
# Cleanup
#
drop table t1, t1_mrg;
-#
-# Switching to connection con1
-#
+connection con1;
unlock tables;
prepare stmt from @drop_table_stmt;
execute stmt;
deallocate prepare stmt;
set @@global.table_definition_cache=default;
set @@global.table_open_cache=default;
+disconnect con1;
+connection default;
#
# 18075170 - sql node restart required to avoid deadlock after
# restore
#
# Check that auto-repair for MyISAM tables can now happen in the
# middle of transaction, without aborting it.
+connection default;
create table t1 (a int, key(a)) engine=myisam;
create table t2 (a int);
insert into t2 values (1);
@@ -142,9 +140,14 @@ Warnings:
Error 145 Table 't1' is marked as crashed and should be repaired
Error 1194 Table 't1' is marked as crashed and should be repaired
Error 1034 Number of rows changed from 1 to 2
+connect con2, localhost, root;
ALTER TABLE t2 ADD val INT;
+connection default;
# With fix we should have alter table waiting for t2 lock here.
ROLLBACK;
SET autocommit = 1;
+connection con2;
+connection default;
+disconnect con2;
# Cleanup
drop table t1, t2;
diff --git a/mysql-test/r/mysql-bug41486.result b/mysql-test/r/mysql-bug41486.result
index 62a6712eae1..d5760dcb1b9 100644
--- a/mysql-test/r/mysql-bug41486.result
+++ b/mysql-test/r/mysql-bug41486.result
@@ -1,6 +1,7 @@
DROP TABLE IF EXISTS t1;
SET @old_max_allowed_packet= @@global.max_allowed_packet;
SET @@global.max_allowed_packet = 2 * 1024 * 1024 + 1024;
+connect con1, localhost, root,,;
CREATE TABLE t1(data LONGBLOB);
INSERT INTO t1 SELECT REPEAT('1', 2*1024*1024);
SELECT COUNT(*) FROM t1;
@@ -13,4 +14,6 @@ SELECT LENGTH(data) FROM t1;
LENGTH(data)
2097152
DROP TABLE t1;
+disconnect con1;
+connection default;
SET @@global.max_allowed_packet = @old_max_allowed_packet;
diff --git a/mysql-test/r/mysql-bug45236.result b/mysql-test/r/mysql-bug45236.result
index cefcb1d314c..c1e41d62b63 100644
--- a/mysql-test/r/mysql-bug45236.result
+++ b/mysql-test/r/mysql-bug45236.result
@@ -1,8 +1,11 @@
DROP TABLE IF EXISTS t1;
SET @old_max_allowed_packet= @@global.max_allowed_packet;
SET @@global.max_allowed_packet = 1024 * 1024 + 1024;
+connect con1, localhost, root,,;
CREATE TABLE t1(data LONGBLOB);
INSERT INTO t1 SELECT CONCAT(REPEAT('1', 1024*1024 - 27),
"\'\r dummydb dummyhost");
DROP TABLE t1;
+disconnect con1;
+connection default;
SET @@global.max_allowed_packet = @old_max_allowed_packet;
diff --git a/mysql-test/r/mysql_upgrade-6984.result b/mysql-test/r/mysql_upgrade-6984.result
index 6aea4806ddb..fec0fcacb5f 100644
--- a/mysql-test/r/mysql_upgrade-6984.result
+++ b/mysql-test/r/mysql_upgrade-6984.result
@@ -55,6 +55,7 @@ performance_schema
test
Phase 6/6: Running 'FLUSH PRIVILEGES'
OK
+connect con1,localhost,root,foo,,,;
update mysql.user set password='' where user='root';
flush privileges;
set global event_scheduler=OFF;
diff --git a/mysql-test/r/mysql_upgrade.result b/mysql-test/r/mysql_upgrade.result
index d10e042729f..99446cd9d6f 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -404,6 +404,7 @@ FATAL ERROR: Upgrade failed
# MDEV-4332 Increase username length from 16 characters
# MDEV-6068, MDEV-6178 mysql_upgrade breaks databases with long user names
#
+connection default;
GRANT SELECT ON mysql.* TO very_long_user_name_number_1;
GRANT SELECT ON mysql.* TO very_long_user_name_number_2;
GRANT ALL ON *.* TO even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost WITH GRANT OPTION;
diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result
index 94aaee0c574..c7da070a622 100644
--- a/mysql-test/r/mysqlbinlog.result
+++ b/mysql-test/r/mysqlbinlog.result
@@ -639,6 +639,10 @@ CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES(connection_id());
FLUSH LOGS;
DROP TABLE t1;
+connect con1, localhost, root, , test;
+connection con1;
+disconnect con1;
+connection default;
1
DROP TABLE t1;
shell> mysqlbinlog std_data/corrupt-relay-bin.000624 > var/tmp/bug31793.sql
@@ -658,15 +662,19 @@ flush logs;
INSERT INTO t1 VALUES (1,USER());
flush logs;
mysqlbinlog var/log/master-bin.000018 > var/tmp/bug31611.sql
+connect unsecure,localhost,untrusted,,mysqltest1;
mysql mysqltest1 -uuntrusted < var/tmp/bug31611.sql
+connection unsecure;
INSERT INTO t1 VALUES (1,USER());
ERROR 42000: INSERT command denied to user 'untrusted'@'localhost' for table 't1'
SELECT * FROM t1;
a b
1 root@localhost
+connection default;
DROP DATABASE mysqltest1;
DROP USER untrusted@localhost;
Bug#32580 mysqlbinlog cannot read binlog event with user variables
+connection default;
USE test;
SET BINLOG_FORMAT = STATEMENT;
FLUSH LOGS;
diff --git a/mysql-test/r/mysqlbinlog_row_big.result b/mysql-test/r/mysqlbinlog_row_big.result
index 70e39266d1d..32c6b4d40ed 100644
--- a/mysql-test/r/mysqlbinlog_row_big.result
+++ b/mysql-test/r/mysqlbinlog_row_big.result
@@ -17,9 +17,8 @@ In order for the preceding change in max_allowed_packets' value
to be seen and used, we must start a new connection.
The change does not take effect with the current one.
For simplicity, we just disconnect / reconnect connection default here.
-Disconnecting default connection...
-Reconnecting default connection...
-default connection established, continuing with the test
+disconnect default;
+connect default, localhost,root,,;
#
# Delete all existing binary logs.
#
diff --git a/mysql-test/r/mysqldump-max.result b/mysql-test/r/mysqldump-max.result
index 5eff7a41abd..b75eb969da6 100644
--- a/mysql-test/r/mysqldump-max.result
+++ b/mysql-test/r/mysqldump-max.result
@@ -290,7 +290,10 @@ COUNT(*)
DROP VIEW v1;
DROP TABLE t1;
SET GLOBAL storage_engine=@old_engine;
-# Connection default
+connect c1,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect c2,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect c3,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection default;
SET binlog_format= mixed;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -300,32 +303,32 @@ INSERT INTO t2 VALUES (1,0), (2,0);
SELECT GET_LOCK("block_queries_1", 120);
GET_LOCK("block_queries_1", 120)
1
-# Connection c3
+connection c3;
SELECT GET_LOCK("block_queries_2", 120);
GET_LOCK("block_queries_2", 120)
1
-# Connection c1
+connection c1;
SET @c= 0;
SELECT IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120)) FROM t1 ORDER BY a;
-# Connection c2
+connection c2;
SET binlog_format="row";
SET @d= 10;
UPDATE t2 SET b=IF(@d<=10, @d:=@d+1, GET_LOCK("block_queries_2", 120)) ORDER BY a;
-# Connection default
+connection default;
# Make sure other queries are running (and waiting).
SELECT RELEASE_LOCK("block_queries_1");
RELEASE_LOCK("block_queries_1")
1
-# Connection c3
+connection c3;
SELECT RELEASE_LOCK("block_queries_2");
RELEASE_LOCK("block_queries_2")
1
-# Connection c1
+connection c1;
IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120))
1
1
-# Connection c2
-# Connection default
+connection c2;
+connection default;
SELECT * FROM t2 ORDER BY a;
a b
1 11
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 559f8885b0d..ef124e74a76 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -3650,16 +3650,21 @@ drop user mysqltest_1@localhost;
#
# Bug#21424 mysqldump failing to export/import views
#
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
create database mysqldump_myDB;
use mysqldump_myDB;
create user myDB_User@localhost;
grant create, create view, select, insert on mysqldump_myDB.* to myDB_User@localhost;
create table t1 (c1 int);
insert into t1 values (3);
+connect user1,localhost,myDB_User,,mysqldump_myDB,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user1;
use mysqldump_myDB;
create table u1 (f1 int);
insert into u1 values (4);
create view v1 (c1) as select * from t1;
+connection root;
use mysqldump_myDB;
drop view v1;
drop table t1;
@@ -3671,6 +3676,7 @@ flush privileges;
# Bug#21424 continues from here.
# Restore. Flush Privileges test ends.
#
+connection user1;
use mysqldump_myDB;
select * from mysqldump_myDB.v1;
c1
@@ -3678,6 +3684,8 @@ c1
select * from mysqldump_myDB.u1;
f1
4
+connection root;
+disconnect user1;
use mysqldump_myDB;
drop view v1;
drop table t1;
@@ -3685,6 +3693,8 @@ drop table u1;
revoke all privileges on mysqldump_myDB.* from myDB_User@localhost;
drop user myDB_User@localhost;
drop database mysqldump_myDB;
+connection default;
+disconnect root;
use test;
#
# Bug #21527 mysqldump incorrectly tries to LOCK TABLES on the
@@ -3837,6 +3847,8 @@ use test;
create database mysqldump_test_db;
grant all privileges on mysqldump_test_db.* to user1;
grant all privileges on mysqldump_test_db.* to user2;
+connect user27293,localhost,user1,,mysqldump_test_db,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection user27293;
create procedure mysqldump_test_db.sp1() select 'hello';
-- insufficient privileges to SHOW CREATE PROCEDURE `sp1`
@@ -3859,6 +3871,8 @@ DELIMITER ;
/*!50003 SET character_set_results = @saved_cs_results */ ;
/*!50003 SET collation_connection = @saved_col_connection */ ;
drop procedure sp1;
+connection default;
+disconnect user27293;
drop user user1;
drop user user2;
drop database mysqldump_test_db;
@@ -5038,6 +5052,8 @@ END
# Test to check 'Insufficient privileges' error.
GRANT ALL PRIVILEGES ON BUG52792.* TO user1;
+connect conn_1, localhost, user1, , BUG52792, $MASTER_MYPORT, $MASTER_MYSOCK;
+connection conn_1;
# Running 'replace_regex on timestamp'
<?xml version="1.0"?>
<mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -5125,6 +5141,8 @@ CREATE DEFINER=`root`@`localhost` EVENT `e2` ON SCHEDULE EVERY 1 SECOND STARTS '
<!-- - does user1 have permissions on mysql.proc?
-->
+connection default;
+disconnect conn_1;
DROP USER user1;
DROP DATABASE BUG52792;
# UTF-8
diff --git a/mysql-test/r/mysqltest.result b/mysql-test/r/mysqltest.result
index e258b1d156f..9a5db536893 100644
--- a/mysql-test/r/mysqltest.result
+++ b/mysql-test/r/mysqltest.result
@@ -183,6 +183,8 @@ select 7;
7
mysqltest: At line 1: End of line junk detected: "OCNE"
connect con1,localhost,root,,;
+connection default;
+disconnect con1;
select 5 from t1;
lower
case
@@ -568,14 +570,24 @@ mysqltest: At line 1: query 'connect con2,localhost,root,,illegal_db' failed: 1
mysqltest: At line 1: Illegal argument for port: 'illegal_port'
mysqltest: At line 1: Illegal option to connect: SMTP
200 connects succeeded
+connect test_con1,localhost,root,,;
+disconnect test_con1;
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from <stdin> at line 1:
At line 3: connection 'test_con1' not found in connection pool
+connect test_con1,localhost,root,,;
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/mysqltest.sql":
included from <stdin> at line 1:
At line 2: Connection test_con1 already exists
+connect con1,localhost,root,,;
+connection default;
+connection con1;
+disconnect con1;
+connect con2,localhost,root,,*NO-ONE*;
show tables;
ERROR 3D000: No database selected
+disconnect con2;
+connection default;
connect con1,localhost,root,,;
connection default;
connection con1;
@@ -957,13 +969,23 @@ select 1;
1
-- a comment for the server;
mysqltest: At line 1: Found line beginning with -- that didn't contain a valid mysqltest command, check your syntax or use # if you intended to write a comment
+connect con1,localhost,root,,;
con1
+connect con2,localhost,root,,;
con2
+connection default;
default
+connection con1;
con1
+connection con2;
con2
+connection con1;
con1
+connection con2;
con2
+disconnect con1;
con2
+disconnect con2;
-closed_connection-
End of tests
+connection default;
diff --git a/mysql-test/r/named_pipe.result b/mysql-test/r/named_pipe.result
index ddd48f0ba91..aaf2fa063e1 100644
--- a/mysql-test/r/named_pipe.result
+++ b/mysql-test/r/named_pipe.result
@@ -1,3 +1,4 @@
+connect pipe_con,localhost,root,,,,,PIPE;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
@@ -2154,3 +2155,5 @@ Privat (Private Nutzung) Mobilfunk
Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
+connection default;
+disconnect pipe_con;
diff --git a/mysql-test/r/non_blocking_api.result b/mysql-test/r/non_blocking_api.result
index 248e372593b..4cb5c270f38 100644
--- a/mysql-test/r/non_blocking_api.result
+++ b/mysql-test/r/non_blocking_api.result
@@ -1,4 +1,7 @@
drop table if exists t1;
+connect con_nonblock,localhost,root,,test;
+connect con_normal,localhost,root,,test;
+connection con_nonblock;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
@@ -7,4 +10,5 @@ a
SELECT * FROM t1;
a
1
+connection con_normal;
DROP TABLE t1;
diff --git a/mysql-test/r/not_embedded_server.result b/mysql-test/r/not_embedded_server.result
index 1cd54b131c3..ba68ca8619b 100644
--- a/mysql-test/r/not_embedded_server.result
+++ b/mysql-test/r/not_embedded_server.result
@@ -23,7 +23,7 @@ DROP TABLE t1;
# Bug#54812: assert in Diagnostics_area::set_ok_status during EXPLAIN
#
CREATE USER nopriv_user@localhost;
-connection: default
+connection default;
DROP TABLE IF EXISTS t1,t2,t3;
DROP FUNCTION IF EXISTS f;
CREATE TABLE t1 (key1 INT PRIMARY KEY);
@@ -32,7 +32,8 @@ INSERT INTO t1 VALUES (1),(2);
CREATE FUNCTION f() RETURNS INT RETURN 1;
GRANT FILE ON *.* TO 'nopriv_user'@'localhost';
FLUSH PRIVILEGES;
-connection: con1
+connect con1,localhost,nopriv_user,,;
+connection con1;
SELECT MAX(key1) FROM t1 WHERE f() < 1 INTO OUTFILE '<outfile>';
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
INSERT INTO t2 SELECT MAX(key1) FROM t1 WHERE f() < 1;
@@ -41,7 +42,8 @@ SELECT MAX(key1) INTO @dummy FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
CREATE TABLE t3 (i INT) AS SELECT MAX(key1) FROM t1 WHERE f() < 1;
ERROR 42000: execute command denied to user 'nopriv_user'@'localhost' for routine 'test.f'
-connection: default
+disconnect con1;
+connection default;
DROP TABLE t1,t2;
DROP FUNCTION f;
DROP USER nopriv_user@localhost;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index 1d5c6d179df..0aa4acb431c 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -9,10 +9,17 @@ grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA
grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB/CN=client" ISSUER "/CN=cacert/C=FI/ST=Helsinki/L=Helsinki/O=MariaDB";
grant select on test.* to ssl_user5@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "xxx";
flush privileges;
+connect con1,localhost,ssl_user1,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA;
connect(localhost,ssl_user2,,test,MASTER_PORT,MASTER_SOCKET);
+connect con2,localhost,ssl_user2,,,,,SSL-CIPHER=AES256-SHA;
ERROR 28000: Access denied for user 'ssl_user2'@'localhost' (using password: NO)
+connect con2,localhost,ssl_user2,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA;
+connect con3,localhost,ssl_user3,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA;
+connect con4,localhost,ssl_user4,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA;
connect(localhost,ssl_user5,,test,MASTER_PORT,MASTER_SOCKET);
+connect con5,localhost,ssl_user5,,,,,SSL-CIPHER=DHE-RSA-AES256-SHA;
ERROR 28000: Access denied for user 'ssl_user5'@'localhost' (using password: NO)
+connection con1;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -21,6 +28,7 @@ f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user1'@'localhost' for table 't1'
+connection con2;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -29,6 +37,7 @@ f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user2'@'localhost' for table 't1'
+connection con3;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -37,6 +46,7 @@ f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user3'@'localhost' for table 't1'
+connection con4;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -45,6 +55,11 @@ f1
5
delete from t1;
ERROR 42000: DELETE command denied to user 'ssl_user4'@'localhost' for table 't1'
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
drop user ssl_user1@localhost, ssl_user2@localhost,
ssl_user3@localhost, ssl_user4@localhost, ssl_user5@localhost;
drop table t1;
@@ -204,9 +219,12 @@ result
is still running; no cipher request crashed the server
GRANT SELECT ON test.* TO bug42158@localhost REQUIRE X509;
FLUSH PRIVILEGES;
+connect con1,localhost,bug42158,,,,,SSL;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
+disconnect con1;
+connection default;
DROP USER bug42158@localhost;
set global sql_mode=default;
End of 5.1 tests
diff --git a/mysql-test/r/outfile.result b/mysql-test/r/outfile.result
index daea60c53eb..cafa9d9db4d 100644
--- a/mysql-test/r/outfile.result
+++ b/mysql-test/r/outfile.result
Binary files differ
diff --git a/mysql-test/r/overflow.result b/mysql-test/r/overflow.result
index a5fa7154833..a3e93aa5cba 100644
--- a/mysql-test/r/overflow.result
+++ b/mysql-test/r/overflow.result
@@ -1,2 +1,6 @@
+connect con1,localhost,root,,;
+connection con1;
drop database AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA;
Got one of the listed errors
+connection default;
+disconnect con1;
diff --git a/mysql-test/r/packet.result b/mysql-test/r/packet.result
index dcc2c608d0b..254ad93d78e 100644
--- a/mysql-test/r/packet.result
+++ b/mysql-test/r/packet.result
@@ -13,18 +13,26 @@ len
select repeat('a',2000);
repeat('a',2000)
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+connect con1,localhost,root,,;
+connection con1;
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
ERROR 08S01: Got a packet bigger than 'max_allowed_packet' bytes
+connection default;
+disconnect con1;
set global max_allowed_packet=default;
set global net_buffer_length=default;
+connect con2,localhost,root,,;
+connection con2;
SELECT length("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa") as len;
len
100
select length(repeat('a',2000));
length(repeat('a',2000))
2000
+connection default;
+disconnect con2;
set global max_allowed_packet=@max_allowed_packet;
set global net_buffer_length=@net_buffer_length;
diff --git a/mysql-test/r/parser_not_embedded.result b/mysql-test/r/parser_not_embedded.result
index fd545605c02..25349e51577 100644
--- a/mysql-test/r/parser_not_embedded.result
+++ b/mysql-test/r/parser_not_embedded.result
@@ -52,7 +52,11 @@
COMMIT AND CHAIN RELEASE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RELEASE' at line 1
COMMIT AND NO CHAIN RELEASE;
+disconnect default;
+connect default, localhost, root,,;
COMMIT RELEASE;
+disconnect default;
+connect default, localhost, root,,;
COMMIT CHAIN RELEASE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHAIN RELEASE' at line 1
COMMIT NO CHAIN RELEASE;
@@ -72,11 +76,17 @@ COMMIT AND NO CHAIN NO RELEASE;
ROLLBACK AND CHAIN RELEASE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RELEASE' at line 1
ROLLBACK AND NO CHAIN RELEASE;
+disconnect default;
+connect default, localhost, root,,;
ROLLBACK RELEASE;
+disconnect default;
+connect default, localhost, root,,;
ROLLBACK CHAIN RELEASE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHAIN RELEASE' at line 1
ROLLBACK NO CHAIN RELEASE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CHAIN RELEASE' at line 1
+disconnect default;
+connect default, localhost, root,,;
ROLLBACK AND NO RELEASE;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'RELEASE' at line 1
ROLLBACK AND RELEASE;
diff --git a/mysql-test/r/partition_cache.result b/mysql-test/r/partition_cache.result
index 39ba4841337..697ba1bcd15 100644
--- a/mysql-test/r/partition_cache.result
+++ b/mysql-test/r/partition_cache.result
@@ -113,9 +113,10 @@ select count(*) from t1;
count(*)
1
drop table t1;
+connect connection1,localhost,root,,;
SET SESSION STORAGE_ENGINE = InnoDB;
SET @@autocommit=1;
-connection default
+connection default;
SHOW VARIABLES LIKE 'have_query_cache';
Variable_name Value
have_query_cache YES
@@ -137,7 +138,7 @@ count(*)
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
-connection connection1
+connection connection1;
START TRANSACTION;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
@@ -153,7 +154,7 @@ count(*)
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
-connection default
+connection default;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
@@ -167,7 +168,7 @@ count(*)
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-connection connection1
+connection connection1;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
@@ -179,7 +180,7 @@ INSERT INTO t2 VALUES (6,'w');
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
3
-connection default
+connection default;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
2
@@ -192,7 +193,7 @@ SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
1
COMMIT;
-connection connection1
+connection connection1;
COMMIT;
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
count(*)
@@ -203,6 +204,8 @@ Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
+disconnect connection1;
+connection default;
set @@global.query_cache_size = @save_query_cache_size;
drop table t2;
SET global query_cache_type=default;
diff --git a/mysql-test/r/partition_csv.result b/mysql-test/r/partition_csv.result
index 18e28d4670a..836c49682b2 100644
--- a/mysql-test/r/partition_csv.result
+++ b/mysql-test/r/partition_csv.result
@@ -34,10 +34,13 @@ SET GLOBAL general_log =1;
# do some things to be logged to partitioned log, should fail
USE /* 1 */ test;
CREATE TABLE t1 (i INT);
+connect con1,localhost,root,,;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
i
1
+disconnect con1;
+connection default;
USE mysql;
SET GLOBAL general_log =0;
ALTER TABLE general_log RENAME TO gl_partitioned;
diff --git a/mysql-test/r/partition_debug_sync.result b/mysql-test/r/partition_debug_sync.result
index 7abe0163a98..971bc63e2e7 100644
--- a/mysql-test/r/partition_debug_sync.result
+++ b/mysql-test/r/partition_debug_sync.result
@@ -8,7 +8,7 @@ SET DEBUG_SYNC= 'RESET';
# by adding a small sleep to verify that the delete waits. This happens
# only until ALTER tries to upgrade its MDL lock, which ends up in MDL
# deadlock which is correctly reported.
-# Con 1
+connect con1, localhost, root,,;
SET DEBUG_SYNC= 'RESET';
CREATE TABLE t1
(a INTEGER,
@@ -23,14 +23,16 @@ PARTITION p3 VALUES LESS THAN MAXVALUE ) */;
SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partitioning WAIT_FOR waiting_for_alter';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_upgrade';
ALTER TABLE t1 REMOVE PARTITIONING;
-# Con default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR waiting_for_upgrade';
DROP TABLE IF EXISTS t1;
-# Con 1
+connection con1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+connection default;
SET DEBUG_SYNC= 'RESET';
+connection con1;
SET DEBUG_SYNC= 'RESET';
#
# Bug#42438: Crash ha_partition::change_table_ptr
@@ -50,15 +52,16 @@ PARTITION p3 VALUES LESS THAN MAXVALUE);
SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_FOR waiting_for_alter';
SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
ALTER TABLE t2 REMOVE PARTITIONING;
-# Con default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
DROP TABLE IF EXISTS t2;
-# Con 1
+connection con1;
ERROR 42S02: Table 'test.t2' doesn't exist
SET DEBUG_SYNC= 'RESET';
-# Con default
+disconnect con1;
+connection default;
SET DEBUG_SYNC= 'RESET';
End of 5.1 tests
#
@@ -68,21 +71,22 @@ CREATE TABLE t1 (a int) ENGINE = InnoDB;
CREATE TABLE t2 (a int PRIMARY KEY)
ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 3;
HANDLER t1 OPEN;
-# Con1
+connect con1, localhost, root,,;
LOCK TABLES t1 WRITE, t2 READ;
-# Default
+connection default;
SET DEBUG_SYNC="wait_for_lock SIGNAL locking";
INSERT INTO t2 VALUES (1), (2), (3);
-# Con1
+connection con1;
SET DEBUG_SYNC="now WAIT_FOR locking";
ALTER TABLE t1 ADD COLUMN b int;
-# Default
+connection default;
ERROR HY000: Wait on a lock was aborted due to a pending exclusive lock
SELECT 1;
1
1
-# Con1
+connection con1;
UNLOCK TABLES;
-# Default
+disconnect con1;
+connection default;
SET DEBUG_SYNC = 'RESET';
DROP TABLE t1, t2;
diff --git a/mysql-test/r/partition_grant.result b/mysql-test/r/partition_grant.result
index f036b0bcc28..cd8f8a970d0 100644
--- a/mysql-test/r/partition_grant.result
+++ b/mysql-test/r/partition_grant.result
@@ -7,6 +7,7 @@ create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
revoke all privileges on *.* from mysqltest_1@localhost;
grant select,alter on mysqltest_1.* to mysqltest_1@localhost;
+connect conn1,localhost,mysqltest_1,,mysqltest_1;
show grants for current_user;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -14,21 +15,36 @@ GRANT SELECT, ALTER ON `mysqltest_1`.* TO 'mysqltest_1'@'localhost'
alter table t1 add b int;
alter table t1 drop partition p2;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
+disconnect conn1;
+connection default;
grant drop on mysqltest_1.* to mysqltest_1@localhost;
+connect conn2,localhost,mysqltest_1,,mysqltest_1;
alter table t1 drop partition p2;
+disconnect conn2;
+connection default;
revoke alter on mysqltest_1.* from mysqltest_1@localhost;
+connect conn3,localhost,mysqltest_1,,mysqltest_1;
alter table t1 drop partition p3;
ERROR 42000: ALTER command denied to user 'mysqltest_1'@'localhost' for table 't1'
+disconnect conn3;
+connection default;
revoke select,alter,drop on mysqltest_1.* from mysqltest_1@localhost;
drop table t1;
create table t1 (s1 int);
insert into t1 values (1);
grant alter on mysqltest_1.* to mysqltest_1@localhost;
+connect conn4,localhost,mysqltest_1,,mysqltest_1;
+connection conn4;
alter table t1 partition by list (s1) (partition p1 values in (2));
ERROR HY000: Table has no partition for some existing values
+connection default;
grant select, alter on mysqltest_1.* to mysqltest_1@localhost;
+disconnect conn4;
+connect conn5,localhost,mysqltest_1,,mysqltest_1;
alter table t1 partition by list (s1) (partition p1 values in (2));
ERROR HY000: Table has no partition for value 1
+disconnect conn5;
+connection default;
drop table t1;
drop user mysqltest_1@localhost;
drop schema mysqltest_1;
diff --git a/mysql-test/r/partition_innodb.result b/mysql-test/r/partition_innodb.result
index bfe9dc96bc2..c9568f7b07f 100644
--- a/mysql-test/r/partition_innodb.result
+++ b/mysql-test/r/partition_innodb.result
@@ -89,19 +89,23 @@ BEGIN;
SELECT COUNT(*) FROM t1;
COUNT(*)
5
-# con1
+connect con1,localhost,root,,;
# SEND a ALTER PARTITION which waits on the ongoing transaction.
ALTER TABLE t1
REORGANIZE PARTITION hour_003, hour_004 INTO
(PARTITION oldest VALUES LESS THAN (4));
# Connection default wait until the ALTER is in 'waiting for table...'
# state and then continue the transaction by trying a SELECT
+connection default;
SELECT COUNT(*) FROM t1;
COUNT(*)
5
COMMIT;
-# con1, reaping ALTER.
-# Disconnecting con1 and switching to default. Cleaning up.
+# reaping ALTER.
+connection con1;
+# Cleaning up.
+disconnect con1;
+connection default;
SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency;
SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay;
DROP TABLE t1;
@@ -145,7 +149,7 @@ UPDATE t1 SET name = 'Mattias' WHERE id = 7;
SELECT * FROM t1 WHERE id = 7;
id name myDate
7 Mattias 2009-09-16
-# Connection con1
+connect con1, localhost, root,,;
SET lock_wait_timeout = 1;
# After the patch it will wait and fail on timeout.
ALTER TABLE t1 DROP PARTITION p3;
@@ -153,7 +157,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW WARNINGS;
Level Code Message
Error 1205 Lock wait timeout exceeded; try restarting transaction
-# Connection default
+disconnect con1;
+connection default;
SELECT * FROM t1;
id name myDate
1 Lachlan 2009-09-13
@@ -778,13 +783,14 @@ PRIMARY KEY (a))
ENGINE = InnoDB
PARTITION BY HASH (a) PARTITIONS 3;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
-# con1
+connect con1, localhost, root,,;
ALTER TABLE t1 ADD INDEX idx1 (b);
-# con default
+connection default;
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
+disconnect con1;
DROP TABLE t1;
# Same test without partitioning
CREATE TABLE t1
@@ -793,11 +799,12 @@ b INT,
PRIMARY KEY (a))
ENGINE = InnoDB;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
-# con1
+connect con1, localhost, root,,;
ALTER TABLE t1 ADD INDEX idx1 (b);
-# con default
+connection default;
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
SELECT b FROM t1 WHERE b = 0;
ERROR HY000: Table definition has changed, please retry transaction
+disconnect con1;
DROP TABLE t1;
diff --git a/mysql-test/r/partition_innodb_plugin.result b/mysql-test/r/partition_innodb_plugin.result
index 63c9da69955..d53d2edb581 100644
--- a/mysql-test/r/partition_innodb_plugin.result
+++ b/mysql-test/r/partition_innodb_plugin.result
@@ -42,7 +42,7 @@ SET @old_innodb_strict_mode = @@global.innodb_strict_mode;
SET @@global.innodb_file_format = Barracuda,
@@global.innodb_file_per_table = ON,
@@global.innodb_strict_mode = ON;
-# Connection con1
+connect con1,localhost,root,,;
CREATE TABLE t1 (id INT NOT NULL
PRIMARY KEY,
user_num CHAR(10)
@@ -62,7 +62,8 @@ t1 CREATE TABLE `t1` (
/*!50100 PARTITION BY HASH (id)
PARTITIONS 1 */
SET GLOBAL innodb_file_per_table = OFF;
-# Connection con2
+disconnect con1;
+connect con2,localhost,root,,;
LOCK TABLE t1 WRITE;
# ALTER fails because COMPRESSED/KEY_BLOCK_SIZE
# are incompatible with innodb_file_per_table = OFF;
@@ -99,7 +100,8 @@ t1 CREATE TABLE `t1` (
/*!50100 PARTITION BY HASH (id)
PARTITIONS 3 */
DROP TABLE t1;
-# Connection default
+disconnect con2;
+connection default;
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
@@ -116,15 +118,15 @@ PARTITION `p1``\""e` VALUES LESS THAN (MAXVALUE)
SUBPARTITION `sp3``\""e`));
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
START TRANSACTION;
-# con1
+connect con1,localhost,root,,;
SET NAMES utf8;
START TRANSACTION;
-# default connection
+connection default;
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
-# con1
+connection con1;
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
-# default connection
+connection default;
SELECT lock_table, COUNT(*) FROM INFORMATION_SCHEMA.INNODB_LOCKS
GROUP BY lock_table;
lock_table COUNT(*)
@@ -148,8 +150,9 @@ SHOW ENGINE InnoDB STATUS;
Type Name Status
InnoDB index `PRIMARY` of table `test`.`t``\""e` /* Partition `p0``\""e`, Subpartition `sp0``\""e` */
set @@sql_mode = @old_sql_mode;
-# con1
+connection con1;
ROLLBACK;
-# default connection
+disconnect con1;
+connection default;
DROP TABLE `t``\""e`;
SET NAMES DEFAULT;
diff --git a/mysql-test/r/partition_innodb_semi_consistent.result b/mysql-test/r/partition_innodb_semi_consistent.result
index 11621a1ebd9..208bd0214f7 100644
--- a/mysql-test/r/partition_innodb_semi_consistent.result
+++ b/mysql-test/r/partition_innodb_semi_consistent.result
@@ -1,4 +1,7 @@
drop table if exists t1;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
set binlog_format=mixed;
set session transaction isolation level repeatable read;
create table t1(a int not null)
@@ -12,28 +15,36 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode;
a
3
+connection b;
set binlog_format=mixed;
set session transaction isolation level repeatable read;
set autocommit=0;
update t1 set a=10 where a=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
+connection a;
commit;
+connection b;
set session transaction isolation level read committed;
update t1 set a=10 where a=5;
+connection a;
select * from t1 where a=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1 where a=2 limit 1 for update;
a
2
+connection b;
update t1 set a=11 where a=6;
update t1 set a=12 where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t1 set a=13 where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection a;
commit;
+connection b;
update t1 set a=14 where a=1;
commit;
+connection a;
select * from t1;
a
10
@@ -44,10 +55,15 @@ a
4
7
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
set binlog_format=mixed;
-# Switch to connection con1
+connection con1;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
ENGINE = InnoDB
PARTITION BY RANGE (a)
@@ -62,11 +78,11 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
1 12
-# Switch to connection con2
+connection con2;
UPDATE t1 SET b = 21 WHERE a = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ROLLBACK;
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a b
1 12
@@ -97,9 +113,9 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
1 init+con1
-# Switch to connection con2
+connection con2;
CALL p1;;
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a b
1 init+con1
@@ -107,12 +123,12 @@ COMMIT;
SELECT * FROM t1;
a b
1 init+con1
-# Switch to connection con2
+connection con2;
SELECT * FROM t1;
a b
1 init+con1+con2
COMMIT;
-# Switch to connection con1
+connection con1;
# 3. test for updated key column:
TRUNCATE t1;
DELETE FROM t2;
@@ -124,9 +140,9 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
2 init+con1
-# Switch to connection con2
+connection con2;
CALL p1;;
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a b
2 init+con1
@@ -134,9 +150,12 @@ COMMIT;
SELECT * FROM t1;
a b
2 init+con1
-# Switch to connection con2
+connection con2;
SELECT * FROM t1;
a b
2 init+con1
+connection default;
+disconnect con1;
+disconnect con2;
DROP PROCEDURE p1;
DROP TABLE t1, t2;
diff --git a/mysql-test/r/partition_innodb_stmt.result b/mysql-test/r/partition_innodb_stmt.result
index 22a9f28708c..543d4734216 100644
--- a/mysql-test/r/partition_innodb_stmt.result
+++ b/mysql-test/r/partition_innodb_stmt.result
@@ -1,4 +1,3 @@
-# connection default
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
CREATE TABLE t1
(
@@ -21,12 +20,13 @@ id
1
2
3
-#connection con1
+connect con1, localhost, root,,;
+connection con1;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
INSERT INTO t1 VALUES(7);
COMMIT;
-# connection default
+connection default;
COMMIT;
FLUSH TABLES;
# Test REPEATABLE READ -> READ COMMITTED
@@ -38,11 +38,13 @@ id
2
3
7
-# connection con1
+connection con1;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
INSERT INTO t1 VALUES(9);
ERROR HY000: Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging. InnoDB is limited to row-logging when transaction isolation level is READ COMMITTED or READ UNCOMMITTED.
COMMIT;
+disconnect con1;
+connection default;
COMMIT;
DROP TABLE t1;
diff --git a/mysql-test/r/partition_symlink.result b/mysql-test/r/partition_symlink.result
index 2588a9b10e4..387717ab7e7 100644
--- a/mysql-test/r/partition_symlink.result
+++ b/mysql-test/r/partition_symlink.result
@@ -47,6 +47,7 @@ CREATE DATABASE mysqltest2;
USE mysqltest2;
CREATE TABLE t1 (a INT) ENGINE = MyISAM;
INSERT INTO t1 VALUES (0);
+connect con1,localhost,mysqltest_1,,;
# user mysqltest_1:
USE test;
CREATE TABLE t1 (a INT)
@@ -68,6 +69,7 @@ INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
a
1
+connection default;
# user root:
USE mysqltest2;
FLUSH TABLES;
@@ -96,6 +98,7 @@ PARTITION p1 VALUES IN (1)
DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp'
);
+connection con1;
# user mysqltest_1:
USE test;
CREATE TABLE t1 (a INT)
@@ -120,10 +123,12 @@ DATA DIRECTORY 'MYSQLTEST_VARDIR/tmp'
INDEX DIRECTORY 'MYSQLTEST_VARDIR/tmp'
);
Got one of the listed errors
+connection default;
# user root (cleanup):
DROP DATABASE mysqltest2;
USE test;
DROP USER mysqltest_1@localhost;
+disconnect con1;
create table t2 (i int )
ENGINE = MyISAM
partition by range (i)
diff --git a/mysql-test/r/partition_sync.result b/mysql-test/r/partition_sync.result
index 0e8254e984e..18cc506e849 100644
--- a/mysql-test/r/partition_sync.result
+++ b/mysql-test/r/partition_sync.result
@@ -6,22 +6,24 @@ CREATE TABLE t1 (a int) PARTITION BY RANGE (a)
(PARTITION p0 VALUES LESS THAN (1),
PARTITION p1 VALUES LESS THAN (2));
INSERT INTO t1 VALUES (0),(1);
-# Connection 2
+connect con1,localhost,root;
+connection con1;
BEGIN;
SELECT * FROM t1;
a
0
1
-# Connection 1
+connection default;
ALTER TABLE t1 DROP PARTITION p3;
ERROR HY000: Error in list of partitions to DROP
-# Connection 2
+connection con1;
# This failed with deadlock and should not do so.
SELECT * FROM t1;
a
0
1
-# Connection 1
+connection default;
+disconnect con1;
DROP TABLE t1;
#
# Bug #46654 False deadlock on concurrent DML/DDL
@@ -31,27 +33,31 @@ DROP TABLE IF EXISTS tbl_with_partitions;
CREATE TABLE tbl_with_partitions ( i INT )
PARTITION BY HASH(i);
INSERT INTO tbl_with_partitions VALUES (1);
-# Connection 3
+connect con2,localhost,root;
+connect con3,localhost,root;
+connection con3;
LOCK TABLE tbl_with_partitions READ;
-# Connection 1
# Access table with disabled autocommit
+connection default;
SET AUTOCOMMIT = 0;
SELECT * FROM tbl_with_partitions;
i
1
-# Connection 2
# Alter table, abort after prepare
+connection con2;
set session debug_dbug="+d,abort_copy_table";
ALTER TABLE tbl_with_partitions ADD COLUMN f INT;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection 1
# Try accessing the table after Alter aborted.
# This used to give ER_LOCK_DEADLOCK.
+connection default;
SELECT * FROM tbl_with_partitions;
i
1
-# Connection 3
+connection con3;
UNLOCK TABLES;
-# Connection 1
# Cleanup
+connection default;
+disconnect con2;
+disconnect con3;
DROP TABLE tbl_with_partitions;
diff --git a/mysql-test/r/plugin_auth.result b/mysql-test/r/plugin_auth.result
index 626722f9dd1..345d6861ad4 100644
--- a/mysql-test/r/plugin_auth.result
+++ b/mysql-test/r/plugin_auth.result
@@ -31,18 +31,26 @@ proxies_priv CREATE TABLE `proxies_priv` (
PRIMARY KEY (`Host`,`User`,`Proxied_host`,`Proxied_user`),
KEY `Grantor` (`Grantor`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='User proxy privileges'
+connect plug_con,localhost,plug,plug_dest;
+connection plug_con;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
plug@localhost plug_dest@%
## test SET PASSWORD
SET PASSWORD = PASSWORD('plug_dest');
+connection default;
+disconnect plug_con;
## test bad credentials
ERROR 28000: Access denied for user 'plug'@'localhost' (using password: YES)
## test bad default plugin : should get CR_AUTH_PLUGIN_CANNOT_LOAD
## test correct default plugin
+connect plug_con_rightp,localhost,plug,plug_dest,,,,,auth_test_plugin;
+connection plug_con_rightp;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
plug@localhost plug_dest@%
+connection default;
+disconnect plug_con_rightp;
## test no_auto_create_user sql mode with plugin users
SET @@sql_mode=no_auto_create_user;
GRANT INSERT ON TEST.* TO grant_user IDENTIFIED WITH 'test_plugin_server';
@@ -51,9 +59,13 @@ DROP USER grant_user;
## test utf-8 user name
CREATE USER `Ÿ` IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
GRANT PROXY ON plug_dest TO `Ÿ`;
+connect non_ascii,localhost,Ÿ,plug_dest;
+connection non_ascii;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
Ÿ@localhost plug_dest@%
+connection default;
+disconnect non_ascii;
DROP USER `Ÿ`;
## test GRANT ... IDENTIFIED WITH/BY ...
CREATE DATABASE test_grant_db;
@@ -61,24 +73,33 @@ CREATE DATABASE test_grant_db;
GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
IDENTIFIED WITH 'test_plugin_server' AS 'plug_dest';
GRANT PROXY ON plug_dest TO new_grant_user;
+connect plug_con_grant,localhost,new_grant_user,plug_dest;
+connection plug_con_grant;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
new_grant_user@localhost plug_dest@%
USE test_grant_db;
CREATE TABLE t1 (a INT);
DROP TABLE t1;
+connection default;
+disconnect plug_con_grant;
REVOKE ALL PRIVILEGES ON test_grant_db.* FROM new_grant_user;
# try re-create existing user via GRANT IDENTIFIED BY
GRANT ALL PRIVILEGES ON test_grant_db.* TO new_grant_user
IDENTIFIED BY 'new_password';
connect(localhost,new_grant_user,plug_dest,test,MYSQL_PORT,MYSQL_SOCK);
+connect plug_con_grant_deny,localhost,new_grant_user,plug_dest;
ERROR 28000: Access denied for user 'new_grant_user'@'localhost' (using password: YES)
+connect plug_con_grant,localhost,new_grant_user,new_password;
+connection plug_con_grant;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
new_grant_user@localhost new_grant_user@%
USE test_grant_db;
CREATE TABLE t1 (a INT);
DROP TABLE t1;
+connection default;
+disconnect plug_con_grant;
DROP USER new_grant_user;
# try re-create existing user via GRANT IDENTIFIED WITH
GRANT ALL PRIVILEGES ON test_grant_db.* TO plug
@@ -111,6 +132,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
# this should fail : no such grant
REVOKE PROXY ON grant_plug_dest FROM grant_plug;
ERROR 42000: There is no such grant defined for user 'grant_plug' on host '%'
+connect grant_plug_dest_con,localhost,grant_plug_dest,grant_plug_dest_passwd;
+connection grant_plug_dest_con;
in grant_plug_dest_con
## testing what an ordinary user can grant
this should fail : no rights to grant all
@@ -134,7 +157,9 @@ ERROR 28000: Access denied for user 'grant_plug_dest'@'localhost'
this should fail : can't create users
GRANT PROXY ON grant_plug_dest TO grant_plug@localhost;
ERROR 42000: You are not allowed to create a user with GRANT
+connection default;
in default connection
+disconnect grant_plug_dest_con;
# test what root can grant
should work : root has PROXY to all users
GRANT PROXY ON ''@'%%' TO grant_plug;
@@ -144,10 +169,14 @@ GRANT PROXY ON ''@'%%' TO proxy_admin IDENTIFIED BY 'test'
WITH GRANT OPTION;
need USAGE : PROXY doesn't contain it.
GRANT USAGE on *.* TO proxy_admin;
+connect proxy_admin_con,localhost,proxy_admin,test;
+connection proxy_admin_con;
in proxy_admin_con;
should work : proxy_admin has proxy to ''@'%%'
GRANT PROXY ON future_user TO grant_plug;
+connection default;
in default connection
+disconnect proxy_admin_con;
SHOW GRANTS FOR grant_plug;
Grants for grant_plug@%
GRANT ALL PRIVILEGES ON *.* TO 'grant_plug'@'%' IDENTIFIED VIA test_plugin_server USING 'grant_plug_dest'
@@ -191,11 +220,15 @@ ERROR HY000: Variable 'proxy_user' is a read only variable
SELECT @@LOCAL.proxy_user;
@@LOCAL.proxy_user
NULL
+connect plug_con,localhost,plug,plug_dest;
+connection plug_con;
# in connection plug_con
SELECT @@LOCAL.proxy_user;
@@LOCAL.proxy_user
'plug'@'%'
+connection default;
# in connection default
+disconnect plug_con;
## cleanup
DROP USER plug;
DROP USER plug_dest;
@@ -219,11 +252,15 @@ ERROR HY000: Variable 'external_user' is a read only variable
SELECT @@LOCAL.external_user;
@@LOCAL.external_user
NULL
+connect plug_con,localhost,plug,plug_dest;
+connection plug_con;
# in connection plug_con
SELECT @@LOCAL.external_user;
@@LOCAL.external_user
plug_dest
+connection default;
# in connection default
+disconnect plug_con;
## cleanup
DROP USER plug;
DROP USER plug_dest;
@@ -236,9 +273,12 @@ GRANT USAGE ON anonymous_db.* TO ''@'%%'
IDENTIFIED WITH 'test_plugin_server' AS 'power_user';
GRANT PROXY ON power_user TO ''@'%%';
CREATE DATABASE confidential_db;
+connect plug_con,localhost, test_login_user, power_user, confidential_db;
SELECT user(),current_user(),@@proxy_user;
user() current_user() @@proxy_user
test_login_user@localhost power_user@% ''@'%%'
+connection default;
+disconnect plug_con;
DROP USER power_user;
DROP USER ''@'%%';
DROP DATABASE confidential_db;
@@ -274,10 +314,14 @@ ERROR 28000: Access denied for user 'root'@'localhost'
REVOKE PROXY ON u2@localhost FROM u1@localhost;
ERROR 28000: Access denied for user 'root'@'localhost'
# go try graning proxy on itself, so that it will need the table
+connect proxy_granter_con,localhost,u2,;
+connection proxy_granter_con;
GRANT PROXY ON u2@localhost TO u1@localhost;
ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
REVOKE PROXY ON u2@localhost FROM u1@localhost;
ERROR 42S02: Table 'mysql.proxies_priv' doesn't exist
+connection default;
+disconnect proxy_granter_con;
# test if REVOKE works without the proxies_priv table
REVOKE ALL PRIVILEGES ON *.* FROM u1@localhost, u2@localhost;
# test if DROP USER work without the proxies_priv table
@@ -310,9 +354,13 @@ CREATE USER uplain@localhost IDENTIFIED WITH 'cleartext_plugin_server'
AS 'cleartext_test';
## test plugin auth
ERROR 28000: Access denied for user 'uplain'@'localhost' (using password: YES)
+connect cleartext_con,localhost,uplain,cleartext_test;
+connection cleartext_con;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
uplain@localhost uplain@localhost
+connection default;
+disconnect cleartext_con;
DROP USER uplain@localhost;
#
# Bug #59038 : mysql.user.authentication_string column
@@ -409,6 +457,9 @@ ERROR 1045 (28000): Access denied for user 'unknown'@'localhost' (using password
CREATE USER bug12610784@localhost;
SET PASSWORD FOR bug12610784@localhost = PASSWORD('secret');
ERROR 28000: Access denied for user 'bug12610784'@'localhost' (using password: NO)
+connect b12610784,localhost,bug12610784,secret,test;
+connection default;
+disconnect b12610784;
DROP USER bug12610784@localhost;
#
# Bug #12818542: PAM: ADDING PASSWORD FOR AN ACCOUNT DISABLES PAM
@@ -419,13 +470,21 @@ IDENTIFIED WITH 'test_plugin_server' AS 'bug12818542_dest';
CREATE USER bug12818542_dest@localhost
IDENTIFIED BY 'bug12818542_dest_passwd';
GRANT PROXY ON bug12818542_dest@localhost TO bug12818542@localhost;
+connect bug12818542_con,localhost,bug12818542,bug12818542_dest;
+connection bug12818542_con;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
bug12818542@localhost bug12818542_dest@localhost
SET PASSWORD = PASSWORD('bruhaha');
+connection default;
+disconnect bug12818542_con;
+connect bug12818542_con2,localhost,bug12818542,bug12818542_dest;
+connection bug12818542_con2;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
bug12818542@localhost bug12818542_dest@localhost
+connection default;
+disconnect bug12818542_con2;
DROP USER bug12818542@localhost;
DROP USER bug12818542_dest@localhost;
SET GLOBAL SQL_MODE=default;
diff --git a/mysql-test/r/plugin_auth_qa_1.result b/mysql-test/r/plugin_auth_qa_1.result
index 44b5a88de1e..42a7b1491c0 100644
--- a/mysql-test/r/plugin_auth_qa_1.result
+++ b/mysql-test/r/plugin_auth_qa_1.result
@@ -96,14 +96,14 @@ CREATE USER plug_user
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
GRANT PROXY ON plug_dest TO plug_user;
-connect(plug_user,localhost,plug_user,plug_dest);
+connect plug_user,localhost,plug_user,plug_dest;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
plug_user@localhost plug_dest@%
connection default;
disconnect plug_user;
RENAME USER plug_user TO new_user;
-connect(plug_user,localhost,new_user,plug_dest);
+connect plug_user,localhost,new_user,plug_dest;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
new_user@localhost plug_dest@%
@@ -125,7 +125,7 @@ CREATE USER plug_user
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
GRANT PROXY ON plug_dest TO plug_user;
-connect(plug_user,localhost,plug_user,plug_dest);
+connect plug_user,localhost,plug_user,plug_dest;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
plug_user@localhost plug_dest@%
@@ -153,7 +153,6 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string
new_user new_plugin_server new_dest
plug_dest
-connect(plug_user,localhost,new_user,new_dest);
ERROR HY000: Plugin 'new_plugin_server' is not loaded
UPDATE mysql.user SET plugin='test_plugin_server' WHERE user='new_user';
UPDATE mysql.user SET USER='new_dest' WHERE user='plug_dest';
@@ -163,7 +162,7 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string
new_dest
new_user test_plugin_server new_dest
-connect(plug_user,localhost,new_user,new_dest);
+connect plug_user,localhost,new_user,new_dest;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
new_user@localhost new_dest@%
@@ -178,7 +177,7 @@ new_dest
new_user test_plugin_server new_dest
plug_dest
GRANT ALL PRIVILEGES ON test.* TO new_user;
-connect(plug_user,localhost,new_dest,new_dest_passwd);
+connect plug_user,localhost,new_dest,new_dest_passwd;
select USER(),CURRENT_USER();
USER() CURRENT_USER()
new_dest@localhost new_dest@%
@@ -192,7 +191,7 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string
test_plugin_server proxied_user
proxied_user
-connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
proxied_user@localhost proxied_user@%
@@ -202,16 +201,15 @@ SELECT @@proxy_user;
NULL
connection default;
disconnect proxy_con;
-connect(proxy_con,localhost,proxy_user,proxied_user);
ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES)
GRANT PROXY ON proxied_user TO ''@'%%';
-connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
proxied_user@localhost proxied_user@%
connection default;
disconnect proxy_con;
-connect(proxy_con,localhost,proxy_user,proxied_user);
+connect proxy_con,localhost,proxy_user,proxied_user;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
proxy_user@localhost proxied_user@%
@@ -229,7 +227,7 @@ SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
user plugin authentication_string
test_plugin_server proxied_user
proxied_user
-connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
proxied_user@localhost proxied_user@%
@@ -238,16 +236,15 @@ SELECT @@proxy_user;
NULL
connection default;
disconnect proxy_con;
-connect(proxy_con,localhost,proxy_user,proxied_user);
ERROR 28000: Access denied for user 'proxy_user'@'localhost' (using password: YES)
GRANT PROXY ON proxied_user TO ''@'%%';
-connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
+connect proxy_con,localhost,proxied_user,proxied_user_passwd;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
proxied_user@localhost proxied_user@%
connection default;
disconnect proxy_con;
-connect(proxy_con,localhost,proxy_user,proxied_user);
+connect proxy_con,localhost,proxy_user,proxied_user;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
proxy_user@localhost proxied_user@%
@@ -276,11 +273,11 @@ proxied_user_2
proxied_user_3
proxied_user_4
proxied_user_5
-connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
-connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
-connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
-connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
-connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
+connect proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd';
+connect proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd;
+connect proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd;
+connect proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd;
+connect proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd;
connection proxy_con_1;
SELECT USER(),CURRENT_USER();
USER() CURRENT_USER()
diff --git a/mysql-test/r/plugin_not_embedded.result b/mysql-test/r/plugin_not_embedded.result
index 8106abc497f..2edf6c496d3 100644
--- a/mysql-test/r/plugin_not_embedded.result
+++ b/mysql-test/r/plugin_not_embedded.result
@@ -3,11 +3,16 @@
#
CREATE USER bug51770@localhost;
GRANT INSERT ON mysql.plugin TO bug51770@localhost;
+connect con1,localhost,bug51770,,;
INSTALL PLUGIN example SONAME 'ha_example.so';
UNINSTALL PLUGIN example;
ERROR 42000: DELETE command denied to user 'bug51770'@'localhost' for table 'plugin'
+connection default;
GRANT DELETE ON mysql.plugin TO bug51770@localhost;
+connection con1;
UNINSTALL PLUGIN example;
+disconnect con1;
+connection default;
DROP USER bug51770@localhost;
INSTALL PLUGIN example SONAME '../ha_example.so';
ERROR HY000: No paths allowed for shared library
diff --git a/mysql-test/r/plugin_vars.result b/mysql-test/r/plugin_vars.result
index 869e0cf9a2a..0e382427b1d 100644
--- a/mysql-test/r/plugin_vars.result
+++ b/mysql-test/r/plugin_vars.result
@@ -15,8 +15,18 @@ WHILE x DO
SET x= x - 1;
SHOW VARIABLES;
END WHILE|
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
CALL p_install(100);
+connection con2;
CALL p_show_vars(100);
+connection default;
+connection con1;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
USE test;
DROP PROCEDURE p_install;
DROP PROCEDURE p_show_vars;
diff --git a/mysql-test/r/pool_of_threads.result b/mysql-test/r/pool_of_threads.result
index 9611d7ff43b..96ed24a0967 100644
--- a/mysql-test/r/pool_of_threads.result
+++ b/mysql-test/r/pool_of_threads.result
@@ -2157,23 +2157,36 @@ Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
SET optimizer_switch=@save_optimizer_switch;
+connection default;
SELECT sleep(5.5);
+connect con2,localhost,root,,;
+connection con2;
SELECT sleep(5);
# -- Success: more than --thread_pool_max_threads normal connections not possible
+connection default;
sleep(5.5)
0
+connection con2;
sleep(5)
0
+connection default;
SELECT sleep(5);
+connection con2;
SELECT sleep(5);
+connect extracon,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,;
+connection extracon;
SELECT 'Connection on extra port ok';
Connection on extra port ok
Connection on extra port ok
+connect extracon2,127.0.0.1,root,,test,$MASTER_EXTRA_PORT,;
+connection extracon2;
SELECT 'Connection on extra port 2 ok';
Connection on extra port 2 ok
Connection on extra port 2 ok
# -- Success: more than --extra-max-connections + 1 normal connections not possible
+connection default;
sleep(5)
0
+connection con2;
sleep(5)
0
diff --git a/mysql-test/r/processlist.result b/mysql-test/r/processlist.result
index ebec6175a5b..b8e2271530d 100644
--- a/mysql-test/r/processlist.result
+++ b/mysql-test/r/processlist.result
@@ -1,22 +1,30 @@
SET DEBUG_SYNC = 'dispatch_command_before_set_time WAIT_FOR do_set_time';
SELECT 1;
+connect con1,localhost,root,,;
SET DEBUG_SYNC = 'fill_schema_processlist_after_unow SIGNAL do_set_time WAIT_FOR fill_schema_proceed';
SELECT ID, TIME,TIME_MS FROM INFORMATION_SCHEMA.PROCESSLIST WHERE CONCAT(":", ID, ":") = ":TID:";
+connection default;
1
1
SET DEBUG_SYNC = 'now SIGNAL fill_schema_proceed';
+connection con1;
ID TIME TIME_MS
TID 0 0.000
set debug_sync='reset';
+connection default;
+connection con1;
SET debug_dbug="+d,sleep_inject_query_done_debug_sync";
select sleep(5);
sleep(5)
0
+connection default;
SET DEBUG_SYNC = 'now WAIT_FOR query_done';
select command, time < 5 from information_schema.processlist where id != connection_id();
command time < 5
Sleep 1
+disconnect con1;
set debug_sync='reset';
+connection default;
#
# 10.1 tests
#
diff --git a/mysql-test/r/ps.result b/mysql-test/r/ps.result
index e8a7eb133fb..d72ecd65547 100644
--- a/mysql-test/r/ps.result
+++ b/mysql-test/r/ps.result
@@ -897,10 +897,13 @@ show status like 'prepared_stmt_count';
Variable_name Value
Prepared_stmt_count 0
prepare stmt from "select 1";
+connect con1,localhost,root,,;
+connection con1;
prepare stmt from "select 2";
prepare stmt1 from "select 3";
prepare stmt2 from "select 4";
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 3)
+connection default;
prepare stmt2 from "select 4";
ERROR 42000: Can't create more than max_prepared_stmt_count statements (current value: 3)
select @@max_prepared_stmt_count;
@@ -909,6 +912,8 @@ select @@max_prepared_stmt_count;
show status like 'prepared_stmt_count';
Variable_name Value
Prepared_stmt_count 3
+disconnect con1;
+connection default;
deallocate prepare stmt;
select @@max_prepared_stmt_count;
@@max_prepared_stmt_count
@@ -2895,12 +2900,14 @@ INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (i INT);
INSERT INTO t2 VALUES (2);
LOCK TABLE t1 READ, t2 WRITE;
+connect conn1, localhost, root, , ;
PREPARE stmt1 FROM "SELECT i FROM t1";
PREPARE stmt2 FROM "INSERT INTO t2 (i) VALUES (3)";
EXECUTE stmt1;
i
1
EXECUTE stmt2;
+connection default;
SELECT * FROM t2;
i
2
@@ -2913,6 +2920,7 @@ ALTER TABLE t1 ADD COLUMN j INT;
ALTER TABLE t2 ADD COLUMN j INT;
INSERT INTO t1 VALUES (4, 5);
INSERT INTO t2 VALUES (4, 5);
+connection conn1;
EXECUTE stmt1;
i
1
@@ -2924,6 +2932,8 @@ i j
3 NULL
4 5
3 NULL
+disconnect conn1;
+connection default;
DROP TABLE t1, t2;
drop table if exists t1;
Warnings:
@@ -3793,11 +3803,16 @@ DROP TABLE t1;
#
# Test that metadata locks taken during prepare are released.
#
+connect con1,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT);
+connection con1;
BEGIN;
PREPARE stmt1 FROM "SELECT * FROM t1";
+connection default;
DROP TABLE t1;
+disconnect con1;
#
# Bug#56115: invalid memory reads when PS selecting from
diff --git a/mysql-test/r/ps_ddl.result b/mysql-test/r/ps_ddl.result
index dec0d12c455..a665224f59d 100644
--- a/mysql-test/r/ps_ddl.result
+++ b/mysql-test/r/ps_ddl.result
@@ -1820,6 +1820,8 @@ create procedure p_12093(a int) select * from t_12093;
create function f_12093_unrelated() returns int return 2;
create procedure p_12093_unrelated() begin end;
create view v_12093_unrelated as select * from t_12093;
+connect con1,localhost,root,,;
+connection default;
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
@@ -1827,7 +1829,9 @@ f_12093()
0
execute stmt_sp;
a
+connection con1;
drop function f_12093_unrelated;
+connection default;
# XXX: used to be a bug
execute stmt_sf;
f_12093()
@@ -1842,6 +1846,7 @@ f_12093()
# XXX: used to be a bug
execute stmt_sp;
a
+connection default;
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
@@ -1849,7 +1854,9 @@ f_12093()
0
execute stmt_sp;
a
+connection con1;
drop procedure p_12093_unrelated;
+connection default;
# XXX: used to be a bug
execute stmt_sf;
f_12093()
@@ -1864,6 +1871,7 @@ f_12093()
# XXX: used to be a bug
execute stmt_sp;
a
+connection default;
prepare stmt_sf from 'select f_12093();';
prepare stmt_sp from 'call p_12093(f_12093())';
execute stmt_sf;
@@ -1871,7 +1879,9 @@ f_12093()
0
execute stmt_sp;
a
+connection con1;
drop view v_12093_unrelated;
+connection default;
# XXX: used to be a bug
execute stmt_sf;
f_12093()
@@ -1886,9 +1896,11 @@ f_12093()
# XXX: used to be a bug
execute stmt_sp;
a
+connection default;
call p_verify_reprepare_count(6);
SUCCESS
+disconnect con1;
drop table t_12093;
drop function f_12093;
drop procedure p_12093;
diff --git a/mysql-test/r/ps_grant.result b/mysql-test/r/ps_grant.result
index 388f6aa7c91..0e296cdc699 100644
--- a/mysql-test/r/ps_grant.result
+++ b/mysql-test/r/ps_grant.result
@@ -13,6 +13,8 @@ show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+connect con3,localhost,second_user,looser,mysqltest;
+connection con3;
select current_user();
current_user()
second_user@localhost
@@ -27,6 +29,7 @@ my_col
1
select a as my_col from t1;
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
+connection default;
grant select on mysqltest.t1 to second_user@localhost
identified by 'looser' ;
show grants for second_user@localhost ;
@@ -40,6 +43,7 @@ Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
GRANT SELECT ON `mysqltest`.`t1` TO 'second_user'@'localhost'
+connection con3;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
@@ -55,17 +59,21 @@ my_col
execute s_t9 ;
ERROR 42S02: Table 'mysqltest.t9' doesn't exist
deallocate prepare s_t9;
+connection default;
revoke all privileges on mysqltest.t1 from second_user@localhost;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
+connection con3;
show grants for second_user@localhost ;
Grants for second_user@localhost
GRANT USAGE ON *.* TO 'second_user'@'localhost' IDENTIFIED BY PASSWORD '*13843FE600B19A81E32AF50D4A6FED25875FF1F3'
GRANT SELECT ON `mysqltest`.`t9` TO 'second_user'@'localhost'
execute s_t1 ;
ERROR 42000: SELECT command denied to user 'second_user'@'localhost' for table 't1'
+connection default;
+disconnect con3;
revoke all privileges, grant option from second_user@localhost ;
show grants for second_user@localhost ;
Grants for second_user@localhost
diff --git a/mysql-test/r/query_cache_28249.result b/mysql-test/r/query_cache_28249.result
index 72d713e8e70..ba694179ceb 100644
--- a/mysql-test/r/query_cache_28249.result
+++ b/mysql-test/r/query_cache_28249.result
@@ -3,8 +3,10 @@ SET @query_cache_limit= @@global.query_cache_limit;
SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
SET @query_cache_size= @@global.query_cache_size;
# Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
-# Establish connections user1,user2,user3 (user=root)
-# Switch to connection user1
+connect user1,localhost,root,,test,,;
+connect user2,localhost,root,,test,,;
+connect user3,localhost,root,,test,,;
+connection user1;
SET GLOBAL query_cache_type=1;
SET GLOBAL query_cache_limit=10000;
SET GLOBAL query_cache_min_res_unit=0;
@@ -14,13 +16,13 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
-# Switch to connection user2
+connection user2;
LOCK TABLE t2 WRITE;
-# Switch to connection user1
+connection user1;
# "send" the next select, "reap" the result later.
# The select will be blocked by the write lock on the t1.
SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
-# Switch to connection user3
+connection user3;
# Poll till the select of connection user1 is blocked by the write lock on t1.
SELECT user,command,state,info FROM information_schema.processlist
WHERE state = 'Waiting for table metadata lock'
@@ -28,18 +30,18 @@ WHERE state = 'Waiting for table metadata lock'
user command state info
root Query Waiting for table metadata lock SELECT *, (SELECT COUNT(*) FROM t2) FROM t1
INSERT INTO t1 VALUES (4);
-# Switch to connection user2
+connection user2;
UNLOCK TABLES;
-# Switch to connection user1
+connection user1;
# Collecting ("reap") the result from the previously blocked select.
# The printing of the result (varies between 3 and 4 rows) set has to be suppressed.
-# Switch to connection user3
+connection user3;
# The next select enforces that effects of "concurrent_inserts" like the
# record with a = 4 is missing in result sets can no more happen.
SELECT 1 FROM t1 WHERE a = 4;
1
1
-# Switch to connection user1
+connection user1;
# The next result set must contain 4 rows.
SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
a (SELECT COUNT(*) FROM t2)
@@ -55,7 +57,10 @@ a (SELECT COUNT(*) FROM t2)
3 0
4 0
DROP TABLE t1,t2;
-# Switch to connection default + close connections user1,user2,user3
+connection default;
+disconnect user1;
+disconnect user2;
+disconnect user3;
SET GLOBAL query_cache_type= @query_cache_type;
SET GLOBAL query_cache_limit= @query_cache_limit;
SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
diff --git a/mysql-test/r/query_cache_debug.result b/mysql-test/r/query_cache_debug.result
index 01c642b325b..afc1eb3d135 100644
--- a/mysql-test/r/query_cache_debug.result
+++ b/mysql-test/r/query_cache_debug.result
@@ -5,24 +5,34 @@ set global query_cache_size= 1024*768;
drop table if exists t1;
create table t1 (a varchar(100));
insert into t1 values ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
+connect bug30887con1, localhost, root, ,test;
+connect bug30887con2, localhost, root, ,test;
+connection bug30887con1;
Activate debug hook and attempt to retrieve the statement from the cache.
set debug_sync="wait_in_query_cache_insert SIGNAL parked WAIT_FOR go";
select SQL_CACHE * from t1;;
+connection default;
set debug_sync="now WAIT_FOR parked";
-On a second connection; clear the query cache.
+connection bug30887con2;
+clear the query cache.
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
set global query_cache_size= 0;
+connection default;
Signal the debug hook to release the lock.
set debug_sync="now SIGNAL go";
Show query cache status.
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
+connection bug30887con1;
a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
+disconnect bug30887con1;
+disconnect bug30887con2;
+connection default;
set debug_sync= 'RESET';
set global query_cache_size= 0;
use test;
@@ -36,24 +46,26 @@ INSERT INTO t1 VALUES (1),(2),(3);
SET GLOBAL concurrent_insert= 1;
SET GLOBAL query_cache_size= 1024*512;
SET GLOBAL query_cache_type= ON;
-# Switch to connection con1
+connect con1,localhost,root,,test,,;
+connect con2,localhost,root,,test,,;
+connection con1;
SET DEBUG_SYNC = "wait_after_query_cache_invalidate SIGNAL parked WAIT_FOR go";
# Send concurrent insert, will wait in the query cache table invalidate
INSERT INTO t1 VALUES (4);
-# Switch to connection default
+connection default;
# Wait for concurrent insert to reach the debug point
SET DEBUG_SYNC = "now WAIT_FOR parked";
-# Switch to connection con2
+connection con2;
# Send SELECT that shouldn't be cached
SELECT * FROM t1;
a
1
2
3
-# Switch to connection default
+connection default;
# Notify the concurrent insert to proceed
SET DEBUG_SYNC = "now SIGNAL go";
-# Switch to connection con1
+connection con1;
# Gather insert result
SHOW STATUS LIKE "Qcache_queries_in_cache";
Variable_name Value
@@ -68,7 +80,9 @@ a
SHOW STATUS LIKE "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
-# Disconnect
+disconnect con1;
+disconnect con2;
+connection default;
# Restore defaults
SET DEBUG_SYNC= 'RESET';
RESET QUERY CACHE;
@@ -93,7 +107,10 @@ INSERT INTO t2 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa')
INSERT INTO t3 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
INSERT INTO t4 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
INSERT INTO t5 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'),('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb');
-=================================== Connection thd1
+connect thd2, localhost, root, ,test;
+connect thd3, localhost, root, ,test;
+connect thd1, localhost, root, ,test;
+connection thd1;
**
** Load Query Cache with a result set and one table.
**
@@ -116,27 +133,27 @@ bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
SET DEBUG_SYNC="wait_in_query_cache_invalidate1 SIGNAL parked1_1 WAIT_FOR go1_1";
SET DEBUG_SYNC="wait_in_query_cache_invalidate2 SIGNAL parked1_2 WAIT_FOR go1_2";
DELETE FROM t1 WHERE a like '%a%';;
-=================================== Connection default
+connection default;
** Assert that the expect process status is obtained.
SET DEBUG_SYNC="now WAIT_FOR parked1_1";
**
-=================================== Connection thd2
+connection thd2;
** On THD2: Insert a result into the cache. This attempt will be blocked
** because of a debug hook placed just before the mutex lock after which
** the first part of the result set is written.
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2 EXECUTE 1";
SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3;
-=================================== Connection default
+connection default;
** Assert that the SELECT-stmt thread reaches the sync point.
SET DEBUG_SYNC="now WAIT_FOR parked2";
**
**
-=================================== Connection thd3
+connection thd3;
** On THD3: Insert another result into the cache and block on the same
** debug hook.
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3 EXECUTE 1";
SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5;
-=================================== Connection default
+connection default;
** Assert that the SELECT-stmt thread reaches the sync point.
SET DEBUG_SYNC="now WAIT_FOR parked3";
**
@@ -166,23 +183,28 @@ SET DEBUG_SYNC="now SIGNAL go1_2";
**
*************************************************************************
** No tables should be locked
-=================================== Connection thd2
+connection thd2;
a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
DELETE FROM t1;
DELETE FROM t2;
DELETE FROM t3;
-=================================== Connection thd3
+connection thd3;
a
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
DELETE FROM t4;
DELETE FROM t5;
-=================================== Connection thd1
+connection thd1;
** Done.
+connection default;
+disconnect thd1;
+disconnect thd2;
+disconnect thd3;
SET DEBUG_SYNC= 'RESET';
SET GLOBAL query_cache_size= 0;
+connection default;
# Restore defaults
RESET QUERY CACHE;
FLUSH STATUS;
@@ -199,22 +221,27 @@ INSERT INTO t1 VALUES (1),(2),(3);
SET GLOBAL concurrent_insert= 1;
SET GLOBAL query_cache_size= 1024*512;
SET GLOBAL query_cache_type= ON;
-# Switch to connection con1
+connect con1,localhost,root,,test,,;
+connect con2,localhost,root,,test,,;
+connection con1;
SET DEBUG_SYNC = "wait_in_query_cache_invalidate2 SIGNAL parked WAIT_FOR go";
# Send INSERT, will wait in the query cache table invalidation
INSERT INTO t1 VALUES (4);;
-# Switch to connection default
+connection default;
# Wait for insert to reach the debug point
SET DEBUG_SYNC = "now WAIT_FOR parked";
-# Switch to connection con2
+connection con2;
# Send a query that should wait on the query cache lock
RESET QUERY CACHE;
-# Switch to connection default
+connection default;
# Wait for the state to be reflected in the processlist
# Signal that the query cache can be unlocked
SET DEBUG_SYNC="now SIGNAL go";
-# Reap con1 and disconnect
-# Reap con2 and disconnect
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
# Restore defaults
SET DEBUG_SYNC= 'RESET';
RESET QUERY CACHE;
diff --git a/mysql-test/r/query_cache_notembedded.result b/mysql-test/r/query_cache_notembedded.result
index 400ac2b2718..bfb8f4d1ff7 100644
--- a/mysql-test/r/query_cache_notembedded.result
+++ b/mysql-test/r/query_cache_notembedded.result
@@ -84,21 +84,31 @@ show status like "Qcache_free_blocks";
Variable_name Value
Qcache_free_blocks 1
drop table t1, t2, t3, t11, t21;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
CREATE TABLE t1 ( a INT NOT NULL PRIMARY KEY AUTO_INCREMENT ) ENGINE =
MyISAM;
LOCK TABLE t1 READ LOCAL;
+connect root2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root2;
INSERT INTO t1 VALUES (), (), ();
+connection root;
SELECT * FROM t1;
a
+connection root2;
SELECT * FROM t1;
a
1
2
3
+connection root;
SELECT * FROM t1;
a
UNLOCK TABLES;
drop table t1;
+connection default;
+disconnect root;
+disconnect root2;
flush query cache;
reset query cache;
flush status;
@@ -319,6 +329,7 @@ drop procedure f2;
drop procedure f3;
drop procedure f4;
drop table t1;
+connection default;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
SET GLOBAL log_bin_trust_function_creators = 1;
reset query cache;
@@ -333,15 +344,21 @@ insert into t1 values(3);
set i_var = sleep(3);
return 0;
end;|
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
select f1();
+connection con2;
select sleep(4);
sleep(4)
0
select * from t1;
id
3
+connection con1;
f1()
0
+connection con2;
select * from t1;
id
3
@@ -351,6 +368,9 @@ id
3
drop table t1;
drop function f1;
+disconnect con1;
+disconnect con2;
+connection default;
set GLOBAL query_cache_size=0;
SET @@global.log_bin_trust_function_creators = @old_log_bin_trust_function_creators;
DROP DATABASE IF EXISTS bug30269;
@@ -363,6 +383,8 @@ INSERT INTO test1 VALUES (5, 'testit');
GRANT SELECT (id) ON TABLE bug30269.test1 TO 'bug30269'@'localhost';
GRANT SELECT ON TABLE bug30269.view1 TO 'bug30269'@'localhost';
set global query_cache_size= 81920;
+connect bug30269, localhost, bug30269,,;
+connection bug30269;
USE bug30269;
show status like 'Qcache_queries_in_cache';
Variable_name Value
@@ -380,8 +402,10 @@ id
show status like 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
+connection default;
USE test;
DROP DATABASE bug30269;
+disconnect bug30269;
DROP USER 'bug30269'@'localhost';
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
diff --git a/mysql-test/r/query_cache_ps_no_prot.result b/mysql-test/r/query_cache_ps_no_prot.result
index 5076003a7fb..ef1f92b597d 100644
--- a/mysql-test/r/query_cache_ps_no_prot.result
+++ b/mysql-test/r/query_cache_ps_no_prot.result
@@ -1,7 +1,7 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
----- establish connection con1 (root) ----
----- switch to connection default ----
+connect con1,localhost,root,,test,$MASTER_MYPORT,;
+connection default;
set @initial_query_cache_size = @@global.query_cache_size;
set @@global.query_cache_size=102400;
flush status;
@@ -49,7 +49,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 5
----- switch to connection con1 ----
+connection con1;
prepare stmt3 from "select * from t1 where c1=10";
execute stmt3;
c1
@@ -69,7 +69,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 8
----- switch to connection default ----
+connection default;
prepare stmt10 from "SELECT * FROM t1 WHERE c1 = 100";
show status like 'Qcache_hits';
Variable_name Value
@@ -92,18 +92,18 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 10
----- switch to connection con1 ----
+connection con1;
SELECT * FROM t1 WHERE c1 = 100;
c1
100
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 11
----- switch to connection default ----
+connection default;
prepare stmt11 from "SELECT * FROM t1 WHERE c1 = 1";
----- switch to connection con1 ----
+connection con1;
prepare stmt12 from "SELECT * FROM t1 WHERE c1 = 1";
----- switch to connection default ----
+connection default;
SELECT * FROM t1 WHERE c1 = 1;
c1
1
@@ -122,14 +122,14 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 13
----- switch to connection con1 ----
+connection con1;
execute stmt12;
c1
1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 14
----- switch to connection default ----
+connection default;
prepare stmt1 from "select * from t1 where c1=?";
show status like 'Qcache_hits';
Variable_name Value
@@ -147,7 +147,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 15
----- switch to connection con1 ----
+connection con1;
set @a=1;
prepare stmt4 from "select * from t1 where c1=?";
execute stmt4 using @a;
@@ -169,7 +169,7 @@ execute stmt4 using @a;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 16
----- switch to connection default ----
+connection default;
prepare stmt1 from "select * from t1 where c1=10";
set global query_cache_size=0;
show status like 'Qcache_hits';
@@ -193,7 +193,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 16
----- switch to connection con1 ----
+connection con1;
execute stmt3;
c1
10
@@ -212,7 +212,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 16
----- switch to connection default ----
+connection default;
set global query_cache_size=102400;
execute stmt1;
c1
@@ -232,7 +232,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 18
----- switch to connection con1 ----
+connection con1;
execute stmt3;
c1
10
@@ -251,7 +251,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
----- switch to connection default ----
+connection default;
set global query_cache_size=0;
show status like 'Qcache_hits';
Variable_name Value
@@ -274,7 +274,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
----- switch to connection con1 ----
+connection con1;
execute stmt3;
c1
10
@@ -293,12 +293,12 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
----- switch to connection default ----
+connection default;
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=10";
----- switch to connection con1 ----
+connection con1;
prepare stmt3 from "select * from t1 where c1=10";
----- switch to connection default ----
+connection default;
set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
@@ -321,7 +321,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
----- switch to connection con1 ----
+connection con1;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
@@ -343,7 +343,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
----- switch to connection default ----
+connection default;
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
set global query_cache_size=102400;
@@ -372,7 +372,7 @@ show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 21
drop table t1;
----- disconnect connection con1 ----
+disconnect con1;
########################################################################
#
# BUG#25843: Changing default database between PREPARE and EXECUTE of
diff --git a/mysql-test/r/query_cache_ps_ps_prot.result b/mysql-test/r/query_cache_ps_ps_prot.result
index 4105bc40f94..e3f2da1dbbe 100644
--- a/mysql-test/r/query_cache_ps_ps_prot.result
+++ b/mysql-test/r/query_cache_ps_ps_prot.result
@@ -1,7 +1,7 @@
set GLOBAL query_cache_type=ON;
set LOCAL query_cache_type=ON;
----- establish connection con1 (root) ----
----- switch to connection default ----
+connect con1,localhost,root,,test,$MASTER_MYPORT,;
+connection default;
set @initial_query_cache_size = @@global.query_cache_size;
set @@global.query_cache_size=102400;
flush status;
@@ -49,7 +49,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 5
----- switch to connection con1 ----
+connection con1;
prepare stmt3 from "select * from t1 where c1=10";
execute stmt3;
c1
@@ -69,7 +69,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 8
----- switch to connection default ----
+connection default;
prepare stmt10 from "SELECT * FROM t1 WHERE c1 = 100";
show status like 'Qcache_hits';
Variable_name Value
@@ -92,18 +92,18 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 9
----- switch to connection con1 ----
+connection con1;
SELECT * FROM t1 WHERE c1 = 100;
c1
100
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 10
----- switch to connection default ----
+connection default;
prepare stmt11 from "SELECT * FROM t1 WHERE c1 = 1";
----- switch to connection con1 ----
+connection con1;
prepare stmt12 from "SELECT * FROM t1 WHERE c1 = 1";
----- switch to connection default ----
+connection default;
SELECT * FROM t1 WHERE c1 = 1;
c1
1
@@ -122,14 +122,14 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 11
----- switch to connection con1 ----
+connection con1;
execute stmt12;
c1
1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 12
----- switch to connection default ----
+connection default;
prepare stmt1 from "select * from t1 where c1=?";
show status like 'Qcache_hits';
Variable_name Value
@@ -147,7 +147,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 13
----- switch to connection con1 ----
+connection con1;
set @a=1;
prepare stmt4 from "select * from t1 where c1=?";
execute stmt4 using @a;
@@ -169,7 +169,7 @@ execute stmt4 using @a;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 14
----- switch to connection default ----
+connection default;
prepare stmt1 from "select * from t1 where c1=10";
set global query_cache_size=0;
show status like 'Qcache_hits';
@@ -193,7 +193,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 14
----- switch to connection con1 ----
+connection con1;
execute stmt3;
c1
10
@@ -212,7 +212,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 14
----- switch to connection default ----
+connection default;
set global query_cache_size=102400;
execute stmt1;
c1
@@ -232,7 +232,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 16
----- switch to connection con1 ----
+connection con1;
execute stmt3;
c1
10
@@ -251,7 +251,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
----- switch to connection default ----
+connection default;
set global query_cache_size=0;
show status like 'Qcache_hits';
Variable_name Value
@@ -274,7 +274,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
----- switch to connection con1 ----
+connection con1;
execute stmt3;
c1
10
@@ -293,12 +293,12 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
----- switch to connection default ----
+connection default;
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=10";
----- switch to connection con1 ----
+connection con1;
prepare stmt3 from "select * from t1 where c1=10";
----- switch to connection default ----
+connection default;
set global query_cache_size=102400;
show status like 'Qcache_hits';
Variable_name Value
@@ -321,7 +321,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
----- switch to connection con1 ----
+connection con1;
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
@@ -343,7 +343,7 @@ c1
show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
----- switch to connection default ----
+connection default;
set global query_cache_size=0;
prepare stmt1 from "select * from t1 where c1=?";
set global query_cache_size=102400;
@@ -372,7 +372,7 @@ show status like 'Qcache_hits';
Variable_name Value
Qcache_hits 19
drop table t1;
----- disconnect connection con1 ----
+disconnect con1;
########################################################################
#
# BUG#25843: Changing default database between PREPARE and EXECUTE of
diff --git a/mysql-test/r/quick_select_4161.result b/mysql-test/r/quick_select_4161.result
index 18ac4362a84..30ae0a09edc 100644
--- a/mysql-test/r/quick_select_4161.result
+++ b/mysql-test/r/quick_select_4161.result
@@ -22,11 +22,16 @@ INSERT INTO t1 VALUES ('1999-07-10',100100,24), ('1999-07-11',100100,25),
('1999-08-24',100600,3), ('1999-08-24',100600,32), ('1999-08-27',100500,43),
('1999-08-31',100600,33), ('1999-09-17',100100,37), ('1999-09-18',100100,37),
('1999-09-19',100100,37), ('2000-12-18',100700,38);
+connect killee, localhost, root;
set debug_sync='inside_make_join_statistics signal killme wait_for done';
select event_date,type,event_id from t1 WHERE event_date >= "1999-07-01" AND event_date < "1999-07-15" AND (type=100600 OR type=100100) ORDER BY event_date;
+connection default;
set debug_sync='now wait_for killme';
kill %connection%;
set debug_sync='now signal done';
+connection killee;
Got one of the listed errors
+connection default;
+disconnect killee;
drop table t1;
set debug_sync='reset';
diff --git a/mysql-test/r/read_only.result b/mysql-test/r/read_only.result
index 964c259ebf8..e6fc5e670ef 100644
--- a/mysql-test/r/read_only.result
+++ b/mysql-test/r/read_only.result
@@ -2,7 +2,7 @@ set @start_read_only= @@global.read_only;
DROP TABLE IF EXISTS t1,t2,t3;
create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
-connect (con1,localhost,test,,test);
+connect con1,localhost,test,,test;
connection default;
set global read_only=0;
connection con1;
@@ -109,7 +109,7 @@ set global read_only=0;
flush tables with read lock;
set global read_only=1;
unlock tables;
-connect (root2,localhost,root,,test);
+connect root2,localhost,root,,test;
connection default;
set global read_only=0;
flush tables with read lock;
@@ -120,6 +120,7 @@ select @@global.read_only;
@@global.read_only
1
unlock tables;
+disconnect root2;
drop temporary table ttt;
ERROR 42S02: Unknown table 'test.ttt'
drop temporary table if exists ttt;
@@ -127,6 +128,7 @@ Warnings:
Note 1051 Unknown table 'test.ttt'
connection default;
set global read_only=0;
+disconnect con1;
drop table t1,t2;
drop user test@localhost;
#
@@ -145,7 +147,7 @@ grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
create database mysqltest_db1;
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
flush privileges;
-connect (con_bug27440,127.0.0.1,mysqltest_u1,,test,MASTER_MYPORT,);
+connect con_bug27440,127.0.0.1,mysqltest_u1,,test,$MASTER_MYPORT,;
connection con_bug27440;
create database mysqltest_db2;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
@@ -171,6 +173,8 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1), (2);
CREATE USER user1;
+connect con1, localhost, user1;
+connection default;
SET GLOBAL read_only= 1;
# All allowed with super privilege
START TRANSACTION;
@@ -181,6 +185,7 @@ START TRANSACTION READ WRITE;
COMMIT;
# We allow implicit RW transaction without super privilege
# for compatibility reasons
+connection con1;
START TRANSACTION;
# Check that table updates are still disallowed.
INSERT INTO t1 VALUES (3);
@@ -196,6 +201,8 @@ COMMIT;
START TRANSACTION READ WRITE;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
COMMIT;
+disconnect con1;
+connection default;
DROP USER user1;
SET GLOBAL read_only= 0;
DROP TABLE t1;
diff --git a/mysql-test/r/read_only_innodb.result b/mysql-test/r/read_only_innodb.result
index a276e6cbc19..abfc5322ed0 100644
--- a/mysql-test/r/read_only_innodb.result
+++ b/mysql-test/r/read_only_innodb.result
@@ -1,11 +1,16 @@
DROP TABLE IF EXISTS table_11733 ;
create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
+connect con1,localhost,test,,test;
+connection default;
set global read_only=0;
create table table_11733 (a int) engine=InnoDb;
+connection con1;
BEGIN;
insert into table_11733 values(11733);
+connection default;
set global read_only=1;
+connection con1;
select @@global.read_only;
@@global.read_only
1
@@ -14,14 +19,19 @@ a
11733
COMMIT;
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+connection default;
set global read_only=0;
drop table table_11733 ;
drop user test@localhost;
+disconnect con1;
create user test@localhost;
GRANT CREATE, SELECT, DROP ON *.* TO test@localhost;
+connect con1, localhost, test, , test;
+connection default;
CREATE TABLE t1(a INT) ENGINE=INNODB;
INSERT INTO t1 VALUES (0), (1);
SET GLOBAL read_only=1;
+connection con1;
SELECT * FROM t1;
a
0
@@ -32,8 +42,10 @@ a
0
1
COMMIT;
+connection default;
SET GLOBAL read_only=0;
FLUSH TABLES WITH READ LOCK;
+connection con1;
SELECT * FROM t1;
a
0
@@ -44,6 +56,7 @@ a
0
1
COMMIT;
+connection default;
UNLOCK TABLES;
connection con1;
lock table t1 read;
@@ -56,6 +69,7 @@ SET GLOBAL read_only=0;
UNLOCK TABLES;
DROP TABLE t1;
DROP USER test@localhost;
+disconnect con1;
echo End of 5.1 tests
#
# Bug#33669: Transactional temporary tables do not work under --read-only
@@ -71,7 +85,7 @@ INSERT INTO db1.t2 VALUES (2);
GRANT CREATE TEMPORARY TABLES, DROP, INSERT, DELETE, UPDATE,
SELECT, LOCK TABLES ON db1.* TO bug33669@localhost;
SET GLOBAL READ_ONLY = ON;
-# Connection con1 (user bug33669):
+connect con1,localhost,bug33669,,db1;
# Create, insert and drop temporary table:
@@ -225,6 +239,8 @@ DROP TABLE temp1, temp2;
# Disconnect and cleanup
+disconnect con1;
+connection default;
SET GLOBAL READ_ONLY = OFF;
DROP USER bug33669@localhost;
DROP DATABASE db1;
diff --git a/mysql-test/r/rename.result b/mysql-test/r/rename.result
index 74370ba74dd..2b8c925b309 100644
--- a/mysql-test/r/rename.result
+++ b/mysql-test/r/rename.result
@@ -40,20 +40,31 @@ select * from t3;
drop table if exists t1,t2,t3,t4;
Warnings:
Note 1051 Unknown table 'test.t4'
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
CREATE TABLE t1 (a int);
CREATE TABLE t3 (a int);
+connection con2;
FLUSH TABLES WITH READ LOCK;
+connection con1;
RENAME TABLE t1 TO t2, t3 to t4;
+connection con2;
show tables;
Tables_in_test
t1
t3
UNLOCK TABLES;
+connection con1;
+connection con2;
show tables;
Tables_in_test
t2
t4
drop table t2, t4;
+disconnect con2;
+disconnect con1;
+connection default;
End of 4.1 tests
#
# Bug#14959: "ALTER TABLE isn't able to rename a view"
diff --git a/mysql-test/r/rpl_mysqldump_slave.result b/mysql-test/r/rpl_mysqldump_slave.result
index 9d2fe860f47..903b671178f 100644
--- a/mysql-test/r/rpl_mysqldump_slave.result
+++ b/mysql-test/r/rpl_mysqldump_slave.result
@@ -3,7 +3,10 @@ include/master-slave.inc
#
# New --dump-slave, --apply-slave-statements functionality
#
+connection slave;
+connection master;
use test;
+connection slave;
-- SET GLOBAL gtid_slave_pos='';
CHANGE MASTER '' TO MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=BINLOG_START;
STOP ALL SLAVES;
@@ -23,9 +26,12 @@ start slave;
Warnings:
Note 1254 Slave is already running
*** Test mysqldump --dump-slave GTID functionality.
+connection master;
SET gtid_seq_no = 1000;
CREATE TABLE t1 (a INT PRIMARY KEY);
DROP TABLE t1;
+connection slave;
+connection slave;
CREATE TABLE t2 (a INT PRIMARY KEY);
DROP TABLE t2;
diff --git a/mysql-test/r/schema.result b/mysql-test/r/schema.result
index bb6dbd65f84..6d8271a49f3 100644
--- a/mysql-test/r/schema.result
+++ b/mysql-test/r/schema.result
@@ -16,80 +16,90 @@ drop schema foo;
# Bug #48940 MDL deadlocks against mysql_rm_db
#
DROP SCHEMA IF EXISTS schema1;
-# Connection default
+connect con2, localhost, root;
+connection default;
CREATE SCHEMA schema1;
CREATE TABLE schema1.t1 (a INT);
SET autocommit= FALSE;
INSERT INTO schema1.t1 VALUES (1);
-# Connection 2
+connection con2;
DROP SCHEMA schema1;
-# Connection default
+connection default;
ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8;
Got one of the listed errors
SET autocommit= TRUE;
-# Connection 2
-# Connection default
+connection con2;
+connection default;
+disconnect con2;
#
# Bug #49988 MDL deadlocks with mysql_create_db, reload_acl_and_cache
#
DROP SCHEMA IF EXISTS schema1;
-# Connection default
+connect con2, localhost, root;
+connection default;
CREATE SCHEMA schema1;
CREATE TABLE schema1.t1 (id INT);
LOCK TABLE schema1.t1 WRITE;
-# Connection con2
+connection con2;
DROP SCHEMA schema1;
-# Connection default
+connection default;
# CREATE SCHEMA used to give a deadlock.
# Now we prohibit CREATE SCHEMA in LOCK TABLES mode.
CREATE SCHEMA IF NOT EXISTS schema1;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
# UNLOCK TABLES so DROP SCHEMA can continue.
UNLOCK TABLES;
-# Connection con2
-# Connection default
+connection con2;
+connection default;
+disconnect con2;
#
# Bug#54360 Deadlock DROP/ALTER/CREATE DATABASE with open HANDLER
#
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
INSERT INTO db1.t1 VALUES (1), (2);
-# Connection con1
+connect con1, localhost, root;
HANDLER db1.t1 OPEN;
-# Connection default
+connection default;
# Sending:
DROP DATABASE db1;
-# Connection con2
-# Connection con1
+connect con2, localhost, root;
+connection con1;
CREATE DATABASE db2;
ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
HANDLER t1 CLOSE;
-# Connection default
+connection default;
# Reaping: DROP DATABASE db1
+disconnect con1;
+disconnect con2;
#
# Tests for increased CREATE/ALTER/DROP DATABASE concurrency with
# database name locks.
#
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
-# Connection default
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (id INT);
START TRANSACTION;
INSERT INTO db1.t1 VALUES (1);
-# Connection 2
+connection con2;
# DROP DATABASE should block due to the active transaction
# Sending:
DROP DATABASE db1;
-# Connection 3
+connection con3;
# But it should still be possible to CREATE/ALTER/DROP other databases.
CREATE DATABASE db2;
ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
-# Connection default
+connection default;
# End the transaction so DROP DATABASE db1 can continue
COMMIT;
-# Connection 2
+connection con2;
# Reaping: DROP DATABASE db1
-# Connection default;
+connection default;
+disconnect con2;
+disconnect con3;
diff --git a/mysql-test/r/shm.result b/mysql-test/r/shm.result
index a2c38627e9d..13f715b4e26 100644
--- a/mysql-test/r/shm.result
+++ b/mysql-test/r/shm.result
@@ -1,3 +1,4 @@
+connect shm_con,localhost,root,,,,$shm_name,SHM;
drop table if exists t1,t2,t3,t4;
CREATE TABLE t1 (
Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,
@@ -2154,6 +2155,8 @@ Privat (Private Nutzung) Mobilfunk
Warnings:
Warning 1052 Column 'kundentyp' in group statement is ambiguous
drop table t1;
+connection default;
+disconnect shm_con;
mysqld is alive
SET @max_allowed_packet= @@global.max_allowed_packet;
SET @net_buffer_length= @@global.net_buffer_length;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 654b00d68ae..c3e7588a56d 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -524,6 +524,8 @@ create user mysqltest_2@localhost;
grant usage on `mysqltest`.* to mysqltest_2@localhost;
create user mysqltest_3@localhost;
grant drop on `mysqltest`.* to mysqltest_3@localhost;
+connect con1,localhost,mysqltest_1,,mysqltest;
+connection con1;
select * from t1;
a
1
@@ -534,6 +536,9 @@ drop table t1;
ERROR 42000: DROP command denied to user 'mysqltest_1'@'localhost' for table 't1'
drop database mysqltest;
ERROR 42000: Access denied for user 'mysqltest_1'@'localhost' to database 'mysqltest'
+disconnect con1;
+connect con2,localhost,mysqltest_2,,test;
+connection con2;
select * from mysqltest.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_2'@'localhost' for table 't1'
show create database mysqltest;
@@ -542,6 +547,9 @@ drop table mysqltest.t1;
ERROR 42000: DROP command denied to user 'mysqltest_2'@'localhost' for table 't1'
drop database mysqltest;
ERROR 42000: Access denied for user 'mysqltest_2'@'localhost' to database 'mysqltest'
+disconnect con2;
+connect con3,localhost,mysqltest_3,,test;
+connection con3;
select * from mysqltest.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for table 't1'
show create database mysqltest;
@@ -549,6 +557,8 @@ Database Create Database
mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
drop table mysqltest.t1;
drop database mysqltest;
+disconnect con3;
+connection default;
set names binary;
delete from mysql.user
where user='mysqltest_1' || user='mysqltest_2' || user='mysqltest_3';
@@ -1284,9 +1294,13 @@ create table mysqltest.t1(a int);
insert into mysqltest.t1 values(1);
create user mysqltest_4@localhost;
grant select on `mysqltest`.`t1` to mysqltest_4@localhost;
+connect con4,localhost,mysqltest_4,,mysqltest;
+connection con4;
show create database mysqltest;
Database Create Database
mysqltest CREATE DATABASE `mysqltest` /*!40100 DEFAULT CHARACTER SET latin1 */
+disconnect con4;
+connection default;
delete from mysql.user where user='mysqltest_4';
delete from mysql.db where user='mysqltest_4';
delete from mysql.tables_priv where user='mysqltest_4';
@@ -1458,17 +1472,22 @@ DROP EVENT ev1;
SHOW STORAGE ENGINES;
CREATE USER test_u@localhost;
GRANT PROCESS ON *.* TO test_u@localhost;
+connect conn1, localhost, test_u,,;
SHOW ENGINE MYISAM MUTEX;
SHOW ENGINE MYISAM STATUS;
+disconnect conn1;
+connection default;
DROP USER test_u@localhost;
End of 5.1 tests
#
# Bug#52593 SHOW CREATE TABLE is blocked if table is locked
# for write by another connection
DROP TABLE IF EXISTS t1;
+connect con1, localhost,root;
+connection default;
CREATE TABLE t1 (i INT PRIMARY KEY);
LOCK TABLE t1 WRITE;
-# Switching to connection 'con1'.
+connection con1;
# This statement used to be blocked.
SHOW CREATE TABLE t1;
Table Create Table
@@ -1476,7 +1495,8 @@ t1 CREATE TABLE `t1` (
`i` int(11) NOT NULL,
PRIMARY KEY (`i`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-# Switching to connection 'default'.
+disconnect con1;
+connection default;
UNLOCK TABLES;
DROP TABLE t1;
#
@@ -1485,20 +1505,21 @@ DROP TABLE t1;
#
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
-# Connection con1
+connect con1,localhost,root;
LOCK TABLE t1 WRITE;
-# Connection default
+connection default;
START TRANSACTION;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-# Connection con1
+connection con1;
ALTER TABLE t1 CHARACTER SET = utf8;
UNLOCK TABLES;
-# Connection default
+connection default;
COMMIT;
+disconnect con1;
DROP TABLE t1;
#
# Bug#55498 SHOW CREATE TRIGGER takes wrong type of metadata lock.
@@ -1507,23 +1528,24 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT);
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1;
# Test 1: SHOW CREATE TRIGGER with WRITE locked table.
-# Connection con1
+connect con1, localhost, root;
LOCK TABLE t1 WRITE;
-# Connection default
+connection default;
SHOW CREATE TRIGGER t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci
-# Connection con1
+connection con1;
UNLOCK TABLES;
# Test 2: ALTER TABLE with SHOW CREATE TRIGGER in transaction
-# Connection default
+connection default;
START TRANSACTION;
SHOW CREATE TRIGGER t1_bi;
Trigger sql_mode SQL Original Statement character_set_client collation_connection Database Collation
t1_bi NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1 utf8 utf8_general_ci latin1_swedish_ci
-# Connection con1
+connection con1;
ALTER TABLE t1 CHARACTER SET = utf8;
-# Connection default
+disconnect con1;
+connection default;
COMMIT;
DROP TRIGGER t1_bi;
DROP TABLE t1;
@@ -1534,8 +1556,11 @@ SET NAMES latin1;
SELECT GET_LOCK('t', 1000);
GET_LOCK('t', 1000)
1
+connect con1,localhost,root,,;
+connection con1;
SET NAMES latin1;
SELECT GET_LOCK('t',1000) AS 'óóóó';;
+connection default;
SHOW PROCESSLIST;
Id User Host db Command Time State Info Progress
### root ### test Query ### ### SHOW PROCESSLIST 0.000
@@ -1548,8 +1573,11 @@ Id User Host db Command Time State Info Progress
SELECT RELEASE_LOCK('t');
RELEASE_LOCK('t')
1
+connection con1;
óóóó
1
+disconnect con1;
+connection default;
SET NAMES latin1;
#
# Test SHOW AUTHORS and SHOW CONTRIBUTORS
diff --git a/mysql-test/r/show_explain.result b/mysql-test/r/show_explain.result
index 0dc6f2b28ac..5a885766f7b 100644
--- a/mysql-test/r/show_explain.result
+++ b/mysql-test/r/show_explain.result
@@ -13,38 +13,48 @@ show explain for 2000000000;
ERROR HY000: Unknown thread id: 2000000000
show explain for (select max(a) from t0);
ERROR HY000: You may only use constant expressions in this statement
+connect con1, localhost, root,,;
+connection con1;
SET @old_debug= @@session.debug;
+connection default;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
show explain for $thr1;
ERROR HY000: Target is not running an EXPLAINable command
+connection con1;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select count(*) from t1 where a < 100000;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index a a 5 NULL 1000 Using where; Using index
Warnings:
Note 1003 select count(*) from t1 where a < 100000
+connection con1;
count(*)
1000
select max(c) from t1 where a < 10;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 10 Using index condition
Warnings:
Note 1003 select max(c) from t1 where a < 10
+connection con1;
max(c)
9
# We can catch EXPLAIN, too.
set @show_expl_tmp= @@optimizer_switch;
set optimizer_switch='index_condition_pushdown=on,mrr=on,mrr_sort_keys=on';
explain select max(c) from t1 where a < 10;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan
Warnings:
Note 1003 explain select max(c) from t1 where a < 10
+connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 10 Using index condition; Rowid-ordered scan
set optimizer_switch= @show_expl_tmp;
@@ -53,6 +63,7 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
@@ -60,6 +71,7 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1003 explain select a from t0 A union select a+1 from t0 B
+connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
@@ -69,6 +81,7 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a from t0 A union select a+1 from t0 B;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
@@ -76,6 +89,7 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1003 explain select a from t0 A union select a+1 from t0 B
+connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10
2 UNION B ALL NULL NULL NULL NULL 10
@@ -85,12 +99,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 B) from t0 A where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where
2 SUBQUERY B ALL NULL NULL NULL NULL 10
Warnings:
Note 1003 select a, (select max(a) from t0 B) from t0 A where a<1
+connection con1;
a (select max(a) from t0 B)
0 9
set debug_dbug=@old_debug;
@@ -98,12 +114,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
explain select a, (select max(a) from t0 B) from t0 A where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where
2 SUBQUERY B ALL NULL NULL NULL NULL 10
Warnings:
Note 1003 explain select a, (select max(a) from t0 B) from t0 A where a<1
+connection con1;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY A ALL NULL NULL NULL NULL 10 Using where
2 SUBQUERY B ALL NULL NULL NULL NULL 10
@@ -112,12 +130,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
+connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
set debug_dbug=@old_debug;
@@ -125,12 +145,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
+connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
set debug_dbug=@old_debug;
@@ -138,12 +160,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
+connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
set debug_dbug=@old_debug;
@@ -151,12 +175,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
+connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
set debug_dbug=@old_debug;
@@ -164,12 +190,14 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_end';
select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY a ALL NULL NULL NULL NULL 10 Using where
2 DEPENDENT SUBQUERY b ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select a, (select max(a) from t0 b where b.a+a.a<10) from t0 a where a<1
+connection con1;
a (select max(a) from t0 b where b.a+a.a<10)
0 9
set debug_dbug=@old_debug;
@@ -179,9 +207,11 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_start';
set @foo= (select max(a) from t0 where sin(a) >0);
+connection default;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
+connection con1;
ERROR 70100: Query execution was interrupted
set debug_dbug=@old_debug;
#
@@ -191,6 +221,7 @@ create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_start';
update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
@@ -203,6 +234,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 update t2 set dummy=0 where (select max(a) from t0 where t2.a + t0.a <3) >3
+connection con1;
drop table t2;
set debug_dbug=@old_debug;
#
@@ -212,6 +244,7 @@ create table t2 as select a as a, a as dummy from t0 limit 2;
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_start';
delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3 ;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
@@ -224,6 +257,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 delete from t2 where (select max(a) from t0 where t2.a + t0.a <3) >3
+connection con1;
drop table t2;
set debug_dbug=@old_debug;
#
@@ -233,6 +267,7 @@ create table t2 as select a as a, a as dummy from t0 limit 3;
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 3
@@ -251,6 +286,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DEPENDENT SUBQUERY t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select t2.a, ((select max(a) from t0 where t2.a + t0.a <3) >3) as SUBQ from t2
+connection con1;
a SUBQ
0 0
1 0
@@ -266,11 +302,13 @@ id select_type table type possible_keys key key_len ref rows Extra
set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select * from t0 order by a;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using filesort
Warnings:
Note 1003 select * from t0 order by a
+connection con1;
a
0
1
@@ -286,17 +324,21 @@ set debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary"
#
+connection default;
explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
+connection con1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
Warnings:
Note 1003 select distinct a from t0
+connection con1;
a
0
1
@@ -312,17 +354,21 @@ set debug_dbug=@old_debug;
#
# SHOW EXPLAIN for SELECT ... with "Using temporary; Using filesort"
#
+connection default;
explain select distinct a from t0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
+connection con1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
set @show_explain_probe_select_id=1;
select distinct a from t0;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using temporary
Warnings:
Note 1003 select distinct a from t0
+connection con1;
a
0
1
@@ -346,6 +392,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
set debug_dbug='+d,show_explain_in_find_all_keys';
SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a;
+connection default;
# FIXED by "conservative assumptions about when QEP is available" fix:
# NOTE: current code will not show "Using join buffer":
show explain for $thr2;
@@ -354,6 +401,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
Warnings:
Note 1003 SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a
+connection con1;
a
1
2
@@ -375,12 +423,14 @@ Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` join `test`.`t2` group
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_end';
EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a ;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 Using join buffer (flat, BNL join)
Warnings:
Note 1003 EXPLAIN EXTENDED SELECT alias.a FROM t2, ( SELECT * FROM t2 ) AS alias GROUP BY alias.a
+connection con1;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using temporary; Using filesort
1 SIMPLE t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join)
@@ -405,9 +455,11 @@ id select_type table type possible_keys key key_len ref rows Extra
set @show_explain_probe_select_id=2;
set debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM v1, t2;
+connection default;
show explain for $thr2;
ERROR HY000: Target is not running an EXPLAINable command
kill query $thr2;
+connection con1;
ERROR 70100: Query execution was interrupted
set debug_dbug=@old_debug;
DROP VIEW v1;
@@ -418,11 +470,13 @@ DROP TABLE t2, t3;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_end';
select sleep(1);
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select sleep(1)
+connection con1;
sleep(1)
0
set debug_dbug=@old_debug;
@@ -432,11 +486,13 @@ set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0 where 1>10;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
Warnings:
Note 1003 select * from t0 where 1>10
+connection con1;
a
set debug_dbug=@old_debug;
#
@@ -447,11 +503,13 @@ insert into t3 select a from t0;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_end';
select * from t0,t3 where t3.a=112233;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL no matching row in const table
Warnings:
Note 1003 select * from t0,t3 where t3.a=112233
+connection con1;
a a
set debug_dbug=@old_debug;
drop table t3;
@@ -477,6 +535,7 @@ SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
);
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using where
@@ -487,6 +546,7 @@ Note 1003 SELECT * FROM t2 WHERE a =
(SELECT MAX(a) FROM t2
WHERE pk= (SELECT MAX(pk) FROM t2 WHERE pk = 3)
)
+connection con1;
pk a
3 7
6 7
@@ -530,6 +590,7 @@ WHERE a1 < ALL (
SELECT a1 FROM t2
WHERE a1 IN ( SELECT a1 FROM t2, t4 )
);
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 index NULL a1 5 NULL 20 Using where; Using index
@@ -541,6 +602,7 @@ WHERE a1 < ALL (
SELECT a1 FROM t2
WHERE a1 IN ( SELECT a1 FROM t2, t4 )
)
+connection con1;
count(*)
1740
set debug_dbug=@old_debug;
@@ -555,6 +617,7 @@ INSERT INTO t2 VALUES
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_end';
SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`);
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <subquery2> const distinct_key distinct_key 8 const,const 1
@@ -562,6 +625,7 @@ id select_type table type possible_keys key key_len ref rows Extra
2 MATERIALIZED t2 index NULL a1 4 NULL 20 Using index
Warnings:
Note 1003 SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`)
+connection con1;
pk a1
set debug_dbug=@old_debug;
DROP TABLE t2;
@@ -574,11 +638,13 @@ INSERT INTO t1 VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT 'test' FROM t1 WHERE a=1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref a a 5 const 1 Using index
Warnings:
Note 1003 SELECT 'test' FROM t1 WHERE a=1
+connection con1;
test
test
test
@@ -602,6 +668,7 @@ id select_type table type possible_keys key key_len ref rows Extra
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_test_if_quick_select';
select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 100 Using where
@@ -626,6 +693,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE B ALL key1 NULL NULL NULL 100 Range checked for each record (index map: 0x1)
Warnings:
Note 1003 select count(*) from t1 A, t1 B where B.key1 < A.col2 and A.col1=3 AND B.col2 + 1 < 100
+connection con1;
count(*)
212
set debug_dbug=@old_debug;
@@ -639,11 +707,13 @@ INSERT INTO t1 (a) VALUES (3),(1),(5),(1);
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
SHOW INDEX FROM t1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE STATISTICS ALL NULL TABLE_SCHEMA,TABLE_NAME NULL NULL NULL Open_full_table; Scanned 0 databases
Warnings:
Note 1003 SHOW INDEX FROM t1
+connection con1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 a 1 a A NULL NULL NULL YES BTREE
t1 1 b 1 b A NULL NULL NULL YES BTREE
@@ -664,12 +734,14 @@ id select_type table type possible_keys key key_len ref rows Extra
set debug_dbug='+d,show_explain_probe_join_tab_preread';
set @show_explain_probe_select_id=1;
SELECT a + 1 FROM v1;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2
2 DERIVED t1 ALL NULL NULL NULL NULL 2
Warnings:
Note 1003 SELECT a + 1 FROM v1
+connection con1;
a + 1
2
3
@@ -691,6 +763,7 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
set debug_dbug='+d,show_explain_probe_union_read';
SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 );
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
@@ -707,6 +780,7 @@ id select_type table type possible_keys key key_len ref rows Extra
NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL
Warnings:
Note 1003 SELECT a FROM t1 WHERE a IN ( SELECT 1+SLEEP(0.01) UNION SELECT 2 )
+connection con1;
a
set debug_dbug=@old_debug;
DROP TABLE t1;
@@ -734,6 +808,7 @@ set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b );
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 20 Using where
@@ -743,6 +818,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 SELECT * FROM t1, ( SELECT * FROM t2 ) AS alias
WHERE a < ALL ( SELECT b FROM t1, t2 WHERE a = b )
+connection con1;
a b
set debug_dbug=@old_debug;
DROP TABLE t1, t2;
@@ -768,12 +844,14 @@ id select_type table type possible_keys key key_len ref rows Extra
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select distinct t1.a from t1,t3 where t1.a=t3.a;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 4 Using index; Using temporary
1 SIMPLE t3 ref a a 5 test.t1.a 7 Using index; Distinct
Warnings:
Note 1003 select distinct t1.a from t1,t3 where t1.a=t3.a
+connection con1;
a
1
2
@@ -785,19 +863,25 @@ drop table t1,t3,t4;
create user test2@localhost;
grant ALL on test.* to test2@localhost;
grant super on *.* to test2@localhost;
+connect con2, localhost, test2,,;
+connection con1;
#
# First, make sure that user 'test2' cannot do SHOW EXPLAIN on us
#
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
+connection default;
+connection con2;
show explain for $thr2;
ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select * from t0 where a < 3
+connection con1;
a
0
1
@@ -806,31 +890,44 @@ set debug_dbug=@old_debug;
#
# Check that user test2 can do SHOW EXPLAIN on its own queries
#
+connect con3, localhost, test2,,;
+connection con2;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
+connection con1;
+connection con3;
show explain for $thr_con2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select * from t0 where a < 3
+connection con2;
a
0
1
2
+connection con1;
+disconnect con3;
#
# Now, grant test2 a PROCESSLIST permission, and see that he's able to observe us
#
+disconnect con2;
grant process on *.* to test2@localhost;
+connect con2, localhost, test2,,;
+connection con1;
set debug_dbug=@old_debug;
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where a < 3;
+connection default;
+connection con2;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select * from t0 where a < 3
+connection con1;
a
0
1
@@ -838,10 +935,14 @@ a
set debug_dbug=@old_debug;
revoke all privileges on test.* from test2@localhost;
drop user test2@localhost;
+disconnect con2;
#
# Test that it is possible to KILL a SHOW EXPLAIN command that's waiting
# on its target thread
#
+connect con2, localhost, root,,;
+connect con3, localhost, root,,;
+connection con2;
create table t1 (pk int primary key, data char(64)) engine=innodb;
insert into t1 select A.a + 10 * B.a + 100 * C.a, 'data1' from t0 A, t0 B, t0 C;
# Lock two threads
@@ -859,12 +960,18 @@ pk data
18 data1
19 data1
20 data1
+connection con1;
set autocommit=0;
select * from t1 where pk between 10 and 20 for update;
+connection default;
# do: send_eval show explain for thr2;
+connection con3;
kill query $thr_default;
+connection default;
ERROR 70100: Query execution was interrupted
+connection con2;
rollback;
+connection con1;
pk data
10 data1
11 data1
@@ -878,6 +985,8 @@ pk data
19 data1
20 data1
drop table t1;
+disconnect con3;
+disconnect con2;
#
# Check that the I_S table is invisible
#
@@ -904,6 +1013,7 @@ set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
@@ -911,6 +1021,7 @@ Warnings:
Note 1003 SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b
+connection con1;
a+SLEEP(0.01)
0
5372
@@ -925,6 +1036,7 @@ set debug_dbug='+d,show_explain_probe_do_select';
SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index_merge a,b a,b 5,5 NULL 8 Using sort_union(a,b); Using where; Using filesort
@@ -932,6 +1044,7 @@ Warnings:
Note 1003 SELECT a+SLEEP(0.01) FROM t1
WHERE a IN ( 255, 0 ) OR b BETWEEN 6 AND 129
ORDER BY b
+connection con1;
a+SLEEP(0.01)
0
5372
@@ -956,11 +1069,13 @@ id select_type table type possible_keys key key_len ref rows Extra
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT a FROM t1 GROUP BY a;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4112 Using temporary; Using filesort
Warnings:
Note 1003 SELECT a FROM t1 GROUP BY a
+connection con1;
a
1
2
@@ -994,12 +1109,14 @@ id select_type table type possible_keys key key_len ref rows Extra
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's';
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where
2 DEPENDENT SUBQUERY t2 index_subquery PRIMARY,c c 5 func 1 Using index; Using where
Warnings:
Note 1003 SELECT SUM(a + SLEEP(0.1)) FROM t1 WHERE a IN ( SELECT c FROM t2 WHERE d < b ) OR b < 's'
+connection con1;
SUM(a + SLEEP(0.1))
7862
set debug_dbug=@old_debug;
@@ -1042,6 +1159,7 @@ id select_type table type possible_keys key key_len ref rows Extra
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_do_select';
SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 system NULL NULL NULL NULL 1 Using filesort
@@ -1049,6 +1167,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 ref PRIMARY PRIMARY 5 test.t1.b 1 Using index
Warnings:
Note 1003 SELECT b AS field1, b AS field2 FROM t1, t2, t3 WHERE d = b ORDER BY field1, field2
+connection con1;
field1 field2
set debug_dbug=@old_debug;
DROP TABLE t1,t2,t3;
@@ -1074,6 +1193,7 @@ set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY alias1 ALL NULL NULL NULL NULL 14
@@ -1082,6 +1202,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 SELECT max(a+b+c) FROM t1 AS alias1, ( SELECT * FROM t2 ) AS alias
WHERE EXISTS ( SELECT * FROM t3 WHERE b = c ) OR a <= 10
+connection con1;
max(a+b+c)
279
set debug_dbug=@old_debug;
@@ -1112,6 +1233,7 @@ E3FB
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_join_exec_start';
select * from t0 where length('ãû') = a;
+connection default;
set names utf8;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
@@ -1119,6 +1241,7 @@ id select_type table type possible_keys key key_len ref rows Extra
Warnings:
Note 1003 select * from t0 where length('гы') = a
set names default;
+connection con1;
a
2
set debug_dbug=@old_debug;
@@ -1152,6 +1275,7 @@ SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2
WHERE b <= ANY (
SELECT a FROM t1
WHERE a = b + SLEEP(0.2) OR a >= ( SELECT SUM(b) FROM t2 ));
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL a 4 NULL 2 Using index
@@ -1163,6 +1287,7 @@ Note 1003 SELECT SUM(b) FROM ( SELECT * FROM t1 ) AS alias1, t2
WHERE b <= ANY (
SELECT a FROM t1
WHERE a = b + SLEEP(0.2) OR a >= ( SELECT SUM(b) FROM t2 ))
+connection con1;
SUM(b)
0
set debug_dbug=@old_debug;
@@ -1181,8 +1306,12 @@ set debug_dbug='+d,show_explain_probe_best_ext_lim_search';
explain
select * from t0
where not exists ( select 1 from t1, t2 where t1.b=t2.b and t2.a=t0.a) and a is null;
+connection default;
kill query $thr2;
+connection con1;
ERROR 70100: Query execution was interrupted
drop table t0,t1,t2;
# End
+connection default;
+disconnect con1;
set debug_sync='RESET';
diff --git a/mysql-test/r/show_explain_non_select.result b/mysql-test/r/show_explain_non_select.result
index 0bd1e959405..6076a848e22 100644
--- a/mysql-test/r/show_explain_non_select.result
+++ b/mysql-test/r/show_explain_non_select.result
@@ -1,6 +1,9 @@
drop table if exists t0, t1;
SET @old_debug= @@session.debug;
set debug_sync='RESET';
+connect con2, localhost, root,,;
+connection con2;
+connection default;
create table t0 (a int) engine=myisam;
insert into t0 values (1),(2),(3),(4),(5),(6),(7),(8);
create table t1 (a int, b int, filler char(100), key(a), key(b));
@@ -10,35 +13,43 @@ from t0 A, t0 B, t0 C;
#
# Test SHOW EXPLAIN for single-table DELETE
#
+connection con2;
set debug_dbug='+d,show_explain_probe_delete_exec_start';
delete from t1 where a<10 and b+1>1000;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 1 Using where
Warnings:
Note 1003 delete from t1 where a<10 and b+1>1000
+connection con2;
#
# Test SHOW EXPLAIN for multi-table DELETE
#
set @show_explain_probe_select_id=1;
set debug_dbug='+d,show_explain_probe_do_select';
delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 8 Using where
1 SIMPLE t1 ref a a 5 test.t0.a 4 Using where
Warnings:
Note 1003 delete t1 from t1, t0 where t0.a=t1.a and t1.b +1 > 1000
+connection con2;
#
# Test SHOW EXPLAIN for single-table UPDATE
#
+connection con2;
set debug_dbug='+d,show_explain_probe_update_exec_start';
update t1 set filler='filler-data-2' where a<10 and b+1>1000;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range a a 5 NULL 1 Using where
Warnings:
Note 1003 update t1 set filler='filler-data-2' where a<10 and b+1>1000
+connection con2;
drop table t0,t1;
set debug_dbug=@old_debug;
set debug_sync='RESET';
diff --git a/mysql-test/r/show_explain_ps.result b/mysql-test/r/show_explain_ps.result
index f9b82c85f01..f5c487e9e44 100644
--- a/mysql-test/r/show_explain_ps.result
+++ b/mysql-test/r/show_explain_ps.result
@@ -10,14 +10,20 @@ NAME OBJECT_INSTANCE_BEGIN
# Check out if our cond is hit.
create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+connect con1, localhost, root,,;
+connection con1;
+connection default;
+connection con1;
set @show_explain_probe_select_id=1;
set debug_dbug='d,show_explain_probe_join_exec_start';
select count(*) from t0 where a < 100000;
+connection default;
show explain for $thr2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL NULL NULL NULL NULL 10 Using where
Warnings:
Note 1003 select count(*) from t0 where a < 100000
+connection con1;
count(*)
10
set debug_dbug='';
diff --git a/mysql-test/r/shutdown.result b/mysql-test/r/shutdown.result
index 748d8ec16a6..ff2e450c3f0 100644
--- a/mysql-test/r/shutdown.result
+++ b/mysql-test/r/shutdown.result
@@ -1,9 +1,14 @@
create user user1@localhost;
+connect c1,localhost,user1,,;
shutdown;
ERROR 42000: Access denied; you need (at least one of) the SHUTDOWN privilege(s) for this operation
+connection default;
+disconnect c1;
+connect c1,localhost,root,,;
create procedure try_shutdown() shutdown;
drop procedure try_shutdown;
shutdown;
+connection default;
drop user user1@localhost;
#
# MDEV-8491 - On shutdown, report the user and the host executed that.
diff --git a/mysql-test/r/skip_name_resolve.result b/mysql-test/r/skip_name_resolve.result
index b2230ccbd91..1362e482717 100644
--- a/mysql-test/r/skip_name_resolve.result
+++ b/mysql-test/r/skip_name_resolve.result
@@ -6,10 +6,13 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
GRANT ALL PRIVILEGES ON `test`.* TO 'mysqltest_1'@'127.0.0.1/255.255.255.255'
REVOKE ALL ON test.* FROM mysqltest_1@'127.0.0.1/255.255.255.255';
DROP USER mysqltest_1@'127.0.0.1/255.255.255.255';
+connect con1, localhost, root, , test, $MASTER_MYPORT, ;
SELECT USER();
USER()
#
SHOW PROCESSLIST;
+connection default;
+disconnect con1;
#
# Bug #37168: Missing variable - skip_name_resolve
#
diff --git a/mysql-test/r/sp-innodb.result b/mysql-test/r/sp-innodb.result
index b3405705698..2c3bc7dc4f3 100644
--- a/mysql-test/r/sp-innodb.result
+++ b/mysql-test/r/sp-innodb.result
@@ -71,6 +71,7 @@ END//
# Open another connection, create and initialize a table
# to be used for provoking deadlock, put a lock on the table:
+connect con1,localhost,root,,;
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SET AUTOCOMMIT= 0;
@@ -79,6 +80,7 @@ UPDATE t1 SET i=1 WHERE i=1;
# On the default connection, do an update to provoke a
# deadlock, then call the function with handler. This case
# fails without the patch (with error ER_NO_SUCH_TABLE):
+connection default;
SET AUTOCOMMIT= 0;
UPDATE t1 SET i=1 WHERE i=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -118,6 +120,7 @@ f1():
No such table
# Disconnect, drop functions and table:
+disconnect con1;
DROP FUNCTION f4;
DROP FUNCTION f3;
DROP FUNCTION f2;
diff --git a/mysql-test/r/sp-lock.result b/mysql-test/r/sp-lock.result
index 49ff0c7ba58..edc5bd641d3 100644
--- a/mysql-test/r/sp-lock.result
+++ b/mysql-test/r/sp-lock.result
@@ -129,11 +129,13 @@ drop temporary table t1;
# connection, try to use the routine.
# That should block on the pending exclusive lock.
#
-# Establish helper connections.
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connect con3, localhost, root,,;
#
# Test DROP PROCEDURE.
#
-# --> connection default
+connection default;
create procedure p1() begin end;
create function f1() returns int
begin
@@ -144,24 +146,24 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'drop procedure p1'...
drop procedure p1;
-# --> connection con2
+connection con2;
# Waiting for 'drop procedure t1' to get blocked on MDL lock...
# Demonstrate that there is a pending exclusive lock.
# Sending 'select f1()'...
select f1();
-# --> connection con3
+connection con3;
# Waiting for 'select f1()' to get blocked by a pending MDL lock...
-# --> connection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'drop procedure p1'...
-# --> connection con2
+connection con2;
# Reaping 'select f1()'
ERROR 42000: PROCEDURE test.p1 does not exist
-# --> connection default
+connection default;
#
# Test CREATE PROCEDURE.
#
@@ -170,25 +172,26 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'create procedure p1'...
create procedure p1() begin end;
-# --> connection con2
+connection con2;
# Waiting for 'create procedure t1' to get blocked on MDL lock...
# Demonstrate that there is a pending exclusive lock.
# Sending 'select f1()'...
select f1();
-# --> connection con3
+connection con3;
# Waiting for 'select f1()' to get blocked by a pending MDL lock...
-# --> connection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'create procedure p1'...
ERROR 42000: PROCEDURE p1 already exists
-# --> connection con2
+connection con2;
# Reaping 'select f1()'
f1()
1
+connection default;
#
# Test ALTER PROCEDURE.
#
@@ -196,25 +199,25 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'alter procedure p1'...
alter procedure p1 contains sql;
-# --> connection con2
+connection con2;
# Waiting for 'alter procedure t1' to get blocked on MDL lock...
# Demonstrate that there is a pending exclusive lock.
# Sending 'select f1()'...
select f1();
-# --> connection con3
+connection con3;
# Waiting for 'select f1()' to get blocked by a pending MDL lock...
-# --> connection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'alter procedure p1'...
-# --> connection con2
+connection con2;
# Reaping 'select f1()'
f1()
1
-# --> connection default
+connection default;
#
# Test DROP FUNCTION.
#
@@ -222,24 +225,24 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'drop function f1'...
drop function f1;
-# --> connection con2
+connection con2;
# Waiting for 'drop function f1' to get blocked on MDL lock...
# Demonstrate that there is a pending exclusive lock.
# Sending 'select f1()'...
select f1();
-# --> connection con3
+connection con3;
# Waiting for 'select f1()' to get blocked by a pending MDL lock...
-# --> connection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'drop function f1'...
-# --> connection con2
+connection con2;
# Reaping 'select f1()'
ERROR 42000: FUNCTION test.f1 does not exist
-# --> connection default
+connection default;
#
# Test CREATE FUNCTION.
#
@@ -248,26 +251,26 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'create function f1'...
create function f1() returns int return 2;
-# --> connection con2
+connection con2;
# Waiting for 'create function f1' to get blocked on MDL lock...
# Demonstrate that there is a pending exclusive lock.
# Sending 'select f1()'...
select f1();
-# --> connection con3
+connection con3;
# Waiting for 'select f1()' to get blocked by a pending MDL lock...
-# --> connection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'create function f1'...
ERROR 42000: FUNCTION f1 already exists
-# --> connection con2
+connection con2;
# Reaping 'select f1()'
f1()
1
-# --> connection default
+connection default;
#
# Test ALTER FUNCTION.
#
@@ -275,25 +278,25 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'alter function f1'...
alter function f1 contains sql;
-# --> connection con2
+connection con2;
# Waiting for 'alter function f1' to get blocked on MDL lock...
# Demonstrate that there is a pending exclusive lock.
# Sending 'select f1()'...
select f1();
-# --> connection con3
+connection con3;
# Waiting for 'select f1()' to get blocked by a pending MDL lock...
-# --> connection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'alter function f1'...
-# --> connection con2
+connection con2;
# Reaping 'select f1()'
f1()
1
-# --> connection default
+connection default;
drop function f1;
drop procedure p1;
#
@@ -330,12 +333,12 @@ call p4();
prepare stmt from "call p4()";
execute stmt;
execute stmt;
-# --> connection con1
+connection con1;
drop procedure p1;
drop procedure p2;
drop procedure p3;
drop procedure p4;
-# --> connection default
+connection default;
# This is to verify there was no implicit commit.
rollback to savepoint sv;
call p4();
@@ -356,16 +359,16 @@ create trigger t1_ai after insert on t1 for each row
insert into t2 (a, b) values (new.a, f1());
begin;
insert into t1 (a) values (1);
-# --> connection con1
+connection con1;
# Sending 'drop function f1'
drop function f1;
-# --> connection con2
+connection con2;
# Waiting for 'drop function f1' to get blocked on MDL lock...
-# --> connnection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'drop function f1'...
-# --> connection default
+connection default;
#
# A function is used from a view.
#
@@ -375,16 +378,16 @@ begin;
select * from v1;
a
1
-# --> connection con1
+connection con1;
# Sending 'drop function f1'
drop function f1;
-# --> connection con2
+connection con2;
# Waiting for 'drop function f1' to get blocked on MDL lock...
-# --> connnection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'drop function f1'...
-# --> connection default
+connection default;
#
# A procedure is used from a function.
#
@@ -399,16 +402,16 @@ begin;
select * from v1;
a
3
-# --> connection con1
+connection con1;
# Sending 'drop procedure p1'
drop procedure p1;
-# --> connection con2
+connection con2;
# Waiting for 'drop procedure p1' to get blocked on MDL lock...
-# --> connnection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'drop procedure p1'...
-# --> connection default
+connection default;
#
# Deep nesting: a function is used from a procedure used
# from a function used from a view used in a trigger.
@@ -420,16 +423,16 @@ create trigger t1_ai after insert on t1 for each row
insert into t2 (a, b) values (new.a, (select max(a) from v1));
begin;
insert into t1 (a) values (3);
-# --> connection con1
+connection con1;
# Sending 'drop function f2'
drop function f2;
-# --> connection con2
+connection con2;
# Waiting for 'drop function f2' to get blocked on MDL lock...
-# --> connnection default
+connection default;
commit;
-# --> connection con1
+connection con1;
# Reaping 'drop function f2'...
-# --> connection default
+connection default;
drop view v1;
drop function f1;
drop procedure p1;
@@ -475,23 +478,23 @@ savepoint sv;
select f2();
f2()
f2()
-# --> connection con1
+connection con1;
# Sending 'drop function f1'...
drop function f1;
-# --> connection con2
+connection con2;
# Waiting for 'drop function f1' to get blocked on MDL lock...
# Sending 'drop function f2'...
drop function f2;
-# --> connection default
+connection default;
# Waiting for 'drop function f2' to get blocked on MDL lock...
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop function f2'...
-# --> connection default
+connection default;
unlock tables;
-# --> connection con1
+connection con1;
# Reaping 'drop function f1'...
-# --> connection default
+connection default;
drop function f1;
ERROR 42000: FUNCTION test.f1 does not exist
drop function f2;
@@ -526,31 +529,32 @@ begin
select f1() into @var;
execute stmt;
end|
-# --> connection con2
+connection con2;
prepare stmt from "select f2()";
-# --> connection default
+connection default;
begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'alter function f1 ...'...
alter function f1 comment "comment";
-# --> connection con2
+connection con2;
# Waiting for 'alter function f1 ...' to get blocked on MDL lock...
# Sending 'call p1()'...
call p1();
+connection default;
# Waiting for 'call p1()' to get blocked on MDL lock on f1...
# Let 'alter function f1 ...' go through...
commit;
-# --> connection con1
+connection con1;
# Reaping 'alter function f1 ...'
-# --> connection con2
+connection con2;
# Reaping 'call p1()'...
f2()
1
deallocate prepare stmt;
-# --> connection default
+connection default;
drop function f1;
drop function f2;
drop procedure p1;
@@ -569,10 +573,10 @@ begin;
select f1();
f1()
1
-# --> connection con1
+connection con1;
# Sending 'alter function f1 ...'...
alter function f1 comment "comment";
-# --> connection con2
+connection con2;
# Waiting for 'alter function f1 ...' to get blocked on MDL lock...
#
# We just mention p1() in the body of f2() to make
@@ -595,14 +599,15 @@ select f2() into @var;
end|
# Sending 'call p1()'...
call p1();
+connection default;
# Waiting for 'call p1()' to get blocked on MDL lock on f1...
# Let 'alter function f1 ...' go through...
commit;
-# --> connection con1
+connection con1;
# Reaping 'alter function f1 ...'
-# --> connection con2
+connection con2;
# Reaping 'call p1()'...
-# --> connection default
+connection default;
drop function f1;
drop function f2;
drop procedure p1;
@@ -626,14 +631,14 @@ close c;
select f2() into @var;
return res;
end|
-# --> connection con1
+connection con1;
select get_lock("30977", 0);
get_lock("30977", 0)
1
-# --> connection default
+connection default;
# Sending 'select f3()'...
select f3();
-# --> connection con1
+connection con1;
# Waiting for 'select f3()' to get blocked on the user level lock...
# Do something to change the cache version.
create function f4() returns int return 4;
@@ -641,7 +646,7 @@ drop function f4;
select release_lock("30977");
release_lock("30977")
1
-# --> connection default
+connection default;
# Reaping 'select f3()'...
# Routine 'f2()' should exist and get executed successfully.
f3()
@@ -688,10 +693,13 @@ select @exec_count;
drop procedure p1;
drop function f1;
set @@session.max_sp_recursion_depth=default;
-# --> connection con1
-# --> connection con2
-# --> connection con3
-# --> connection default
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
#
# SHOW CREATE PROCEDURE p1 called from p1, after p1 was altered
#
@@ -703,24 +711,26 @@ BEGIN
SELECT get_lock("test", 10);
SHOW CREATE PROCEDURE p1;
END|
-# Connection default
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection default;
SELECT get_lock("test", 10);
get_lock("test", 10)
1
-# Connection 2
+connection con2;
# Will halt before executing SHOW CREATE PROCEDURE p1
# Sending:
CALL p1();
-# Connection 3
+connection con3;
# Alter p1
DROP PROCEDURE p1;
CREATE PROCEDURE p1() BEGIN END;
-# Connection default
+connection default;
# Resume CALL p1, now with new p1
SELECT release_lock("test");
release_lock("test")
1
-# Connection 2
+connection con2;
# Reaping: CALL p1()
get_lock("test", 10)
1
@@ -730,9 +740,11 @@ BEGIN
SELECT get_lock("test", 10);
SHOW CREATE PROCEDURE p1;
END latin1 latin1_swedish_ci latin1_swedish_ci
-# Connection 3
-# Connection 2
-# Connection default;
+connection con3;
+disconnect con3;
+connection con2;
+disconnect con2;
+connection default;
DROP PROCEDURE p1;
#
# Bug#57663 Concurrent statement using stored function and DROP DATABASE
@@ -740,26 +752,28 @@ DROP PROCEDURE p1;
#
DROP DATABASE IF EXISTS db1;
DROP FUNCTION IF EXISTS f1;
+connect con1, localhost, root;
+connect con2, localhost, root;
# Test 1: Check that DROP DATABASE block if a function is used
# by an active transaction.
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
START TRANSACTION;
SELECT db1.f1();
db1.f1()
1
-# Connection con1
+connection con1;
# Sending:
DROP DATABASE db1;
-# Connection default
+connection default;
# Waiting for DROP DATABASE to be blocked by the lock on f1()
COMMIT;
-# Connection con1
+connection con1;
# Reaping: DROP DATABASE db1
# Test 2: Check that DROP DATABASE blocks if a procedure is
# used by an active transaction.
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE PROCEDURE db1.p1() BEGIN END;
CREATE FUNCTION f1() RETURNS INTEGER
@@ -771,17 +785,17 @@ START TRANSACTION;
SELECT f1();
f1()
1
-# Connection con1
+connection con1;
# Sending:
DROP DATABASE db1;
-# Connection default
+connection default;
# Waiting for DROP DATABASE to be blocked by the lock on p1()
COMMIT;
-# Connection con1
+connection con1;
# Reaping: DROP DATABASE db1
# Test 3: Check that DROP DATABASE is not selected as a victim if a
# deadlock is discovered with DML statements.
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
@@ -789,18 +803,18 @@ START TRANSACTION;
SELECT db1.f1();
db1.f1()
1
-# Connection con1
+connection con1;
# Sending:
DROP DATABASE db1;
-# Connection default
+connection default;
# Waiting for DROP DATABASE to be blocked by the lock on f1()
SELECT * FROM db1.t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
COMMIT;
-# Connection con1
+connection con1;
# Reaping: DROP DATABASE db1
# Test 4: Check that active DROP DATABASE blocks stored routine DDL.
-# Connection default
+connection default;
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
CREATE FUNCTION db1.f2() RETURNS INTEGER RETURN 2;
@@ -808,22 +822,24 @@ START TRANSACTION;
SELECT db1.f2();
db1.f2()
2
-# Connection con1
+connection con1;
# Sending:
DROP DATABASE db1;
-# Connection con2
+connection con2;
# Waiting for DROP DATABASE to be blocked by the lock on f2()
# Sending:
ALTER FUNCTION db1.f1 COMMENT "test";
-# Connection default
+connection default;
# Waiting for ALTER FUNCTION to be blocked by the schema lock on db1
COMMIT;
-# Connection con1
+connection con1;
# Reaping: DROP DATABASE db1
-# Connection con2
+disconnect con1;
+connection con2;
# Reaping: ALTER FUNCTION f1 COMMENT 'test'
ERROR 42000: FUNCTION db1.f1 does not exist
-# Connection default
+disconnect con2;
+connection default;
DROP FUNCTION f1;
#
# End of 5.5 tests
diff --git a/mysql-test/r/sp-security.result b/mysql-test/r/sp-security.result
index 276da41a0fe..22172bf18fc 100644
--- a/mysql-test/r/sp-security.result
+++ b/mysql-test/r/sp-security.result
@@ -1,3 +1,5 @@
+connect con1root,localhost,root,,;
+connection con1root;
use test;
create user user1@localhost;
grant usage on *.* to user1@localhost;
@@ -39,6 +41,9 @@ set sql_mode='';
grant execute on procedure db1_secret.stamp to ''@'%';
grant execute on function db1_secret.db to ''@'%';
set sql_mode=default;
+connect con2user1,localhost,user1,,;
+connect con3anon,localhost,anon,,;
+connection con2user1;
call db1_secret.stamp(2);
select db1_secret.db();
db1_secret.db()
@@ -53,6 +58,7 @@ drop procedure db1_secret.stamp;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.stamp'
drop function db1_secret.db;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db1_secret.db'
+connection con3anon;
call db1_secret.stamp(3);
select db1_secret.db();
db1_secret.db()
@@ -67,6 +73,7 @@ drop procedure db1_secret.stamp;
ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.stamp'
drop function db1_secret.db;
ERROR 42000: alter routine command denied to user ''@'%' for routine 'db1_secret.db'
+connection con1root;
select * from t1;
u i
test 0
@@ -92,14 +99,17 @@ root@localhost 4
select db();
db()
test
+connection con2user1;
call db1_secret.stamp(5);
ERROR 42000: INSERT command denied to user 'user1'@'localhost' for table 't1'
select db1_secret.db();
ERROR 42000: SELECT command denied to user 'user1'@'localhost' for table 't1'
+connection con3anon;
call db1_secret.stamp(6);
ERROR 42000: INSERT command denied to user ''@'localhost' for table 't1'
select db1_secret.db();
ERROR 42000: SELECT command denied to user ''@'localhost' for table 't1'
+connection con1root;
drop database if exists db2;
create database db2;
use db2;
@@ -112,10 +122,13 @@ grant usage on db2.* to user2@localhost;
grant select,insert,update,delete,create routine on db2.* to user2@localhost;
grant create routine on db2.* to user1@localhost;
flush privileges;
+connection con2user1;
use db2;
create procedure p () insert into t2 values (1);
call p();
ERROR 42000: INSERT command denied to user 'user1'@'localhost' for table 't2'
+connect con4user2,localhost,user2,,;
+connection con4user2;
use db2;
call p();
ERROR 42000: execute command denied to user 'user2'@'localhost' for routine 'db2.p'
@@ -128,8 +141,11 @@ select * from t2;
s1
0
2
+connection con1root;
grant usage on procedure db2.q to user2@localhost with grant option;
+connection con4user2;
grant execute on procedure db2.q to user1@localhost;
+connection con2user1;
use db2;
call q();
select * from t2;
@@ -143,9 +159,13 @@ alter procedure q modifies sql data;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db2.q'
drop procedure q;
ERROR 42000: alter routine command denied to user 'user1'@'localhost' for routine 'db2.q'
+connection con1root;
use db2;
alter procedure q modifies sql data;
drop procedure q;
+disconnect con2user1;
+disconnect con3anon;
+disconnect con4user2;
use test;
select type,db,name from mysql.proc where db like 'db%';
type db name
@@ -182,26 +202,34 @@ show grants for userc@localhost;
Grants for userc@localhost
GRANT USAGE ON *.* TO 'userc'@'localhost'
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'userc'@'localhost' WITH GRANT OPTION
+connect con2usera,localhost,usera,,;
+connect con3userb,localhost,userb,,;
+connect con4userc,localhost,userc,,;
+connection con2usera;
call sptest.p1(1);
grant execute on procedure sptest.p1 to userb@localhost;
ERROR 42000: grant command denied to user 'usera'@'localhost' for routine 'sptest.p1'
drop procedure sptest.p1;
ERROR 42000: alter routine command denied to user 'usera'@'localhost' for routine 'sptest.p1'
+connection con3userb;
call sptest.p1(2);
ERROR 42000: execute command denied to user 'userb'@'localhost' for routine 'sptest.p1'
grant execute on procedure sptest.p1 to userb@localhost;
ERROR 42000: execute command denied to user 'userb'@'localhost' for routine 'sptest.p1'
drop procedure sptest.p1;
ERROR 42000: alter routine command denied to user 'userb'@'localhost' for routine 'sptest.p1'
+connection con4userc;
call sptest.p1(3);
grant execute on procedure sptest.p1 to userb@localhost;
drop procedure sptest.p1;
ERROR 42000: alter routine command denied to user 'userc'@'localhost' for routine 'sptest.p1'
+connection con3userb;
call sptest.p1(4);
grant execute on procedure sptest.p1 to userb@localhost;
ERROR 42000: grant command denied to user 'userb'@'localhost' for routine 'sptest.p1'
drop procedure sptest.p1;
ERROR 42000: alter routine command denied to user 'userb'@'localhost' for routine 'sptest.p1'
+connection con1root;
select * from t1;
u i
usera@localhost 1
@@ -216,10 +244,15 @@ show grants for userb@localhost;
Grants for userb@localhost
GRANT USAGE ON *.* TO 'userb'@'localhost'
GRANT EXECUTE ON PROCEDURE `sptest`.`p1` TO 'userb'@'localhost'
+connection con4userc;
revoke all privileges on procedure sptest.p1 from userb@localhost;
+connection con1root;
show grants for userb@localhost;
Grants for userb@localhost
GRANT USAGE ON *.* TO 'userb'@'localhost'
+disconnect con4userc;
+disconnect con3userb;
+disconnect con2usera;
use test;
drop database sptest;
delete from mysql.user where user='usera' or user='userb' or user='userc';
@@ -227,6 +260,8 @@ delete from mysql.procs_priv where user='usera' or user='userb' or user='userc';
delete from mysql.tables_priv where user='usera';
flush privileges;
drop table t1;
+connect root,localhost,root,,test;
+connection root;
drop function if exists bug_9503;
drop user if exists user1@localhost;
create database mysqltest//
@@ -236,16 +271,25 @@ create user user1@localhost//
grant select on t1 to user1@localhost//
create function bug_9503 () returns int sql security invoker begin declare v int;
select min(s1) into v from t1; return v; end//
+connect user1,localhost,user1,,test;
+connection user1;
use mysqltest;
select bug_9503();
ERROR 42000: execute command denied to user 'user1'@'localhost' for routine 'mysqltest.bug_9503'
+connection root;
grant execute on function bug_9503 to user1@localhost;
+connection user1;
do 1;
use test;
+disconnect user1;
+connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
drop function bug_9503;
use test;
drop database mysqltest;
+connection default;
+disconnect root;
+connection con1root;
use test;
select current_user();
current_user()
@@ -259,15 +303,19 @@ create procedure bug7291_2 () sql security invoker call bug7291_0();
grant execute on procedure bug7291_0 to user1@localhost;
grant execute on procedure bug7291_1 to user1@localhost;
grant execute on procedure bug7291_2 to user1@localhost;
+connect user1,localhost,user1,,;
+connection user1;
call bug7291_2();
current_user() user()
user1@localhost user1@localhost
call bug7291_1();
current_user() user()
root@localhost user1@localhost
+connection con1root;
drop procedure bug7291_1;
drop procedure bug7291_2;
drop procedure bug7291_0;
+disconnect user1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM user1@localhost;
drop user user1@localhost;
drop database if exists mysqltest_1;
@@ -278,10 +326,17 @@ select 1 from dual;
end//
create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
+connect n1,localhost,mysqltest_1,,information_schema,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection n1;
call mysqltest_1.p1();
ERROR 42000: execute command denied to user 'mysqltest_1'@'localhost' for routine 'mysqltest_1.p1'
+disconnect n1;
+connect n2,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection n2;
call mysqltest_1.p1();
ERROR 42000: execute command denied to user 'mysqltest_1'@'localhost' for routine 'mysqltest_1.p1'
+disconnect n2;
+connection default;
drop procedure mysqltest_1.p1;
drop database mysqltest_1;
revoke usage on *.* from mysqltest_1@localhost;
@@ -292,10 +347,13 @@ begin
return 'ok';
end;
create user user_bug12812@localhost IDENTIFIED BY 'ABC'|
+connect test_user_12812,localhost,user_bug12812,ABC,test;
SELECT test.bug12812()|
ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
CREATE VIEW v1 AS SELECT test.bug12812()|
ERROR 42000: execute command denied to user 'user_bug12812'@'localhost' for routine 'test.bug12812'
+connection default;
+disconnect test_user_12812;
DROP USER user_bug12812@localhost|
drop function bug12812|
create database db_bug14834;
@@ -305,16 +363,23 @@ create user user2_bug14834@localhost identified by '';
grant all on `db\_bug14834`.* to user2_bug14834@localhost;
create user user3_bug14834@localhost identified by '';
grant all on `db__ug14834`.* to user3_bug14834@localhost;
+connect user1_bug14834,localhost,user1_bug14834,,db_bug14834;
create procedure p_bug14834() select user(), current_user();
call p_bug14834();
user() current_user()
user1_bug14834@localhost user1_bug14834@localhost
+connect user2_bug14834,localhost,user2_bug14834,,db_bug14834;
call p_bug14834();
user() current_user()
user2_bug14834@localhost user1_bug14834@localhost
+connect user3_bug14834,localhost,user3_bug14834,,db_bug14834;
call p_bug14834();
user() current_user()
user3_bug14834@localhost user1_bug14834@localhost
+connection default;
+disconnect user1_bug14834;
+disconnect user2_bug14834;
+disconnect user3_bug14834;
drop user user1_bug14834@localhost;
drop user user2_bug14834@localhost;
drop user user3_bug14834@localhost;
@@ -331,6 +396,7 @@ sql security definer
select * from db_bug14533.t1;
grant execute on procedure db_bug14533.bug14533_1 to user_bug14533@localhost;
grant execute on procedure db_bug14533.bug14533_2 to user_bug14533@localhost;
+connect user_bug14533,localhost,user_bug14533,,test;
call db_bug14533.bug14533_1();
Field Type Null Key Default Extra
id int(11) YES NULL
@@ -340,10 +406,11 @@ desc db_bug14533.t1;
ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
select * from db_bug14533.t1;
ERROR 42000: SELECT command denied to user 'user_bug14533'@'localhost' for table 't1'
+connection default;
+disconnect user_bug14533;
drop user user_bug14533@localhost;
drop database db_bug14533;
-
----> connection: root
+connection con1root;
DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE mysqltest;
CREATE USER mysqltest_1@localhost;
@@ -351,20 +418,19 @@ GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_1@localhost;
CREATE USER mysqltest_2@localhost;
GRANT SUPER ON *.* TO mysqltest_2@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
-
----> connection: mysqltest_2_con
+connect mysqltest_2_con,localhost,mysqltest_2,,mysqltest;
+connect mysqltest_1_con,localhost,mysqltest_1,,mysqltest;
+connection mysqltest_2_con;
USE mysqltest;
CREATE PROCEDURE wl2897_p1() SELECT 1;
CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
-
----> connection: mysqltest_1_con
+connection mysqltest_1_con;
USE mysqltest;
CREATE DEFINER=root@localhost PROCEDURE wl2897_p2() SELECT 2;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
-
----> connection: mysqltest_2_con
+connection mysqltest_2_con;
use mysqltest;
CREATE DEFINER='a @ b @ c'@localhost PROCEDURE wl2897_p3() SELECT 3;
Warnings:
@@ -372,8 +438,7 @@ Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exi
CREATE DEFINER='a @ b @ c'@localhost FUNCTION wl2897_f3() RETURNS INT RETURN 3;
Warnings:
Note 1449 The user specified as a definer ('a @ b @ c'@'localhost') does not exist
-
----> connection: con1root
+connection con1root;
USE mysqltest;
SHOW CREATE PROCEDURE wl2897_p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
@@ -394,16 +459,18 @@ RETURN 3 latin1 latin1_swedish_ci latin1_swedish_ci
DROP USER mysqltest_1@localhost;
DROP USER mysqltest_2@localhost;
DROP DATABASE mysqltest;
-
----> connection: root
+disconnect mysqltest_1_con;
+disconnect mysqltest_2_con;
+connection con1root;
DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE mysqltest;
CREATE USER mysqltest_1@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_1@localhost;
CREATE USER mysqltest_2@localhost;
GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
-
----> connection: mysqltest_1_con
+connect mysqltest_1_con,localhost,mysqltest_1,,mysqltest;
+connect mysqltest_2_con,localhost,mysqltest_2,,mysqltest;
+connection mysqltest_1_con;
USE mysqltest;
CREATE PROCEDURE bug13198_p1()
SELECT 1;
@@ -415,8 +482,7 @@ CALL bug13198_p1();
SELECT bug13198_f1();
bug13198_f1()
1
-
----> connection: mysqltest_2_con
+connection mysqltest_2_con;
USE mysqltest;
CALL bug13198_p1();
1
@@ -424,18 +490,17 @@ CALL bug13198_p1();
SELECT bug13198_f1();
bug13198_f1()
1
-
----> connection: root
+connection con1root;
+disconnect mysqltest_1_con;
DROP USER mysqltest_1@localhost;
-
----> connection: mysqltest_2_con
+connection mysqltest_2_con;
USE mysqltest;
CALL bug13198_p1();
ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist
SELECT bug13198_f1();
ERROR HY000: The user specified as a definer ('mysqltest_1'@'localhost') does not exist
-
----> connection: root
+connection con1root;
+disconnect mysqltest_2_con;
DROP USER mysqltest_2@localhost;
DROP DATABASE mysqltest;
GRANT USAGE ON *.* TO user19857@localhost IDENTIFIED BY 'meow';
@@ -444,8 +509,8 @@ user19857@localhost;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857';
Host User Password
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C
-
----> connection: mysqltest_2_con
+connect mysqltest_2_con,localhost,user19857,meow,test;
+connection mysqltest_2_con;
USE test;
CREATE PROCEDURE sp19857() DETERMINISTIC
BEGIN
@@ -462,13 +527,18 @@ DECLARE a INT;
SET a=1;
SELECT a;
END latin1 latin1_swedish_ci latin1_swedish_ci
+disconnect mysqltest_2_con;
+connect mysqltest_2_con,localhost,user19857,meow,test;
+connection mysqltest_2_con;
DROP PROCEDURE IF EXISTS test.sp19857;
-
----> connection: root
+connection con1root;
+disconnect mysqltest_2_con;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857';
Host User Password
localhost user19857 *82DC221D557298F6CE9961037DB1C90604792F5C
DROP USER user19857@localhost;
+disconnect con1root;
+connection default;
use test;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
@@ -493,6 +563,7 @@ SET @b:= (SELECT COUNT(*) FROM t1);
RETURN @b;
END|
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT f_evil();
+connect conn1, localhost, mysqltest_u1,,;
SELECT COUNT(*) FROM t1;
ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table 't1'
SELECT f_evil();
@@ -515,6 +586,8 @@ ERROR 42000: SELECT command denied to user 'mysqltest_u1'@'localhost' for table
SELECT @a, @b;
@a @b
mysqltest_u1@localhost NULL
+disconnect conn1;
+connection default;
DROP VIEW v1;
DROP FUNCTION f_evil;
DROP USER mysqltest_u1@localhost;
@@ -543,6 +616,9 @@ SELECT * FROM TestTab;
id
1
2
+CONNECT con_tester,localhost,tester,,B48872;
+CONNECT con_tester_denied,localhost,Tester,,B48872;
+connection con_tester;
SELECT * FROM TestTab;
id
1
@@ -559,6 +635,7 @@ f_Test()
SELECT F_TEST();
F_TEST()
123
+connection con_tester_denied;
SELECT * FROM TestTab;
SELECT `f_Test`();
SELECT `F_TEST`();
@@ -570,6 +647,9 @@ SELECT `f_Test_denied`();
SELECT `F_TEST_DENIED`();
`F_TEST_DENIED`()
123
+connection default;
+disconnect con_tester;
+disconnect con_tester_denied;
DROP TABLE `TestTab`;
DROP FUNCTION `f_Test`;
DROP FUNCTION `f_Test_denied`;
@@ -588,7 +668,7 @@ create database mysqltest_db;
create user bug57061_user@localhost;
create function mysqltest_db.f1() returns int return 0;
create procedure mysqltest_db.p1() begin end;
-# Connect as user 'bug57061_user@localhost'
+connect conn1, localhost, bug57061_user,,;
# Attempt to drop routine on which user doesn't have privileges
# should result in the same 'access denied' type of error whether
# routine exists or not.
@@ -600,7 +680,8 @@ drop function if exists mysqltest_db.f1;
ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.f1'
drop procedure if exists mysqltest_db.p1;
ERROR 42000: alter routine command denied to user 'bug57061_user'@'localhost' for routine 'mysqltest_db.p1'
-# Connection 'default'.
+connection default;
+disconnect conn1;
drop user bug57061_user@localhost;
drop database mysqltest_db;
#
@@ -612,20 +693,21 @@ CREATE DATABASE db1;
CREATE PROCEDURE db1.p1() SELECT 1;
CREATE USER user2@localhost IDENTIFIED BY '';
GRANT SELECT(db) ON mysql.proc TO user2@localhost;
-# Connection con2 as user2
+connect con2, localhost, user2;
# The statement below before disclosed info from body_utf8 column.
SHOW CREATE PROCEDURE db1.p1;
ERROR 42000: PROCEDURE p1 does not exist
# Check that SHOW works with SELECT grant on whole table
-# Connection default
+connection default;
GRANT SELECT ON mysql.proc TO user2@localhost;
-# Connection con2
+connection con2;
# This should work
SHOW CREATE PROCEDURE db1.p1;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
p1 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` PROCEDURE `p1`()
SELECT 1 latin1 latin1_swedish_ci latin1_swedish_ci
-# Connection default
+connection default;
+disconnect con2;
DROP USER user2@localhost;
DROP DATABASE db1;
#
@@ -639,7 +721,7 @@ create function mysqltest_db.f1() returns int return 0;
create procedure mysqltest_db.p1() begin end;
# Create user with no privileges on mysqltest_db database.
create user bug12602983_user@localhost;
-# Connect as user 'bug12602983_user@localhost'
+connect conn1, localhost, bug12602983_user,,;
# Attempt to execute routine on which user doesn't have privileges
# should result in the same 'access denied' error whether
# routine exists or not.
@@ -655,7 +737,8 @@ create view bug12602983_v1 as select mysqltest_db.f_does_not_exist();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.f_does_not_exist'
create view bug12602983_v1 as select mysqltest_db.f1();
ERROR 42000: execute command denied to user 'bug12602983_user'@'localhost' for routine 'mysqltest_db.f1'
-# Connection 'default'.
+connection default;
+disconnect conn1;
drop user bug12602983_user@localhost;
drop database mysqltest_db;
set password=password('foobar');
diff --git a/mysql-test/r/sp-threads.result b/mysql-test/r/sp-threads.result
index 4ce61c44762..eb1c0beff65 100644
--- a/mysql-test/r/sp-threads.result
+++ b/mysql-test/r/sp-threads.result
@@ -1,3 +1,7 @@
+connect con1root,localhost,root,,;
+connect con2root,localhost,root,,;
+connect con3root,localhost,root,,;
+connection con1root;
use test;
drop table if exists t1;
create table t1 (s1 int, s2 int, s3 int);
@@ -5,22 +9,26 @@ create procedure bug4934()
begin
insert into t1 values (1,0,1);
end//
+connection con2root;
use test;
call bug4934();
select * from t1;
s1 s2 s3
1 0 1
+connection con1root;
drop table t1;
create table t1 (s1 int, s2 int, s3 int);
drop procedure bug4934;
create procedure bug4934()
begin
end//
+connection con2root;
select * from t1;
s1 s2 s3
call bug4934();
select * from t1;
s1 s2 s3
+connection con1root;
drop table t1;
drop procedure bug4934;
drop procedure if exists bug9486;
@@ -30,8 +38,11 @@ create table t2 (id2 int);
create procedure bug9486()
update t1, t2 set val= 1 where id1=id2;
call bug9486();
+connection con2root;
lock tables t2 write;
+connection con1root;
call bug9486();
+connection con2root;
show processlist;
Id User Host db Command Time State Info Progress
# root localhost test Sleep # NULL 0.000
@@ -39,6 +50,7 @@ Id User Host db Command Time State Info Progress
# root localhost test Query # init show processlist 0.000
# root localhost test Sleep # NULL 0.000
unlock tables;
+connection con1root;
drop procedure bug9486;
drop table t1, t2;
drop procedure if exists bug11158;
@@ -51,9 +63,13 @@ call bug11158();
select * from t1;
id j
2 2
+connection con2root;
lock tables t2 read;
+connection con1root;
call bug11158();
+connection con2root;
unlock tables;
+connection con1root;
drop procedure bug11158;
drop table t1, t2;
drop function if exists bug11554;
@@ -61,12 +77,15 @@ drop view if exists v1;
create table t1 (i int);
create function bug11554 () returns int return 1;
create view v1 as select bug11554() as f;
+connection con2root;
insert into t1 (select f from v1);
+connection con1root;
drop function bug11554;
drop table t1;
drop view v1;
drop procedure if exists p1;
drop procedure if exists p2;
+connection con1root;
create table t1 (s1 int)|
create procedure p1() select * from t1|
create procedure p2()
@@ -75,13 +94,18 @@ insert into t1 values (1);
call p1();
select * from t1;
end|
+connection con2root;
use test;
lock table t1 write;
+connection con1root;
call p2();
+connection con3root;
use test;
drop procedure p1;
create procedure p1() select * from t1;
+connection con2root;
unlock tables;
+connection con1root;
s1
1
s1
@@ -89,3 +113,7 @@ s1
drop procedure p1;
drop procedure p2;
drop table t1;
+connection default;
+disconnect con1root;
+disconnect con2root;
+disconnect con3root;
diff --git a/mysql-test/r/sp.result b/mysql-test/r/sp.result
index 9453a1da3ca..de6b87d67cd 100644
--- a/mysql-test/r/sp.result
+++ b/mysql-test/r/sp.result
@@ -6417,6 +6417,8 @@ set x=-1;
return x;
end|
create view v1 as select 1 as one, f1() as days;
+connect bug29408, localhost, root,,*NO-ONE*;
+connection bug29408;
show create view test.v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `test`.`v1` AS select 1 AS `one`,`f1`() AS `days` latin1 latin1_swedish_ci
@@ -6425,6 +6427,8 @@ where table_name='v1' and table_schema='test';
column_name
one
days
+connection default;
+disconnect bug29408;
drop view v1;
drop function f1;
diff --git a/mysql-test/r/sp_notembedded.result b/mysql-test/r/sp_notembedded.result
index 40a06d312a0..73cc4f154c7 100644
--- a/mysql-test/r/sp_notembedded.result
+++ b/mysql-test/r/sp_notembedded.result
@@ -154,6 +154,7 @@ create user 'mysqltest_1'@'localhost';
grant all privileges on test.* to 'mysqltest_1'@'localhost';
create procedure 15298_1 () sql security definer show grants for current_user;
create procedure 15298_2 () sql security definer show grants;
+connect con1,localhost,mysqltest_1,,test;
call 15298_1();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
@@ -162,6 +163,8 @@ call 15298_2();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
+connection default;
+disconnect con1;
drop user mysqltest_1@localhost;
drop procedure 15298_1;
drop procedure 15298_2;
@@ -171,22 +174,39 @@ create table t1 (value varchar(15));
create procedure p1() update t1 set value='updated' where value='old';
call p1();
insert into t1 (value) values ("old"),("irrelevant");
+connect rl_holder, localhost, root,,;
+connect rl_acquirer, localhost, root,,;
+connect rl_contender, localhost, root,,;
+connect rl_wait, localhost, root,,;
+connection rl_holder;
select get_lock('b26162',120);
get_lock('b26162',120)
1
+connection rl_acquirer;
select 'rl_acquirer', value from t1 where get_lock('b26162',120);;
+connection rl_wait;
+connection default;
set session low_priority_updates=on;
call p1();;
+connection rl_wait;
+connection rl_contender;
select 'rl_contender', value from t1;
rl_contender value
rl_contender old
rl_contender irrelevant
+connection rl_holder;
select release_lock('b26162');
release_lock('b26162')
1
+connection rl_acquirer;
rl_acquirer value
rl_acquirer old
rl_acquirer irrelevant
+connection default;
+disconnect rl_holder;
+disconnect rl_acquirer;
+disconnect rl_wait;
+disconnect rl_contender;
drop procedure p1;
drop table t1;
set session low_priority_updates=default;
@@ -203,9 +223,13 @@ VALUES('%', 'mysqltest_1', password(''), 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'N', 'N',
Warnings:
Warning 1364 Field 'authentication_string' doesn't have a default value
FLUSH PRIVILEGES;
+connect con1, localhost, mysqltest_1,,;
+connection con1;
CREATE PROCEDURE p1(i INT) BEGIN END;
Warnings:
Warning 1404 Failed to grant EXECUTE and ALTER ROUTINE privileges
+disconnect con1;
+connection default;
DROP PROCEDURE p1;
DELETE FROM mysql.user WHERE User='mysqltest_1';
FLUSH PRIVILEGES;
@@ -215,7 +239,7 @@ FLUSH PRIVILEGES;
SELECT GET_LOCK('Bug44521', 0);
GET_LOCK('Bug44521', 0)
1
-** Connection con1
+connect con1,localhost,root,,;
CREATE PROCEDURE p()
BEGIN
SELECT 1;
@@ -223,7 +247,8 @@ SELECT GET_LOCK('Bug44521', 100);
SELECT 2;
END$
CALL p();;
-** Default connection
+connection default;
+disconnect con1;
SELECT RELEASE_LOCK('Bug44521');
RELEASE_LOCK('Bug44521')
1
@@ -232,13 +257,21 @@ CREATE TABLE t1(a int);
INSERT INTO t1 VALUES (1);
CREATE FUNCTION f1 (inp TEXT) RETURNS INT NO SQL RETURN sleep(60);
CREATE VIEW v1 AS SELECT f1('a') FROM t1;
+connect con1, localhost, root,,;
SELECT * FROM v1;;
+connect con2, localhost, root,,;
SELECT * FROM v1;
+connection default;
+connection con1;
ERROR 70100: Query execution was interrupted
+connection con2;
ERROR 70100: Query execution was interrupted
+connection default;
DROP VIEW v1;
DROP TABLE t1;
DROP FUNCTION f1;
+disconnect con1;
+disconnect con2;
# ------------------------------------------------------------------
# -- End of 5.1 tests
# ------------------------------------------------------------------
@@ -249,11 +282,13 @@ DROP FUNCTION f1;
# The real problem was that server was unable handle properly stored
# functions in databases which names contained dot.
#
+connection default;
DROP DATABASE IF EXISTS `my.db`;
create database `my.db`;
use `my.db`;
CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
-# Create new connection.
+connect addcon, localhost, root,,;
+connection addcon;
USE `my.db`;
SELECT f1(1);
f1(1)
@@ -261,7 +296,8 @@ f1(1)
SELECT `my.db`.f1(2);
`my.db`.f1(2)
2
-# Switching to default connection.
+connection default;
+disconnect addcon;
DROP DATABASE `my.db`;
USE test;
#
@@ -289,11 +325,14 @@ DROP EVENT teste_bug11763507;
# ------------------------------------------------------------------
grant create routine on test.* to foo1@localhost identified by 'foo';
update mysql.user set password = replace(password, '*', '-') where user='foo1';
+connect foo,localhost,foo1,foo;
show grants;
Grants for foo1@localhost
GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '*F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
+connection default;
flush privileges;
+connection foo;
show grants;
Grants for foo1@localhost
GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
@@ -304,6 +343,8 @@ Grants for foo1@localhost
GRANT USAGE ON *.* TO 'foo1'@'localhost' IDENTIFIED BY PASSWORD '-F3A2A51A9B0F2BE2468926B4132313728C250DBF'
GRANT CREATE ROUTINE ON `test`.* TO 'foo1'@'localhost'
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE `test`.`spfoo` TO 'foo1'@'localhost'
+connection default;
+disconnect foo;
drop procedure spfoo;
drop user foo1@localhost;
set @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/r/sp_sync.result b/mysql-test/r/sp_sync.result
index ba90b009ce4..d6c170712a7 100644
--- a/mysql-test/r/sp_sync.result
+++ b/mysql-test/r/sp_sync.result
@@ -8,7 +8,8 @@ SET DEBUG_SYNC= 'RESET';
# but before a MDL lock is taken. This must be noticed and the
# sp cache flushed so the correct version can be loaded.
#
-# Connection default
+connect con2, localhost, root;
+connection default;
CREATE FUNCTION f1() RETURNS INT RETURN 1;
# Get f1 cached
SELECT f1();
@@ -18,17 +19,18 @@ f1()
SET DEBUG_SYNC= 'before_execute_sql_command SIGNAL before WAIT_FOR changed';
# Sending:
SELECT f1();
-# Connection 2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR before';
# ... but before f1 is locked, change it.
DROP FUNCTION f1;
CREATE FUNCTION f1() RETURNS INT RETURN 2;
SET DEBUG_SYNC= 'now SIGNAL changed';
-# Connection default
# We should now get '2' and not '1'.
+connection default;
# Reaping: SELECT f1()
f1()
2
+disconnect con2;
DROP FUNCTION f1;
SET DEBUG_SYNC= 'RESET';
#
@@ -38,24 +40,28 @@ SET DEBUG_SYNC= 'RESET';
# to freed memory.
#
DROP FUNCTION IF EXISTS f1;
-# Connection default
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection default;
CREATE FUNCTION f1() RETURNS INT RETURN 0;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'after_wait_locked_pname SIGNAL locked WAIT_FOR issued';
# con2 will now have an x-lock on f1
# Sending:
ALTER FUNCTION f1 COMMENT 'comment';
-# Connection default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# This query will block due to the x-lock on f1 and back-off
SHOW OPEN TABLES WHERE f1()=0;
-# Connection con3
+connection con3;
# Check that the IS query is blocked before releasing the x-lock
SET DEBUG_SYNC= 'now SIGNAL issued';
-# Connection default
+connection default;
# Reaping: ALTER FUNCTION f1 COMMENT 'comment'
DROP FUNCTION f1;
SET DEBUG_SYNC= 'RESET';
+disconnect con2;
+disconnect con3;
#
# Bug #48246 assert in close_thread_table
#
@@ -65,7 +71,7 @@ CREATE FUNCTION f1(b INTEGER) RETURNS INTEGER RETURN 1;
CREATE PROCEDURE p1() SELECT COUNT(f1(a)) FROM t1, t0;
INSERT INTO t0 VALUES(1);
INSERT INTO t1 VALUES(1), (2);
-# Connection 2
+connect con2, localhost, root;
CALL p1();
COUNT(f1(a))
2
@@ -76,7 +82,7 @@ SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked_t1 WAIT_FOR go_for_t0
# reset properly causing an eventual assert.
# Sending:
CALL p1();
-# Connection default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked_t1';
# Issue LOCK TABLES statement which will enter in MDL deadlock
# with CALL statement and as result will cause it to perform
@@ -84,11 +90,12 @@ SET DEBUG_SYNC= 'now WAIT_FOR locked_t1';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL go_for_t0';
LOCK TABLES t0 WRITE, t1 WRITE;
UNLOCK TABLES;
-# Connection 2
+connection con2;
# Reaping: CALL p1()
COUNT(f1(a))
2
-# Connection default
+connection default;
+disconnect con2;
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP TABLES t0, t1;
@@ -98,10 +105,15 @@ DROP TABLES t0, t1;
DROP SCHEMA IF EXISTS s1;
CREATE SCHEMA s1;
CREATE PROCEDURE s1.p1() BEGIN END;
+connect con3, localhost, root;
SET DEBUG_SYNC='before_db_dir_check SIGNAL check_db WAIT_FOR dropped_schema';
CALL s1.p1;
+connection default;
SET DEBUG_SYNC='now WAIT_FOR check_db';
DROP SCHEMA s1;
SET DEBUG_SYNC='now SIGNAL dropped_schema';
+connection con3;
ERROR 42000: Unknown database 's1'
+connection default;
+disconnect con3;
SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/r/sql_mode.result b/mysql-test/r/sql_mode.result
index d71748bd9b1..ac1ad1c625b 100644
--- a/mysql-test/r/sql_mode.result
+++ b/mysql-test/r/sql_mode.result
@@ -497,14 +497,19 @@ xcx
drop table t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
create user mysqltest_32753@localhost;
+connection default;
set @OLD_SQL_MODE=@@SESSION.SQL_MODE;
set session sql_mode='PAD_CHAR_TO_FULL_LENGTH';
flush privileges;
+connect user_32753,localhost,mysqltest_32753,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user();
current_user()
mysqltest_32753@localhost
+connection default;
set session sql_mode=@OLD_SQL_MODE;
flush privileges;
+disconnect user_32753;
+connection default;
drop user mysqltest_32753@localhost;
SET @org_mode=@@sql_mode;
SET @@sql_mode='traditional';
diff --git a/mysql-test/r/ssl-big.result b/mysql-test/r/ssl-big.result
index 39c4f34e46c..54c61507ade 100644
--- a/mysql-test/r/ssl-big.result
+++ b/mysql-test/r/ssl-big.result
@@ -1,3 +1,8 @@
DROP TABLE IF EXISTS t1, t2;
+connect ssl_con,localhost,root,,,,,SSL;
create table t1 (a int);
+disconnect ssl_con;
+connect ssl_con,localhost,root,,,,,SSL;
drop table t1;
+connection default;
+disconnect ssl_con;
diff --git a/mysql-test/r/ssl.result b/mysql-test/r/ssl.result
index 57427a228eb..c36b5c666cb 100644
--- a/mysql-test/r/ssl.result
+++ b/mysql-test/r/ssl.result
@@ -1,3 +1,4 @@
+connect ssl_con,localhost,root,,,,,SSL;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -2172,3 +2173,5 @@ NULL
select 'still connected?';
still connected?
still connected?
+connection default;
+disconnect ssl_con;
diff --git a/mysql-test/r/ssl_cipher.result b/mysql-test/r/ssl_cipher.result
index 78081300b5b..79998dfca80 100644
--- a/mysql-test/r/ssl_cipher.result
+++ b/mysql-test/r/ssl_cipher.result
@@ -1,9 +1,12 @@
#
# BUG#11760210 - SSL_CIPHER_LIST NOT SET OR RETURNED FOR "SHOW STATUS LIKE 'SSL_CIPHER_LIST'"
#
+connect ssl_con,localhost,root,,,,,SSL;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher AES128-SHA
SHOW STATUS LIKE 'Ssl_cipher_list';
Variable_name Value
Ssl_cipher_list AES128-SHA
+connection default;
+disconnect ssl_con;
diff --git a/mysql-test/r/ssl_compress.result b/mysql-test/r/ssl_compress.result
index 31f484ab58c..8260fde5c4e 100644
--- a/mysql-test/r/ssl_compress.result
+++ b/mysql-test/r/ssl_compress.result
@@ -1,3 +1,4 @@
+connect ssl_compress_con,localhost,root,,,,,SSL COMPRESS;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
@@ -2166,3 +2167,5 @@ Ssl_cipher DHE-RSA-AES256-SHA
SHOW STATUS LIKE 'Compression';
Variable_name Value
Compression ON
+connection default;
+disconnect ssl_compress_con;
diff --git a/mysql-test/r/ssl_timeout.result b/mysql-test/r/ssl_timeout.result
index 356e931ba4d..27dce524685 100644
--- a/mysql-test/r/ssl_timeout.result
+++ b/mysql-test/r/ssl_timeout.result
@@ -1,7 +1,10 @@
# connect with read timeout so SLEEP() should timeout
+connect ssl_con,localhost,root,,,,,SSL read_timeout=5;
# Check ssl turned on
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
SELECT SLEEP(600);
ERROR HY000: Lost connection to MySQL server during query
+connection default;
+disconnect ssl_con;
diff --git a/mysql-test/r/stat_tables_par.result b/mysql-test/r/stat_tables_par.result
index ed39b7af9a9..b965e289e1d 100644
--- a/mysql-test/r/stat_tables_par.result
+++ b/mysql-test/r/stat_tables_par.result
@@ -54,6 +54,9 @@ and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
77949.91860000002
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
use dbt3_s001;
@@ -64,6 +67,7 @@ where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24 ;
+connection con2;
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
@@ -74,11 +78,16 @@ where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
+connection con1;
revenue
77949.91860000002
+connection con2;
revenue
77949.91860000002
+connection default;
set use_stat_tables='preferably';
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
@@ -137,16 +146,25 @@ dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
+connection con2;
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
+connection con1;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name, prefix_arity;
db_name table_name index_name prefix_arity avg_frequency
@@ -178,14 +196,22 @@ dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
set debug_sync='RESET';
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_collection_start SIGNAL parked WAIT_FOR finish';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for all;
+connection con2;
set debug_sync='now WAIT_FOR parked';
use dbt3_s001;
set use_stat_tables='never';
set debug_sync='now SIGNAL finish';
+connection con1;
+connection default;
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem'
order by index_name, prefix_arity;
@@ -205,16 +231,25 @@ dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
set @save_global_use_stat_tables=@@global.use_stat_tables;
set global use_stat_tables='preferably';
set debug_sync='RESET';
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_update_start SIGNAL parker WAIT_FOR go1 EXECUTE 1';
set debug_sync='thr_multi_lock_after_thr_lock SIGNAL go2 EXECUTE 2';
use dbt3_s001;
analyze table lineitem persistent for all;
+connection con2;
set debug_sync='open_and_process_table WAIT_FOR parker';
set debug_sync='statistics_read_start SIGNAL go1 WAIT_FOR go2';
use dbt3_s001;
select * from mysql.index_stats, lineitem where index_name= 'i_l_shipdate' and l_orderkey=1 and l_partkey=68 order by prefix_arity;;
+connection con1;
+connection con2;
db_name table_name index_name prefix_arity avg_frequency l_orderkey l_partkey l_suppkey l_linenumber l_quantity l_extendedprice l_discount l_tax l_returnflag l_linestatus l_shipDATE l_commitDATE l_receiptDATE l_shipinstruct l_shipmode l_comment
dbt3_s001 lineitem i_l_shipdate 1 2.6500 1 68 9 2 36 34850.16 0.09 0.06 N O 1996-04-12 1996-02-28 1996-04-20 TAKE BACK RETURN MAIL slyly bold pinto beans detect s
+connection default;
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
set global use_stat_tables=@save_global_use_stat_tables;
DROP DATABASE dbt3_s001;
@@ -230,13 +265,18 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SET debug_sync='after_open_table_ignore_flush WAIT_FOR go';
select * from information_schema.statistics where table_schema='test';
+connect con1, localhost, root;
+connection con1;
select * from t1;
a b
1 1
2 2
SET DEBUG_SYNC= "now SIGNAL go";
+connection default;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
def test t1 1 test a 1 a A 2 NULL NULL YES BTREE
+connection default;
+disconnect con1;
set debug_sync='RESET';
drop table t1;
set global use_stat_tables=@save_global_use_stat_tables;
diff --git a/mysql-test/r/stat_tables_par_innodb.result b/mysql-test/r/stat_tables_par_innodb.result
index cb4e4b09827..155582c9192 100644
--- a/mysql-test/r/stat_tables_par_innodb.result
+++ b/mysql-test/r/stat_tables_par_innodb.result
@@ -57,6 +57,9 @@ and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
revenue
77949.91860000002
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_mem_alloc_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 SIGNAL first_thread_working';
use dbt3_s001;
@@ -67,6 +70,7 @@ where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24 ;
+connection con2;
set debug_sync='statistics_mem_alloc_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_mem_alloc_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
@@ -77,11 +81,16 @@ where l_shipdate >= date '1994-01-01'
and l_shipdate < date '1994-01-01' + interval '1' year
and l_discount between 0.06 - 0.01 and 0.06 + 0.01
and l_quantity < 24;
+connection con1;
revenue
77949.91860000002
+connection con2;
revenue
77949.91860000002
+connection default;
set use_stat_tables='preferably';
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name;
db_name table_name index_name prefix_arity avg_frequency
@@ -140,16 +149,25 @@ dbt3_s001 lineitem i_l_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_collection_start1 WAIT_FOR second_thread_started_too';
set debug_sync='statistics_collection_start2 SIGNAL first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_shipdate);
+connection con2;
set debug_sync='statistics_collection_start1 SIGNAL second_thread_started_too';
set debug_sync='statistics_collection_start2 WAIT_FOR first_thread_working';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for columns() indexes (i_l_receiptdate);
+connection con1;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem' order by index_name, prefix_arity;
db_name table_name index_name prefix_arity avg_frequency
@@ -189,10 +207,14 @@ dbt3_s001 lineitem i_l_suppkey 1 600.5000
dbt3_s001 lineitem i_l_suppkey_partkey 1 30.0250
dbt3_s001 lineitem i_l_suppkey_partkey 2 8.5786
set debug_sync='RESET';
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_collection_start SIGNAL parked WAIT_FOR finish';
use dbt3_s001;
set use_stat_tables='preferably';
analyze table lineitem persistent for all;
+connection con2;
set debug_sync='now WAIT_FOR parked';
use dbt3_s001;
set use_stat_tables='never';
@@ -203,6 +225,10 @@ delete from lineitem where l_orderkey=1 and l_partkey=156;
select * from lineitem where l_orderkey=1 and l_partkey=156;
l_orderkey l_partkey l_suppkey l_linenumber l_quantity l_extendedprice l_discount l_tax l_returnflag l_linestatus l_shipDATE l_commitDATE l_receiptDATE l_shipinstruct l_shipmode l_comment
set debug_sync='now SIGNAL finish';
+connection con1;
+connection default;
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
select * from mysql.index_stats where table_name='lineitem'
order by index_name, prefix_arity;
@@ -236,18 +262,27 @@ dbt3_s001 lineitem i_l_suppkey_partkey 4 1.0000
set @save_global_use_stat_tables=@@global.use_stat_tables;
set global use_stat_tables='preferably';
set debug_sync='RESET';
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
set debug_sync='statistics_update_start SIGNAL parker WAIT_FOR go1 EXECUTE 1';
set debug_sync='thr_multi_lock_after_thr_lock SIGNAL go2 EXECUTE 2';
use dbt3_s001;
analyze table lineitem persistent for all;
+connection con2;
set debug_sync='open_and_process_table WAIT_FOR parker';
set debug_sync='statistics_read_start SIGNAL go1 WAIT_FOR go2';
use dbt3_s001;
select * from mysql.index_stats, lineitem where index_name= 'i_l_shipdate' and l_orderkey=1 and l_partkey=68 order by prefix_arity;;
+connection con1;
+connection con2;
db_name table_name index_name prefix_arity avg_frequency l_orderkey l_partkey l_suppkey l_linenumber l_quantity l_extendedprice l_discount l_tax l_returnflag l_linestatus l_shipDATE l_commitDATE l_receiptDATE l_shipinstruct l_shipmode l_comment
dbt3_s001 lineitem i_l_shipdate 1 2.6496 1 68 9 2 36 34850.16 0.09 0.06 N O 1996-04-12 1996-02-28 1996-04-20 TAKE BACK RETURN MAIL slyly bold pinto beans detect s
dbt3_s001 lineitem i_l_shipdate 2 1.0149 1 68 9 2 36 34850.16 0.09 0.06 N O 1996-04-12 1996-02-28 1996-04-20 TAKE BACK RETURN MAIL slyly bold pinto beans detect s
dbt3_s001 lineitem i_l_shipdate 3 1.0000 1 68 9 2 36 34850.16 0.09 0.06 N O 1996-04-12 1996-02-28 1996-04-20 TAKE BACK RETURN MAIL slyly bold pinto beans detect s
+connection default;
+disconnect con1;
+disconnect con2;
set debug_sync='RESET';
set global use_stat_tables=@save_global_use_stat_tables;
DROP DATABASE dbt3_s001;
@@ -263,13 +298,18 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SET debug_sync='after_open_table_ignore_flush WAIT_FOR go';
select * from information_schema.statistics where table_schema='test';
+connect con1, localhost, root;
+connection con1;
select * from t1;
a b
1 1
2 2
SET DEBUG_SYNC= "now SIGNAL go";
+connection default;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
def test t1 1 test a 1 a A 2 NULL NULL YES BTREE
+connection default;
+disconnect con1;
set debug_sync='RESET';
drop table t1;
set global use_stat_tables=@save_global_use_stat_tables;
diff --git a/mysql-test/r/stat_tables_rbr.result b/mysql-test/r/stat_tables_rbr.result
index 35e74e29b08..7ae7ade4398 100644
--- a/mysql-test/r/stat_tables_rbr.result
+++ b/mysql-test/r/stat_tables_rbr.result
@@ -2,6 +2,7 @@
# Bug mdev-463: assertion failure when running ANALYZE with RBR on
#
SET GLOBAL use_stat_tables = PREFERABLY;
+connect con1,localhost,root,,;
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
@@ -9,6 +10,8 @@ test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
DROP TABLE t1;
SET GLOBAL use_stat_tables = DEFAULT;
+disconnect con1;
+connection default;
SET use_stat_tables = PREFERABLY;
CREATE TABLE t1 ( a INT ) ENGINE=MyISAM PARTITION BY HASH(a) PARTITIONS 2;
ALTER TABLE t1 ANALYZE PARTITION p1;
diff --git a/mysql-test/r/stat_tables_repl.result b/mysql-test/r/stat_tables_repl.result
index 132e5f7beae..43c9fa554c9 100644
--- a/mysql-test/r/stat_tables_repl.result
+++ b/mysql-test/r/stat_tables_repl.result
@@ -11,6 +11,8 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
DROP TABLE t1;
+connection slave;
+connection master;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
ANALYZE TABLE t1;
@@ -18,6 +20,8 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
DROP INDEX idx1 ON t1;
+connection slave;
+connection master;
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
@@ -26,6 +30,8 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
ALTER TABLE t1 DROP COLUMN b;
+connection slave;
+connection master;
DROP TABLE t1;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
@@ -34,6 +40,8 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
ALTER TABLE t1 RENAME to s;
+connection slave;
+connection master;
DROP TABLE s;
CREATE TABLE t1 ( a int, b int, INDEX idx1(b) ) ENGINE=MyISAM;
INSERT INTO t1 VALUES (2,20), (1,20), (3,30);
@@ -42,5 +50,7 @@ Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
ALTER TABLE t1 CHANGE COLUMN b c int ;
+connection slave;
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/r/status.result b/mysql-test/r/status.result
index 55afd159053..60ec5d7dec3 100644
--- a/mysql-test/r/status.result
+++ b/mysql-test/r/status.result
@@ -2,6 +2,8 @@ set @old_concurrent_insert= @@global.concurrent_insert;
set @@global.concurrent_insert= 0;
SET @old_log_output = @@global.log_output;
SET GLOBAL LOG_OUTPUT = 'FILE';
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
flush status;
show status like 'Table_lock%';
Variable_name Value
@@ -11,7 +13,7 @@ select * from information_schema.session_status where variable_name like 'Table_
VARIABLE_NAME VARIABLE_VALUE
TABLE_LOCKS_IMMEDIATE 0
TABLE_LOCKS_WAITED 0
-# Switched to connection: con1
+connection con1;
set sql_log_bin=0;
set @old_general_log = @@global.general_log;
set global general_log = 'OFF';
@@ -21,21 +23,23 @@ insert into t1 values(1);
select 1;
1
1
-# Switched to connection: con2
+connection con2;
lock tables t1 read;
unlock tables;
lock tables t1 read;
-# Switched to connection: con1
+connection con1;
update t1 set n = 3;
-# Switched to connection: con2
+connection con2;
unlock tables;
-# Switched to connection: con1
+connection con1;
show status like 'Table_locks_waited';
Variable_name Value
Table_locks_waited 1
drop table t1;
set global general_log = @old_general_log;
-# Switched to connection: default
+disconnect con2;
+disconnect con1;
+connection default;
select 1;
1
1
@@ -77,6 +81,10 @@ VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 1
SET @save_thread_cache_size=@@thread_cache_size;
SET GLOBAL thread_cache_size=3;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
+disconnect con2;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 3
@@ -90,19 +98,25 @@ Max_used_connections 2
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 2
+connect con2,localhost,root,,;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 3
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 3
+connect con3,localhost,root,,;
SHOW STATUS LIKE 'max_used_connections';
Variable_name Value
Max_used_connections 4
SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
VARIABLE_NAME VARIABLE_VALUE
MAX_USED_CONNECTIONS 4
+connection default;
SET GLOBAL thread_cache_size=@save_thread_cache_size;
+disconnect con3;
+disconnect con2;
+disconnect con1;
CREATE TABLE t1 ( a INT );
INSERT INTO t1 VALUES (1), (2);
SELECT a FROM t1 LIMIT 1;
@@ -151,6 +165,7 @@ SHOW SESSION STATUS LIKE 'Last_query_cost';
Variable_name Value
Last_query_cost 5.205836
DROP TABLE t1;
+connect con1,localhost,root,,;
show status like 'com_show_status';
Variable_name Value
Com_show_status 3
@@ -183,6 +198,8 @@ Variable_name Value
Com_show_status 8
rnd_diff tmp_table_diff
28 8
+disconnect con1;
+connection default;
flush status;
show status like 'Com%function';
Variable_name Value
@@ -201,6 +218,8 @@ Variable_name Value
Com_alter_function 0
Com_create_function 1
Com_drop_function 1
+connect root, localhost, root,,test;
+connection root;
create database db37908;
create table db37908.t1(f1 int);
insert into db37908.t1 values(1);
@@ -209,6 +228,8 @@ grant usage,execute on test.* to mysqltest_1@localhost;
create procedure proc37908() begin select 1; end |
create function func37908() returns int sql security invoker
return (select * from db37908.t1 limit 1)|
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
select * from db37908.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
show status where variable_name ='uptime' and 2 in (select * from db37908.t1);
@@ -217,11 +238,16 @@ show procedure status where name ='proc37908' and 1 in (select f1 from db37908.t
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
show function status where name ='func37908' and 1 in (select func37908());
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 't1'
+connection default;
+disconnect user1;
+disconnect root;
drop database db37908;
drop procedure proc37908;
drop function func37908;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
DROP USER mysqltest_1@localhost;
+connect con1,localhost,root,,;
+connection con1;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS INTEGER
@@ -245,6 +271,8 @@ CALL p1();
SELECT 9;
9
9
+disconnect con1;
+connection default;
DROP PROCEDURE p1;
DROP FUNCTION f1;
flush status;
@@ -341,5 +369,6 @@ Handler_tmp_write 2
Handler_update 0
Handler_write 0
drop table t1;
+connection default;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
diff --git a/mysql-test/r/status2.result b/mysql-test/r/status2.result
index 146fb2adbaf..5805818fdf5 100644
--- a/mysql-test/r/status2.result
+++ b/mysql-test/r/status2.result
@@ -44,9 +44,13 @@ Assert Questions == 13
SHOW STATUS LIKE 'Questions';
Variable_name Value
Questions 13
+connect con1,localhost,root,,;
+connection con1;
SELECT 1;
1
1
+connection default;
+disconnect con1;
Assert Questions == 14
SHOW STATUS LIKE 'Questions';
Variable_name Value
diff --git a/mysql-test/r/status_bug17954.result b/mysql-test/r/status_bug17954.result
index 5c244cd8aca..82d4d1a9a7e 100644
--- a/mysql-test/r/status_bug17954.result
+++ b/mysql-test/r/status_bug17954.result
@@ -9,5 +9,6 @@ SELECT VALUE INTO @tc FROM v1 WHERE NAME = 'Threads_connected';
SELECT NAME FROM v1 WHERE NAME = 'Threads_created' AND VALUE < @tc;
NAME
DROP VIEW v1;
+connection default;
set @@global.concurrent_insert= @old_concurrent_insert;
SET GLOBAL log_output = @old_log_output;
diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result
index ac874f9943c..b306965034b 100644
--- a/mysql-test/r/subselect.result
+++ b/mysql-test/r/subselect.result
@@ -2611,7 +2611,11 @@ explain select a from t1 where c=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
drop table t1;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
+disconnect root;
+connection default;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
diff --git a/mysql-test/r/subselect_no_exists_to_in.result b/mysql-test/r/subselect_no_exists_to_in.result
index 6a5bec062c7..244f6057a2f 100644
--- a/mysql-test/r/subselect_no_exists_to_in.result
+++ b/mysql-test/r/subselect_no_exists_to_in.result
@@ -2614,7 +2614,11 @@ explain select a from t1 where c=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
drop table t1;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
+disconnect root;
+connection default;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index a574319b175..e095ed16ff9 100644
--- a/mysql-test/r/subselect_no_mat.result
+++ b/mysql-test/r/subselect_no_mat.result
@@ -2617,7 +2617,11 @@ explain select a from t1 where c=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
drop table t1;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
+disconnect root;
+connection default;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index 62eecd568f0..f4714526613 100644
--- a/mysql-test/r/subselect_no_opts.result
+++ b/mysql-test/r/subselect_no_opts.result
@@ -2613,7 +2613,11 @@ explain select a from t1 where c=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
drop table t1;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
+disconnect root;
+connection default;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index 174c791489c..5ead5de4cf9 100644
--- a/mysql-test/r/subselect_no_scache.result
+++ b/mysql-test/r/subselect_no_scache.result
@@ -2617,7 +2617,11 @@ explain select a from t1 where c=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
drop table t1;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
+disconnect root;
+connection default;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index e0d62ac6d14..c57c46b76ff 100644
--- a/mysql-test/r/subselect_no_semijoin.result
+++ b/mysql-test/r/subselect_no_semijoin.result
@@ -2613,7 +2613,11 @@ explain select a from t1 where c=2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where
drop table t1;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set @got_val= (SELECT 1 FROM (SELECT 'A' as my_col) as T1 ) ;
+disconnect root;
+connection default;
create table t1 (a int, b int);
create table t2 (a int, b int);
insert into t1 values (1,1),(1,2),(1,3),(2,4),(2,5);
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index be252802c15..fdcfa800d1f 100644
--- a/mysql-test/r/subselect_sj.result
+++ b/mysql-test/r/subselect_sj.result
@@ -2880,6 +2880,8 @@ DROP TABLE t1, t2;
# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
# (testcase only)
#
+connect con1,localhost,root,,;
+connection con1;
SET join_cache_level = 5;
SET optimizer_switch = 'semijoin=on';
CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
@@ -2894,6 +2896,8 @@ a cnt
1 1
4 1
drop table t1, t2;
+connection default;
+disconnect con1;
#
# MDEV-4071: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with ...
#
diff --git a/mysql-test/r/subselect_sj_jcl6.result b/mysql-test/r/subselect_sj_jcl6.result
index 8e95b963971..2886118db30 100644
--- a/mysql-test/r/subselect_sj_jcl6.result
+++ b/mysql-test/r/subselect_sj_jcl6.result
@@ -2894,6 +2894,8 @@ DROP TABLE t1, t2;
# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
# (testcase only)
#
+connect con1,localhost,root,,;
+connection con1;
SET join_cache_level = 5;
SET optimizer_switch = 'semijoin=on';
CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
@@ -2908,6 +2910,8 @@ a cnt
1 1
4 1
drop table t1, t2;
+connection default;
+disconnect con1;
#
# MDEV-4071: Valgrind warnings 'Invalid read' in subselect_engine::calc_const_tables with ...
#
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index b02c9a0c6f5..2385e3887c4 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -122,25 +122,35 @@ INDEX DIRECTORY='TEST_DIR/tmp';
RENAME TABLE t2 TO t1;
ERROR HY000: Can't create/write to file 'TEST_DIR/tmp/t1.MYI' (Errcode: 17 "File exists")
DROP TABLE t2;
+connect session1,localhost,root,,;
+connect session2,localhost,root,,;
+connection session1;
create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 9 a;
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
+connection session2;
create temporary table t1 (a int) engine=myisam data directory="MYSQLTEST_VARDIR/log" select 99 a;
show create table t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/log/'
+connection default;
create table t1 (a int) engine=myisam select 42 a;
+connection session1;
select * from t1;
a
9
+disconnect session1;
+connection session2;
select * from t1;
a
99
+disconnect session2;
+connection default;
select * from t1;
a
42
diff --git a/mysql-test/r/synchronization.result b/mysql-test/r/synchronization.result
index 3f6d16178dd..ee8195820b0 100644
--- a/mysql-test/r/synchronization.result
+++ b/mysql-test/r/synchronization.result
@@ -1,6 +1,10 @@
DROP TABLE IF EXISTS t1,t2;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
CREATE TABLE t1 (x1 INT);
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -8,7 +12,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -16,7 +22,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -24,7 +33,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -32,7 +43,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -40,7 +54,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -48,7 +64,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -56,7 +75,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -64,7 +85,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -72,7 +96,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -80,7 +106,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -88,7 +117,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -96,7 +127,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -104,7 +138,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -112,7 +148,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -120,7 +159,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -128,7 +169,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -136,7 +180,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -144,7 +190,10 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
+connection con1;
ALTER TABLE t1 CHANGE x1 x2 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -152,7 +201,9 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
ALTER TABLE t1 CHANGE x2 x1 INT;
+connection con2;
CREATE TABLE t2 LIKE t1;
SHOW CREATE TABLE t2;
Table Create Table
@@ -160,4 +211,8 @@ t2 CREATE TABLE `t2` (
`xx` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t2;
+connection con1;
DROP TABLE t1;
+connection default;
+disconnect con1;
+disconnect con2;
diff --git a/mysql-test/r/temp_table.result b/mysql-test/r/temp_table.result
index ee0b3ab6d48..c674113e909 100644
--- a/mysql-test/r/temp_table.result
+++ b/mysql-test/r/temp_table.result
@@ -158,9 +158,12 @@ drop table t1, t2;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (i INT);
LOCK TABLE t1 WRITE;
+connect conn1, localhost, root,,;
CREATE TEMPORARY TABLE t1 (i INT);
The following command should not block
DROP TEMPORARY TABLE t1;
+disconnect conn1;
+connection default;
DROP TABLE t1;
CREATE TABLE t1 (i INT);
CREATE TEMPORARY TABLE t2 (i INT);
diff --git a/mysql-test/r/timezone_grant.result b/mysql-test/r/timezone_grant.result
index d33d92dbc9e..42ce458d00f 100644
--- a/mysql-test/r/timezone_grant.result
+++ b/mysql-test/r/timezone_grant.result
@@ -9,6 +9,8 @@ create table t1 (a int, b datetime);
create table t2 (c int, d datetime);
create user mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
+connect tzuser, localhost, mysqltest_1,,;
+connection tzuser;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -26,10 +28,15 @@ select * from mysql.time_zone_name;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
select Name, convert_tz('2004-10-21 19:00:00', Name, 'UTC') from mysql.time_zone_name;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'time_zone_name'
+connection default;
+disconnect tzuser;
+connection default;
delete from mysql.db where user like 'mysqltest\_%';
flush privileges;
grant all privileges on test.t1 to mysqltest_1@localhost;
grant all privileges on test.t2 to mysqltest_1@localhost;
+connect tzuser2, localhost, mysqltest_1,,;
+connection tzuser2;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
@@ -57,6 +64,8 @@ update t1 set b = '2005-01-01 10:00';
update t1 set b = convert_tz(b, 'UTC', 'UTC');
update t1 join t2 on (t1.a = t2.a) set t1.b = '2005-01-01 10:00' where t2.b = 'foo';
update t1 join t2 on (t1.a = t2.a) set t1.b = convert_tz('2005-01-01 10:00','UTC','UTC') where t2.b = 'foo';
+connection default;
+disconnect tzuser2;
delete from mysql.user where user like 'mysqltest\_%';
delete from mysql.db where user like 'mysqltest\_%';
delete from mysql.tables_priv where user like 'mysqltest\_%';
@@ -66,6 +75,7 @@ create table t1 (a int, b datetime);
insert into t1 values (1, 20010101000000), (2, 20020101000000);
create user mysqltest_1@localhost;
grant all privileges on test.* to mysqltest_1@localhost;
+connect tzuser3, localhost, mysqltest_1,,;
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1;
select * from v1;
a lb
@@ -76,5 +86,7 @@ ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table '
drop view v1;
create view v1 as select a, convert_tz(b, 'UTC', 'Europe/Moscow') as lb from t1, mysql.time_zone;
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 'time_zone'
+connection default;
+disconnect tzuser3;
drop table t1;
drop user mysqltest_1@localhost;
diff --git a/mysql-test/r/trans_read_only.result b/mysql-test/r/trans_read_only.result
index 2b1055d4a7b..61ce646d535 100644
--- a/mysql-test/r/trans_read_only.result
+++ b/mysql-test/r/trans_read_only.result
@@ -7,7 +7,8 @@
SELECT @@tx_read_only;
@@tx_read_only
1
-# Also for new connections. Switching to con1
+# Also for new connections.
+connect con1, localhost, root;
SELECT @@tx_read_only;
@@tx_read_only
1
@@ -15,7 +16,8 @@ SET SESSION TRANSACTION READ WRITE;
SELECT @@tx_read_only;
@@tx_read_only
0
-# Connection default
+disconnect con1;
+connection default;
SELECT @@tx_read_only;
@@tx_read_only
1
diff --git a/mysql-test/r/trigger-compat.result b/mysql-test/r/trigger-compat.result
index 7659667fb37..3d96507d71f 100644
--- a/mysql-test/r/trigger-compat.result
+++ b/mysql-test/r/trigger-compat.result
@@ -8,8 +8,8 @@ CREATE DATABASE mysqltest_db1;
CREATE USER mysqltest_dfn@localhost;
CREATE USER mysqltest_inv@localhost;
GRANT CREATE, TRIGGER ON mysqltest_db1.* TO mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT);
CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER());
@@ -35,6 +35,8 @@ DROP TRIGGER wl2818_trg1;
Warnings:
Warning 1454 No definer attribute for trigger 'mysqltest_db1'.'wl2818_trg1'. The trigger will be activated under the authorization of the invoker, which may have insufficient privileges. Please recreate the trigger.
DROP TRIGGER wl2818_trg2;
+disconnect wl2818_definer_con;
+connection default;
use mysqltest_db1;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/r/trigger-trans.result b/mysql-test/r/trigger-trans.result
index cab7336cbe5..c58c4230a40 100644
--- a/mysql-test/r/trigger-trans.result
+++ b/mysql-test/r/trigger-trans.result
@@ -113,13 +113,18 @@ for each row
begin
insert into t3 (c) values (1);
end|
+connect connection_aux,localhost,root,,test,,;
+connect connection_update,localhost,root,,test,,;
+connection connection_aux;
select get_lock("lock_bug26141_wait", 0);
get_lock("lock_bug26141_wait", 0)
1
+connection default;
select get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0);
get_lock("lock_bug26141_sync", /* must not be priorly locked */ 0)
1
insert into t1 (c) values (2);
+connection connection_update;
select get_lock("lock_bug26141_sync", 1000);
get_lock("lock_bug26141_sync", 1000)
1
@@ -127,9 +132,11 @@ update t1 set c=3 where c=1;
select release_lock("lock_bug26141_sync");
release_lock("lock_bug26141_sync")
1
+connection connection_aux;
select release_lock("lock_bug26141_wait");
release_lock("lock_bug26141_wait")
1
+connection default;
select * from t1;
c
2
@@ -141,6 +148,8 @@ select * from t3;
c
1
drop table t1, t2, t3;
+disconnect connection_update;
+disconnect connection_aux;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=innodb;
diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result
index 86219875bed..19a8d53a428 100644
--- a/mysql-test/r/trigger.result
+++ b/mysql-test/r/trigger.result
@@ -4,6 +4,10 @@ drop database if exists mysqltest;
drop function if exists f1;
drop function if exists f2;
drop procedure if exists p1;
+connect addconroot1, localhost, root,,;
+connect addconroot2, localhost, root,,;
+connect addconwithoutdb, localhost, root,,*NO-ONE*;
+connection default;
create table t1 (i int);
create trigger trg before insert on t1 for each row set @a:=1;
set @a:=0;
@@ -733,7 +737,9 @@ set NEW.username = user;
select count(*) from ((select 1) union (select 2)) as d1 into i;
end|
update t1 set data = 1;
+connection addconroot1;
update t1 set data = 2;
+connection default;
drop table t1;
create table t1 (c1 int, c2 datetime);
create trigger tr1 before insert on t1 for each row
@@ -848,12 +854,14 @@ end//
CALL p1();
drop procedure p1;
drop table t1;
+connection addconwithoutdb;
create trigger t1_bi before insert on test.t1 for each row set @a:=0;
ERROR 3D000: No database selected
create trigger test.t1_bi before insert on t1 for each row set @a:=0;
ERROR 42S02: Table 'test.t1' doesn't exist
drop trigger t1_bi;
ERROR 3D000: No database selected
+connection default;
create table t1 (id int);
create trigger t1_bi before insert on t1 for each row set @a:=new.id;
create trigger t1_ai after insert on test.t1 for each row set @b:=new.id;
@@ -1061,7 +1069,10 @@ trigger_conn_id INT
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
SET NEW.trigger_conn_id = CONNECTION_ID();
INSERT INTO t1 (conn_id, trigger_conn_id) VALUES (CONNECTION_ID(), -1);
+connect con1,localhost,root,,;
INSERT INTO t1 (conn_id, trigger_conn_id) VALUES (CONNECTION_ID(), -1);
+connection default;
+disconnect con1;
SELECT * FROM t1 WHERE conn_id != trigger_conn_id;
conn_id trigger_conn_id
DROP TRIGGER t1_bi;
@@ -1275,10 +1286,12 @@ insert into t1 values ();
select @a;
@a
20
+connection addconroot1;
insert into t1 values ();
select @a;
@a
20
+connection default;
drop table t1;
drop function f1;
drop table if exists t1;
@@ -1445,6 +1458,9 @@ isave
1
2
drop table t1, t2, t3;
+disconnect addconroot1;
+disconnect addconroot2;
+disconnect addconwithoutdb;
Bug#28502 Triggers that update another innodb table will block
on X lock unnecessarily
@@ -1464,7 +1480,10 @@ end if;
end|
insert into t1 (id, count) values (1, 0);
lock table t1 write;
+connect connection_insert, localhost, root, , test, , ;
+connection connection_insert;
insert into t2 set id=1;
+connection default;
unlock tables;
update t2 set id=1 where id=1;
select * from t1;
@@ -1474,6 +1493,7 @@ select * from t2;
id
1
drop table t1, t2;
+disconnect connection_insert;
Additionally, provide test coverage for triggers and
all MySQL data changing commands.
@@ -2245,9 +2265,12 @@ VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9);
INSERT INTO t2
VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0);
UPDATE t1 SET a = 3;
+connect con1,localhost,root,,;
SELECT COUNT(*) FROM t1;
COUNT(*)
9
+disconnect con1;
+connection default;
SELECT * FROM t2;
b
9
diff --git a/mysql-test/r/trigger_notembedded.result b/mysql-test/r/trigger_notembedded.result
index 795f722b0d4..b0addf8d50f 100644
--- a/mysql-test/r/trigger_notembedded.result
+++ b/mysql-test/r/trigger_notembedded.result
@@ -8,69 +8,67 @@ CREATE DATABASE mysqltest_db1;
CREATE USER mysqltest_dfn@localhost;
CREATE USER mysqltest_inv@localhost;
GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT);
-
----> connection: default
+disconnect wl2818_definer_con;
+connection default;
GRANT INSERT, DROP ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
GRANT INSERT, DROP ON mysqltest_db1.t2 TO mysqltest_dfn@localhost;
-
----> connection: default
+connection default;
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
CREATE TRIGGER trg1 AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
ERROR 42000: TRIGGER command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
-
----> connection: default
+disconnect wl2818_definer_con;
+connection default;
GRANT TRIGGER ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
CREATE TRIGGER trg1 AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
-
----> connection: default
+disconnect wl2818_definer_con;
+connection default;
REVOKE TRIGGER ON mysqltest_db1.t1 FROM mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
DROP TRIGGER trg1;
ERROR 42000: TRIGGER command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
-
----> connection: wl2818_definer_con
+disconnect wl2818_definer_con;
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
INSERT INTO t1 VALUES(0);
ERROR 42000: TRIGGER command denied to user 'mysqltest_dfn'@'localhost' for table 't1'
-
----> connection: default
+disconnect wl2818_definer_con;
+connection default;
GRANT TRIGGER ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
INSERT INTO t1 VALUES(0);
DROP TRIGGER trg1;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
-
----> connection: default
+disconnect wl2818_definer_con;
+connection default;
REVOKE SUPER ON *.* FROM mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
CREATE TRIGGER trg1 AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
-
----> connection: default
+connection default;
GRANT ALL PRIVILEGES ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
GRANT ALL PRIVILEGES ON mysqltest_db1.t2 TO mysqltest_dfn@localhost;
GRANT ALL PRIVILEGES ON mysqltest_db1.t1
TO 'mysqltest_inv'@localhost;
GRANT SELECT ON mysqltest_db1.t2
TO 'mysqltest_inv'@localhost;
-
----> connection: wl2818_definer_con
+connection wl2818_definer_con;
use mysqltest_db1;
INSERT INTO t1 VALUES(1);
SELECT * FROM t1;
@@ -79,8 +77,8 @@ num_value
SELECT * FROM t2;
user_str
mysqltest_dfn@localhost
-
----> connection: wl2818_invoker_con
+connect wl2818_invoker_con,localhost,mysqltest_inv,,mysqltest_db1;
+connection wl2818_invoker_con;
use mysqltest_db1;
INSERT INTO t1 VALUES(2);
SELECT * FROM t1;
@@ -91,12 +89,10 @@ SELECT * FROM t2;
user_str
mysqltest_dfn@localhost
mysqltest_dfn@localhost
-
----> connection: default
+connection default;
use mysqltest_db1;
REVOKE INSERT ON mysqltest_db1.t2 FROM mysqltest_dfn@localhost;
-
----> connection: wl2818_invoker_con
+connection wl2818_invoker_con;
use mysqltest_db1;
INSERT INTO t1 VALUES(3);
ERROR 42000: INSERT command denied to user 'mysqltest_dfn'@'localhost' for table 't2'
@@ -109,8 +105,7 @@ SELECT * FROM t2;
user_str
mysqltest_dfn@localhost
mysqltest_dfn@localhost
-
----> connection: wl2818_definer_con
+connection wl2818_definer_con;
use mysqltest_db1;
DROP TRIGGER trg1;
CREATE DEFINER='mysqltest_inv'@'localhost'
@@ -118,12 +113,12 @@ CREATE DEFINER='mysqltest_inv'@'localhost'
FOR EACH ROW
SET @new_sum = 0;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
-
----> connection: default
+connection default;
use mysqltest_db1;
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
-
----> connection: wl2818_definer_con
+disconnect wl2818_definer_con;
+connect wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1;
+connection wl2818_definer_con;
CREATE DEFINER='mysqltest_inv'@'localhost'
TRIGGER trg1 BEFORE INSERT ON t1
FOR EACH ROW
@@ -173,8 +168,7 @@ def mysqltest_db1 trg2 INSERT def mysqltest_db1 t1 0 NULL SET @a = 2 ROW AFTER N
def mysqltest_db1 trg3 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 3 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @abc@def@@% latin1 latin1_swedish_ci latin1_swedish_ci
def mysqltest_db1 trg4 UPDATE def mysqltest_db1 t1 0 NULL SET @a = 4 ROW AFTER NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @hostname latin1 latin1_swedish_ci latin1_swedish_ci
def mysqltest_db1 trg5 DELETE def mysqltest_db1 t1 0 NULL SET @a = 5 ROW BEFORE NULL NULL OLD NEW NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION @abcdef@@@hostname latin1 latin1_swedish_ci latin1_swedish_ci
-
----> connection: default
+connection default;
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
DROP DATABASE mysqltest_db1;
@@ -194,29 +188,26 @@ CREATE USER mysqltest_u1@localhost;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
GRANT TRIGGER ON mysqltest_db1.* TO mysqltest_u1@localhost;
SET @mysqltest_var = NULL;
-
----> connection: default
+connect bug15166_u1_con,localhost,mysqltest_u1,,mysqltest_db1;
+connection default;
use mysqltest_db1;
GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
Grants for mysqltest_u1@localhost
GRANT USAGE ON *.* TO 'mysqltest_u1'@'localhost'
GRANT DELETE, TRIGGER ON `mysqltest_db1`.* TO 'mysqltest_u1'@'localhost'
-
----> connection: bug15166_u1_con
+connection bug15166_u1_con;
use mysqltest_db1;
CREATE TRIGGER t1_trg_after_delete AFTER DELETE ON t1
FOR EACH ROW
SET @mysqltest_var = 'Hello, world!';
-
----> connection: default
+connection default;
use mysqltest_db1;
GRANT UPDATE ON mysqltest_db1.t1 TO mysqltest_u1@localhost;
GRANT UPDATE ON mysqltest_db1.t2 TO mysqltest_u1@localhost;
GRANT UPDATE(col) ON mysqltest_db1.t3 TO mysqltest_u1@localhost;
GRANT UPDATE(col) ON mysqltest_db1.t4 TO mysqltest_u1@localhost;
-
----> connection: bug15166_u1_con
+connection bug15166_u1_con;
use mysqltest_db1;
CREATE TRIGGER t1_trg_err_1 BEFORE INSERT ON t1
FOR EACH ROW
@@ -240,8 +231,7 @@ DROP TRIGGER t3_trg_err_2;
CREATE TRIGGER t4_trg_before_insert BEFORE INSERT ON t4
FOR EACH ROW
SET NEW.col = 't4_trg_before_insert';
-
----> connection: default
+connection default;
use mysqltest_db1;
REVOKE UPDATE ON mysqltest_db1.t1 FROM mysqltest_u1@localhost;
REVOKE UPDATE ON mysqltest_db1.t2 FROM mysqltest_u1@localhost;
@@ -251,8 +241,7 @@ REVOKE UPDATE(col) ON mysqltest_db1.t3 FROM mysqltest_u1@localhost;
REVOKE UPDATE(col) ON mysqltest_db1.t4 FROM mysqltest_u1@localhost;
GRANT SELECT(col) on mysqltest_db1.t3 TO mysqltest_u1@localhost;
GRANT SELECT(col) on mysqltest_db1.t4 TO mysqltest_u1@localhost;
-
----> connection: bug15166_u1_con
+connection bug15166_u1_con;
use mysqltest_db1;
CREATE TRIGGER t1_trg_after_insert AFTER INSERT ON t1
FOR EACH ROW
@@ -282,8 +271,7 @@ CREATE TRIGGER t4_trg_err_2 BEFORE UPDATE ON t4
FOR EACH ROW
SET NEW.col = CONCAT(OLD.col, '(updated)');
DROP TRIGGER t4_trg_err_2;
-
----> connection: default
+connection default;
use mysqltest_db1;
REVOKE SELECT ON mysqltest_db1.t1 FROM mysqltest_u1@localhost;
REVOKE SELECT ON mysqltest_db1.t2 FROM mysqltest_u1@localhost;
@@ -317,8 +305,7 @@ INSERT INTO t4 VALUES('t4_line2');
SELECT * FROM t4;
col
t4_trg_before_insert
-
----> connection: default
+connection default;
use mysqltest_db1;
REVOKE UPDATE ON mysqltest_db1.t1 FROM mysqltest_u1@localhost;
REVOKE UPDATE ON mysqltest_db1.t2 FROM mysqltest_u1@localhost;
@@ -374,69 +361,103 @@ CREATE USER mysqltest_dfn@localhost;
CREATE USER mysqltest_inv@localhost;
GRANT EXECUTE, CREATE ROUTINE, TRIGGER ON *.* TO mysqltest_dfn@localhost;
GRANT INSERT ON mysqltest_db1.* TO mysqltest_inv@localhost;
+connect definer,localhost,mysqltest_dfn,,mysqltest_db1;
+connect invoker,localhost,mysqltest_inv,,mysqltest_db1;
+connection definer;
CREATE PROCEDURE p1(OUT i INT) DETERMINISTIC NO SQL SET i = 3;
CREATE PROCEDURE p2(INOUT i INT) DETERMINISTIC NO SQL SET i = i * 5;
+connection definer;
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
CALL p1(NEW.i1);
CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
CALL p2(NEW.i1);
+connection invoker;
INSERT INTO t1 VALUES (7);
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
INSERT INTO t2 VALUES (11);
ERROR 42000: SELECT, UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't2'
+connection definer;
DROP TRIGGER t2_bi;
DROP TRIGGER t1_bi;
+connection default;
GRANT SELECT ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+connection definer;
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
CALL p1(NEW.i1);
CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
CALL p2(NEW.i1);
+connection invoker;
INSERT INTO t1 VALUES (13);
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
INSERT INTO t2 VALUES (17);
ERROR 42000: UPDATE command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't2'
+connection default;
REVOKE SELECT ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+connection definer;
DROP TRIGGER t2_bi;
DROP TRIGGER t1_bi;
+connection default;
GRANT UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+connection definer;
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
CALL p1(NEW.i1);
CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
CALL p2(NEW.i1);
+connection invoker;
INSERT INTO t1 VALUES (19);
INSERT INTO t2 VALUES (23);
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't2'
+connection default;
REVOKE UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+connection definer;
DROP TRIGGER t2_bi;
DROP TRIGGER t1_bi;
+connection default;
GRANT SELECT, UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+connection definer;
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
CALL p1(NEW.i1);
CREATE TRIGGER t2_bi BEFORE INSERT ON t2 FOR EACH ROW
CALL p2(NEW.i1);
+connection invoker;
INSERT INTO t1 VALUES (29);
INSERT INTO t2 VALUES (31);
+connection default;
REVOKE SELECT, UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+connection definer;
DROP TRIGGER t2_bi;
DROP TRIGGER t1_bi;
+connection default;
DROP PROCEDURE p2;
DROP PROCEDURE p1;
+connection default;
GRANT UPDATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
+connection definer;
CREATE PROCEDURE p1(OUT i INT) DETERMINISTIC NO SQL SET i = 37;
CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW
CALL p1(NEW.i1);
+connection invoker;
INSERT INTO t1 VALUES (41);
+connection definer;
DROP PROCEDURE p1;
CREATE PROCEDURE p1(IN i INT) DETERMINISTIC NO SQL SET @v1 = i + 43;
+connection invoker;
INSERT INTO t1 VALUES (47);
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
+connection definer;
DROP PROCEDURE p1;
CREATE PROCEDURE p1(INOUT i INT) DETERMINISTIC NO SQL SET i = i + 51;
+connection invoker;
INSERT INTO t1 VALUES (53);
ERROR 42000: SELECT command denied to user 'mysqltest_dfn'@'localhost' for column 'i1' in table 't1'
+connection default;
DROP PROCEDURE p1;
REVOKE UPDATE ON mysqltest_db1.* FROM mysqltest_dfn@localhost;
+connection definer;
DROP TRIGGER t1_bi;
+disconnect definer;
+disconnect invoker;
+connection default;
DROP USER mysqltest_inv@localhost;
DROP USER mysqltest_dfn@localhost;
DROP TABLE t2;
@@ -448,24 +469,41 @@ CREATE TABLE t2 (id INTEGER);
INSERT INTO t2 VALUES (1),(2);
CREATE TRIGGER t1_test AFTER INSERT ON t1 FOR EACH ROW
INSERT INTO t2 VALUES (new.id);
+CONNECT rl_holder, localhost, root,,;
+CONNECT rl_acquirer, localhost, root,,;
+CONNECT wl_acquirer, localhost, root,,;
+CONNECT rl_contender, localhost, root,,;
+connection rl_holder;
SELECT GET_LOCK('B26162',120);
GET_LOCK('B26162',120)
1
+connection rl_acquirer;
SELECT 'rl_acquirer', GET_LOCK('B26162',120), id FROM t2 WHERE id = 1;
+connection wl_acquirer;
SET SESSION LOW_PRIORITY_UPDATES=1;
SET GLOBAL LOW_PRIORITY_UPDATES=1;
INSERT INTO t1 VALUES (5);
+connection rl_contender;
SELECT 'rl_contender', id FROM t2 WHERE id > 1;
+connection rl_holder;
SELECT RELEASE_LOCK('B26162');
RELEASE_LOCK('B26162')
1
+connection rl_acquirer;
rl_acquirer GET_LOCK('B26162',120) id
rl_acquirer 1 1
SELECT RELEASE_LOCK('B26162');
RELEASE_LOCK('B26162')
1
+connection wl_acquirer;
+connection rl_contender;
rl_contender id
rl_contender 2
+connection default;
+disconnect rl_acquirer;
+disconnect wl_acquirer;
+disconnect rl_contender;
+disconnect rl_holder;
DROP TRIGGER t1_test;
DROP TABLE t1,t2;
SET SESSION LOW_PRIORITY_UPDATES=DEFAULT;
@@ -473,18 +511,21 @@ SET GLOBAL LOW_PRIORITY_UPDATES=DEFAULT;
End of 5.0 tests.
drop table if exists t1;
create table t1 (i int);
-connection: default
+connect flush,localhost,root,,test,,;
+connection default;
lock tables t1 write;
-connection: flush
+connection flush;
flush tables with read lock;;
-connection: default
+connection default;
create trigger t1_bi before insert on t1 for each row begin end;
unlock tables;
-connection: flush
+connection flush;
unlock tables;
+connection default;
select * from t1;
i
drop table t1;
+disconnect flush;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a char(30)) ENGINE=MEMORY;
CREATE TRIGGER db1.trg AFTER INSERT ON db1.t1 FOR EACH ROW
@@ -492,11 +533,14 @@ INSERT INTO db1.t1 VALUES('Some very sensitive data goes here');
CREATE USER 'no_rights'@'localhost';
REVOKE ALL ON *.* FROM 'no_rights'@'localhost';
FLUSH PRIVILEGES;
+connect con1,localhost,no_rights,,;
SELECT trigger_name FROM INFORMATION_SCHEMA.TRIGGERS
WHERE trigger_schema = 'db1';
trigger_name
SHOW CREATE TRIGGER db1.trg;
ERROR 42000: Access denied; you need (at least one of) the TRIGGER privilege(s) for this operation
+connection default;
+disconnect con1;
DROP USER 'no_rights'@'localhost';
DROP DATABASE db1;
DROP DATABASE IF EXISTS mysqltest_db1;
@@ -504,6 +548,7 @@ CREATE DATABASE mysqltest_db1;
USE mysqltest_db1;
CREATE USER mysqltest_u1@localhost;
GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost;
+connect con1,localhost,mysqltest_u1,,mysqltest_db1;
CREATE TABLE t1 (
a1 int,
a2 int
@@ -515,10 +560,13 @@ CREATE TABLE t2 (
a1 int
);
INSERT INTO t2 VALUES (2);
+connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_u1@localhost;
UPDATE IGNORE t1, t2 SET t1.a1 = 2, t2.a1 = 3 WHERE t1.a1 = 1 AND t2.a1 = 2;
ERROR 42000: TRIGGER command denied to user 'mysqltest_u1'@'localhost' for table 't1'
DROP DATABASE mysqltest_db1;
DROP USER mysqltest_u1@localhost;
+disconnect con1;
+connection default;
USE test;
End of 5.1 tests.
diff --git a/mysql-test/r/truncate_coverage.result b/mysql-test/r/truncate_coverage.result
index 395c71b2e6b..95e649912e5 100644
--- a/mysql-test/r/truncate_coverage.result
+++ b/mysql-test/r/truncate_coverage.result
@@ -5,48 +5,41 @@ DROP TABLE IF EXISTS t1;
#
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1);
-#
-# connection con1
+connect con1, localhost, root,,;
HANDLER t1 OPEN;
-#
-# connection default
+connection default;
LOCK TABLE t1 WRITE;
SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting';
TRUNCATE TABLE t1;
-#
-# connection con2
+connect con2, localhost, root,,;
SET DEBUG_SYNC='now WAIT_FOR waiting';
KILL QUERY @id;
-#
-# connection default
+disconnect con2;
+connection default;
ERROR 70100: Query execution was interrupted
UNLOCK TABLES;
-#
-# connection con1
+connection con1;
# Release shared metadata lock by closing HANDLER.
HANDLER t1 CLOSE;
-#
-# connection default
+disconnect con1;
+connection default;
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1);
-#
-# connection con1
+connect con1, localhost, root,,;
HANDLER t1 OPEN;
-#
-# connection default
+connection default;
LOCK TABLE t1 WRITE;
SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting';
TRUNCATE TABLE t1;
-#
-# connection con2
+connect con2, localhost, root,,;
SET DEBUG_SYNC='now WAIT_FOR waiting';
-#
-# connection con1
+disconnect con2;
+connection con1;
HANDLER t1 CLOSE;
-#
-# connection default
+disconnect con1;
+connection default;
ERROR 42S02: Table 'test.t1' doesn't exist
UNLOCK TABLES;
DROP TABLE t1;
@@ -54,27 +47,22 @@ ERROR 42S02: Unknown table 'test.t1'
SET DEBUG_SYNC='RESET';
CREATE TABLE t1 (c1 INT);
INSERT INTO t1 VALUES (1);
-#
-# connection con1
+connect con1, localhost, root,,;
START TRANSACTION;
INSERT INTO t1 VALUES (2);
-#
-# connection default
+connection default;
SET DEBUG_SYNC='mdl_acquire_lock_wait SIGNAL waiting';
TRUNCATE TABLE t1;
-#
-# connection con1
+connection con1;
SET DEBUG_SYNC='now WAIT_FOR waiting';
KILL QUERY @id;
-#
-# connection default
+connection default;
ERROR 70100: Query execution was interrupted
-#
-# connection con1
+connection con1;
# Release SW lock by committing transaction.
COMMIT;
-#
-# connection default
+disconnect con1;
+connection default;
UNLOCK TABLES;
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
@@ -86,22 +74,25 @@ SET DEBUG_SYNC='RESET';
DROP TABLE IF EXISTS t1, m1;
CREATE TABLE t1(a INT) engine=memory;
CREATE TABLE m1(a INT) engine=merge UNION(t1);
-# Connection con1
+connect con2, localhost, root;
+connect con1, localhost, root;
SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped';
# Sending:
TRUNCATE TABLE m1;
-# Connection con2
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
# Sending:
FLUSH TABLES;
-# Connection default
+connection default;
# Waiting for FLUSH TABLES to be blocked.
SET DEBUG_SYNC= 'now SIGNAL dropped';
-# Connection con1
+connection con1;
# Reaping: TRUNCATE TABLE m1
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
-# Connection con2
+disconnect con1;
+connection con2;
# Reaping: FLUSH TABLES
-# Connection default
+disconnect con2;
+connection default;
SET DEBUG_SYNC= 'RESET';
DROP TABLE m1, t1;
diff --git a/mysql-test/r/udf_debug_sync.result b/mysql-test/r/udf_debug_sync.result
index 2db75f9aa76..8ce6dbdd5c0 100644
--- a/mysql-test/r/udf_debug_sync.result
+++ b/mysql-test/r/udf_debug_sync.result
@@ -1,20 +1,28 @@
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
CREATE VIEW v1 AS SELECT myfunc_int(1);
+connect con1, localhost, root,,;
+connection con1;
SET debug_sync='mysql_create_function_after_lock SIGNAL locked WAIT_FOR go';
CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
+connection default;
SET debug_sync='now WAIT_FOR locked';
SET debug_sync='find_udf_before_lock SIGNAL go';
SELECT * FROM v1;
myfunc_int(1)
1
FLUSH TABLES;
+connection con1;
SET debug_sync='mysql_drop_function_after_lock SIGNAL locked WAIT_FOR go';
DROP FUNCTION myfunc_double;
+connection default;
SET debug_sync='now WAIT_FOR locked';
SET debug_sync='find_udf_before_lock SIGNAL go';
SELECT * FROM v1;
myfunc_int(1)
1
+connection con1;
+disconnect con1;
+connection default;
SET debug_sync='RESET';
DROP VIEW v1;
DROP FUNCTION myfunc_int;
diff --git a/mysql-test/r/union.result b/mysql-test/r/union.result
index dd7c8fcc8ee..12f18d6038d 100644
--- a/mysql-test/r/union.result
+++ b/mysql-test/r/union.result
@@ -1377,6 +1377,7 @@ SELECT @tmp_max:= @@global.max_allowed_packet;
SET @@global.max_allowed_packet=25000000;
Warnings:
Warning 1292 Truncated incorrect max_allowed_packet value: '25000000'
+connect newconn, localhost, root,,;
CREATE TABLE t1 (a mediumtext);
CREATE TABLE t2 (b varchar(20));
INSERT INTO t1 VALUES ('a');
@@ -1414,7 +1415,9 @@ t3 CREATE TABLE `t3` (
`a` varbinary(510) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLES t1,t2,t3;
+connection default;
SET @@global.max_allowed_packet:= @tmp_max;
+disconnect newconn;
create table t1 ( id int not null auto_increment, primary key (id), col1 int);
insert into t1 (col1) values (2),(3),(4),(5),(6);
select 99 union all select id from t1 order by 1;
diff --git a/mysql-test/r/unsafe_binlog_innodb.result b/mysql-test/r/unsafe_binlog_innodb.result
index b2cf16ad58f..0fe3d38035b 100644
--- a/mysql-test/r/unsafe_binlog_innodb.result
+++ b/mysql-test/r/unsafe_binlog_innodb.result
@@ -14,6 +14,9 @@ select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
where mm.id is null lock in share mode;
id f_id f
drop table t1,t2;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine = InnoDB;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
@@ -28,24 +31,41 @@ a b
6 2
7 3
update t1 set b = 5 where b = 1;
+connection b;
set autocommit = 0;
select * from t1 where a = 2 and b = 2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection a;
commit;
+connection b;
commit;
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine = InnoDB;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
set autocommit = 0;
update t1 set b = 5 where b = 1;
+connection b;
set autocommit = 0;
select * from t1 where a = 7 and b = 3 for update;
a b
7 3
commit;
+connection a;
commit;
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine = InnoDB;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine = InnoDB;
@@ -57,17 +77,33 @@ d e
3 1
8 6
12 1
+connection b;
set autocommit = 0;
insert into t1 select * from t2;
update t1 set b = (select e from t2 where a = d);
create table t3(d int not null, e int, primary key(d)) engine = InnoDB
select * from t2;
commit;
+connection a;
commit;
+connection default;
+disconnect a;
+disconnect b;
drop table t1, t2, t3;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connect c,localhost,root,,;
+connect d,localhost,root,,;
SET SESSION STORAGE_ENGINE = InnoDB;
+connect e,localhost,root,,;
+connect f,localhost,root,,;
+connect g,localhost,root,,;
SET SESSION STORAGE_ENGINE = InnoDB;
+connect h,localhost,root,,;
+connect i,localhost,root,,;
+connect j,localhost,root,,;
SET SESSION STORAGE_ENGINE = InnoDB;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine = InnoDB;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine = InnoDB;
@@ -89,35 +125,65 @@ a b
3 1
8 6
12 1
+connection b;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
insert into t1 select * from t2;
+connection c;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
update t3 set b = (select b from t2 where a = d);
+connection d;
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
create table t4(a int not null, b int, primary key(a)) select * from t2;
+connection e;
set autocommit = 0;
insert into t5 (select * from t2 lock in share mode);
+connection f;
set autocommit = 0;
update t6 set e = (select b from t2 where a = d lock in share mode);
+connection g;
set autocommit = 0;
create table t7(a int not null, b int, primary key(a)) select * from t2 lock in share mode;
+connection h;
set autocommit = 0;
insert into t8 (select * from t2 for update);
+connection i;
set autocommit = 0;
update t9 set e = (select b from t2 where a = d for update);
+connection j;
set autocommit = 0;
create table t10(a int not null, b int, primary key(a)) select * from t2 for update;
+connection b;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection c;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection d;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection e;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection f;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection g;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection h;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection i;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection j;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection a;
commit;
+connection default;
+disconnect a;
+disconnect b;
+disconnect c;
+disconnect d;
+disconnect e;
+disconnect f;
+disconnect g;
+disconnect h;
+disconnect i;
+disconnect j;
drop table t1, t2, t3, t5, t6, t8, t9;
diff --git a/mysql-test/r/update.result b/mysql-test/r/update.result
index a0c35c6e0ca..f7a36c537f9 100644
--- a/mysql-test/r/update.result
+++ b/mysql-test/r/update.result
@@ -477,6 +477,8 @@ a quux
2 0.100000000000000000000000000000
3 NULL
DROP TABLE t1;
+connect con1,localhost,root,,test;
+connection con1;
set tmp_table_size=1024;
create table t1 (id int, a int, key idx(a));
create table t2 (id int unsigned not null auto_increment primary key, a int);
@@ -511,6 +513,8 @@ update t1 join t2 on (t1.a=t2.a) set t1.id=t2.id;
affected rows: 127
info: Rows matched: 128 Changed: 127 Warnings: 0
drop table t1,t2;
+connection default;
+disconnect con1;
DROP TABLE IF EXISTS t1;
DROP FUNCTION IF EXISTS f1;
CREATE FUNCTION f1() RETURNS INT RETURN f1();
diff --git a/mysql-test/r/user_limits.result b/mysql-test/r/user_limits.result
index 5ab98d1fc30..bbf73d7c617 100644
--- a/mysql-test/r/user_limits.result
+++ b/mysql-test/r/user_limits.result
@@ -9,18 +9,27 @@ flush privileges;
create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_queries_per_hour 2;
flush user_resources;
+connect mqph, localhost, mysqltest_1,,;
+connection mqph;
select * from t1;
i
select * from t1;
i
select * from t1;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_queries_per_hour' resource (current value: 2)
+connect mqph2, localhost, mysqltest_1,,;
+connection mqph2;
select * from t1;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_queries_per_hour' resource (current value: 2)
+connection default;
drop user mysqltest_1@localhost;
+disconnect mqph;
+disconnect mqph2;
create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_updates_per_hour 2;
flush user_resources;
+connect muph, localhost, mysqltest_1,,;
+connection muph;
select * from t1;
i
select * from t1;
@@ -33,43 +42,69 @@ delete from t1;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_updates_per_hour' resource (current value: 2)
select * from t1;
i
+connect muph2, localhost, mysqltest_1,,;
+connection muph2;
delete from t1;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_updates_per_hour' resource (current value: 2)
select * from t1;
i
+connection default;
drop user mysqltest_1@localhost;
+disconnect muph;
+disconnect muph2;
create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_connections_per_hour 2;
flush user_resources;
+connect mcph1, localhost, mysqltest_1,,;
+connection mcph1;
select * from t1;
i
+connect mcph2, localhost, mysqltest_1,,;
+connection mcph2;
select * from t1;
i
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect mcph3, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections_per_hour' resource (current value: 2)
select * from t1;
i
+disconnect mcph1;
+disconnect mcph2;
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect mcph3, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_connections_per_hour' resource (current value: 2)
+connection default;
drop user mysqltest_1@localhost;
flush privileges;
create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 2;
flush user_resources;
+connect muc1, localhost, mysqltest_1,,;
+connection muc1;
select * from t1;
i
+connect muc2, localhost, mysqltest_1,,;
+connection muc2;
select * from t1;
i
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muc3, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: 2)
+disconnect muc1;
+connect muc3, localhost, mysqltest_1,,;
select * from t1;
i
+connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
flush user_resources;
+connect muc4, localhost, mysqltest_1,,;
+connection muc4;
select * from t1;
i
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muc5, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: 3)
+connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections -1;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
@@ -79,7 +114,11 @@ show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' WITH MAX_USER_CONNECTIONS -1
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muc5, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: -1)
+disconnect muc2;
+disconnect muc3;
+disconnect muc4;
drop user mysqltest_1@localhost;
select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
@@ -93,20 +132,33 @@ select @@session.max_user_connections, @@global.max_user_connections;
create user mysqltest_1@localhost;
grant usage on *.* to mysqltest_1@localhost;
flush user_resources;
+connect muca1, localhost, mysqltest_1,,;
+connection muca1;
select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
2 2
+connect muca2, localhost, mysqltest_1,,;
+connection muca2;
select * from t1;
i
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muca3, localhost, mysqltest_1,,;
ERROR 42000: User mysqltest_1 already has more than 'max_user_connections' active connections
+connection default;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 3;
flush user_resources;
+connect muca3, localhost, mysqltest_1,,;
+connection muca3;
select @@session.max_user_connections, @@global.max_user_connections;
@@session.max_user_connections @@global.max_user_connections
3 2
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muca4, localhost, mysqltest_1,,;
ERROR 42000: User 'mysqltest_1' has exceeded the 'max_user_connections' resource (current value: 3)
+connection default;
+disconnect muca1;
+disconnect muca2;
+disconnect muca3;
set global max_user_connections= 0;
grant usage on *.* to mysqltest_1@localhost with max_user_connections 0;
set global max_user_connections=-1;
@@ -119,10 +171,18 @@ select @@global.max_user_connections;
@@global.max_user_connections
-1
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muca2, localhost, mysqltest_1,,;
ERROR 42000: User mysqltest_1 already has more than 'max_user_connections' active connections
+connect muca2, localhost, root,,;
+disconnect muca2;
+connection default;
set global max_user_connections=1;
+connect muca2, localhost, mysqltest_1,,;
connect(localhost,mysqltest_1,,test,MYSQL_PORT,MYSQL_SOCK);
+connect muca3, localhost, mysqltest_1,,;
ERROR 42000: User mysqltest_1 already has more than 'max_user_connections' active connections
+disconnect muca2;
+connection default;
drop user mysqltest_1@localhost;
drop table t1;
set global max_user_connections= @my_max_user_connections;
diff --git a/mysql-test/r/userstat-badlogin-4824.result b/mysql-test/r/userstat-badlogin-4824.result
index 8362e8d5239..6a38c2bd601 100644
--- a/mysql-test/r/userstat-badlogin-4824.result
+++ b/mysql-test/r/userstat-badlogin-4824.result
@@ -1,14 +1,19 @@
create user foo@localhost identified by 'foo';
flush user_statistics;
set global userstat=1;
+connect foo, localhost, foo, foo;
select 1;
1
1
+disconnect foo;
+connection default;
select user, bytes_received from information_schema.user_statistics where user = 'foo';
user bytes_received
foo 18
connect(localhost,foo,bar,test,MASTER_PORT,MASTER_SOCKET);
+connect foo, localhost, foo, bar;
ERROR 28000: Access denied for user 'foo'@'localhost' (using password: YES)
+connection default;
select user, bytes_received from information_schema.user_statistics where user = 'foo';
user bytes_received
foo 18
diff --git a/mysql-test/r/userstat.result b/mysql-test/r/userstat.result
index 5ce10d96643..351f69f3031 100644
--- a/mysql-test/r/userstat.result
+++ b/mysql-test/r/userstat.result
@@ -80,9 +80,11 @@ delete from t1 where a=3;
select * from t1 where a=999;
a b
drop table t1;
+connect ssl_con,localhost,root,,,,,SSL;
SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
+connection default;
create table t1 (a int, primary key (a), b int default 0) engine=innodb;
begin;
insert into t1 values(1,1);
@@ -132,6 +134,7 @@ Handler_write 7
select variable_value - @global_read_key as "handler_read_key" from information_schema.global_status where variable_name="handler_read_key";
handler_read_key
9
+disconnect ssl_con;
set @@global.userstat=0;
select * from information_schema.index_statistics;
TABLE_SCHEMA TABLE_NAME INDEX_NAME ROWS_READ
diff --git a/mysql-test/r/variables-notembedded.result b/mysql-test/r/variables-notembedded.result
index f8191345219..a8bf7ecc429 100644
--- a/mysql-test/r/variables-notembedded.result
+++ b/mysql-test/r/variables-notembedded.result
@@ -158,6 +158,7 @@ Warning 1708 The value of 'max_allowed_packet' should be no less than the value
SET GLOBAL net_buffer_length=4096;
Warnings:
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
+CONNECT con1,localhost,root,,test;
SHOW SESSION VARIABLES LIKE 'max_allowed_packet';
Variable_name Value
max_allowed_packet 2048
@@ -165,6 +166,8 @@ SHOW SESSION VARIABLES LIKE 'net_buffer_length';
Variable_name Value
net_buffer_length 4096
Got one of the listed errors
+connection default;
+disconnect con1;
SELECT LENGTH(a) FROM t1;
LENGTH(a)
SET GLOBAL max_allowed_packet=default;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index fef3e4a3e9e..a38cf57189c 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -822,7 +822,8 @@ set @@global.lc_time_names=fr_FR;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR en_US
-New connection
+connect con1,localhost,root,,;
+connection con1;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR fr_FR
@@ -830,7 +831,8 @@ set @@lc_time_names=ru_RU;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR ru_RU
-Returnung to default connection
+disconnect con1;
+connection default;
select @@global.lc_time_names, @@lc_time_names;
@@global.lc_time_names @@lc_time_names
fr_FR en_US
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 4a295762530..3fccd6e54c2 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -2912,17 +2912,24 @@ set GLOBAL sql_mode="";
set LOCAL sql_mode="";
CREATE DATABASE bug21261DB;
USE bug21261DB;
+connect root,localhost,root,,bug21261DB;
+connection root;
CREATE TABLE t1 (x INT);
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT x FROM t1;
GRANT INSERT, UPDATE ON v1 TO 'user21261'@'localhost';
GRANT INSERT, UPDATE ON t1 TO 'user21261'@'localhost';
CREATE TABLE t2 (y INT);
GRANT SELECT ON t2 TO 'user21261'@'localhost';
+connect user21261, localhost, user21261,, bug21261DB;
+connection user21261;
INSERT INTO v1 (x) VALUES (5);
UPDATE v1 SET x=1;
+connection root;
GRANT SELECT ON v1 TO 'user21261'@'localhost';
GRANT SELECT ON t1 TO 'user21261'@'localhost';
+connection user21261;
UPDATE v1,t2 SET x=1 WHERE x=y;
+connection root;
SELECT * FROM t1;
x
1
@@ -2931,7 +2938,10 @@ DROP USER 'user21261'@'localhost';
DROP VIEW v1;
DROP TABLE t1;
DROP DATABASE bug21261DB;
+connection default;
USE test;
+disconnect root;
+disconnect user21261;
set GLOBAL sql_mode=default;
set LOCAL sql_mode=default;
create table t1 (f1 datetime);
@@ -4787,32 +4797,36 @@ DROP TABLE t1, t2;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
DROP PROCEDURE IF EXISTS p1;
-# Connection default
+connect con2, localhost, root;
+connect con3, localhost, root;
+connection default;
CREATE VIEW v1 AS SELECT schema_name FROM information_schema.schemata;
CREATE TABLE t1 (str VARCHAR(50));
CREATE PROCEDURE p1() INSERT INTO t1 SELECT * FROM v1;
# CALL p1() so the view is merged.
CALL p1();
-# Connection 3
+connection con3;
LOCK TABLE t1 READ;
-# Connection default
+connection default;
# Try to CALL p1() again, this time it should block for t1.
# Sending:
CALL p1();
-# Connection 2
+connection con2;
# ... then try to drop the view. This should block.
# Sending:
DROP VIEW v1;
-# Connection 3
+connection con3;
# Now allow CALL p1() to complete
UNLOCK TABLES;
-# Connection default
+connection default;
# Reaping: CALL p1()
-# Connection 2
+connection con2;
# Reaping: DROP VIEW v1
-# Connection default
+connection default;
DROP PROCEDURE p1;
DROP TABLE t1;
+disconnect con2;
+disconnect con3;
#
# Bug#12626844: WRONG ERROR MESSAGE WHILE CREATING A VIEW ON A
# NON EXISTING DATABASE
diff --git a/mysql-test/r/view_debug.result b/mysql-test/r/view_debug.result
index 0aab5c5ac33..cfb70b5e74c 100644
--- a/mysql-test/r/view_debug.result
+++ b/mysql-test/r/view_debug.result
@@ -5,14 +5,19 @@ CREATE PROCEDURE proc() SELECT * FROM v2;
CREATE ALGORITHM = UNDEFINED VIEW v1 AS SELECT 1;
CREATE ALGORITHM = TEMPTABLE VIEW v2 AS SELECT 3 FROM v1;
DROP VIEW v1;
+connect con1,localhost,root,,test;
+connect con2,localhost,root,,test;
+connection con1;
CALL proc();
ERROR HY000: View 'test.v2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
SET DEBUG_SYNC= 'after_cached_view_opened SIGNAL oppp WAIT_FOR created';
CALL proc();
+connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR oppp';
SET DEBUG_SYNC= 'RESET';
CREATE ALGORITHM = TEMPTABLE VIEW v1 AS SELECT 2;
SET DEBUG_SYNC= 'now SIGNAL created';
+connection con1;
3
3
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/r/view_grant.result b/mysql-test/r/view_grant.result
index 525f9fbb5e1..948e88a1804 100644
--- a/mysql-test/r/view_grant.result
+++ b/mysql-test/r/view_grant.result
@@ -11,12 +11,16 @@ show grants for test@localhost;
Grants for test@localhost
GRANT USAGE ON *.* TO 'test'@'localhost'
drop user test@localhost;
+connect root,localhost,root,,test;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
create user mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
+connect user1,localhost,mysqltest_1,,test;
+connection user1;
create definer=root@localhost view v1 as select * from mysqltest.t1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
create view v1 as select * from mysqltest.t1;
@@ -28,13 +32,16 @@ create view mysqltest.v2 as select * from mysqltest.t1;
ERROR 42000: CREATE VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v2'
create view v2 as select * from mysqltest.t2;
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for table 't2'
+connection root;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
grant create view,drop,select on test.* to mysqltest_1@localhost;
+connection user1;
use test;
alter view v1 as select * from mysqltest.t1;
create or replace view v1 as select * from mysqltest.t1;
+connection root;
revoke all privileges on mysqltest.t1 from mysqltest_1@localhost;
revoke all privileges on test.* from mysqltest_1@localhost;
drop database mysqltest;
@@ -43,10 +50,12 @@ create database mysqltest;
create table mysqltest.t1 (a int, b int);
create view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
+connection user1;
select c from mysqltest.v1;
c
select d from mysqltest.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v1'
+connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
@@ -55,13 +64,16 @@ create table mysqltest.t1 (a int, b int);
create algorithm=temptable view mysqltest.v1 (c,d) as select a+1,b+1 from mysqltest.t1;
create user mysqltest_1@localhost;
grant select (c) on mysqltest.v1 to mysqltest_1@localhost;
+connection user1;
select c from mysqltest.v1;
c
select d from mysqltest.v1;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'd' in table 'v1'
+connection root;
revoke all privileges on mysqltest.v1 from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
@@ -76,6 +88,7 @@ grant select on mysqltest.v2 to mysqltest_1@localhost;
grant select on mysqltest.v3 to mysqltest_1@localhost;
grant select on mysqltest.v4 to mysqltest_1@localhost;
grant show view on mysqltest.v5 to mysqltest_1@localhost;
+connection user1;
select c from mysqltest.v1;
c
select c from mysqltest.v2;
@@ -114,7 +127,9 @@ explain select c from mysqltest.v5;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v5'
show create view mysqltest.v5;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v5'
+connection root;
grant select on mysqltest.v5 to mysqltest_1@localhost;
+connection user1;
show create view mysqltest.v5;
View Create View character_set_client collation_connection
v5 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v5` AS select (`mysqltest`.`t1`.`a` + 1) AS `c`,(`mysqltest`.`t1`.`b` + 1) AS `d` from `mysqltest`.`t1` latin1 latin1_swedish_ci
@@ -122,9 +137,11 @@ explain select c from mysqltest.v1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
show create view mysqltest.v1;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v1'
+connection root;
grant show view on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
revoke select on mysqltest.v5 from mysqltest_1@localhost;
+connection user1;
explain select c from mysqltest.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
@@ -145,7 +162,9 @@ show create view mysqltest.v4;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v4'
explain select c from mysqltest.v5;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for table 'v5'
+connection root;
grant show view on mysqltest.* to mysqltest_1@localhost;
+connection user1;
explain select c from mysqltest.v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
@@ -169,9 +188,11 @@ ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for unde
show create view mysqltest.v4;
View Create View character_set_client collation_connection
v4 CREATE ALGORITHM=TEMPTABLE DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest`.`v4` AS select (`mysqltest`.`t2`.`a` + 1) AS `c`,(`mysqltest`.`t2`.`b` + 1) AS `d` from `mysqltest`.`t2` latin1 latin1_swedish_ci
+connection root;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key(a));
insert into mysqltest.t1 values (10,2), (20,3), (30,4), (40,5), (50,10);
@@ -184,6 +205,7 @@ create user mysqltest_1@localhost;
grant update (a) on mysqltest.v2 to mysqltest_1@localhost;
grant update on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
+connection user1;
use mysqltest;
update t2,v1 set v1.a=v1.a+v1.c where t2.x=v1.c;
select * from t1;
@@ -226,9 +248,11 @@ ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table '
update v3 set a=a+c;
ERROR 42000: UPDATE command denied to user 'mysqltest_1'@'localhost' for table 'v3'
use test;
+connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key(a));
insert into mysqltest.t1 values (1,2), (2,3), (3,4), (4,5), (5,10);
@@ -239,6 +263,7 @@ create view mysqltest.v2 (a,c) as select a, b+1 from mysqltest.t1;
create user mysqltest_1@localhost;
grant delete on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
+connection user1;
use mysqltest;
delete from v1 where c < 4;
select * from t1;
@@ -256,9 +281,11 @@ ERROR 42000: DELETE command denied to user 'mysqltest_1'@'localhost' for table '
delete from v2 where c < 4;
ERROR 42000: DELETE command denied to user 'mysqltest_1'@'localhost' for table 'v2'
use test;
+connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int, primary key(a));
insert into mysqltest.t1 values (1,2), (2,3);
@@ -269,6 +296,7 @@ create view mysqltest.v2 (a,c) as select a, b from mysqltest.t1;
create user mysqltest_1@localhost;
grant insert on mysqltest.v1 to mysqltest_1@localhost;
grant select on mysqltest.* to mysqltest_1@localhost;
+connection user1;
use mysqltest;
insert into v1 values (5,6);
select * from t1;
@@ -288,9 +316,11 @@ ERROR 42000: INSERT command denied to user 'mysqltest_1'@'localhost' for table '
insert into v2 select x,y from t2;
ERROR 42000: INSERT command denied to user 'mysqltest_1'@'localhost' for table 'v2'
use test;
+connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create table mysqltest.t2 (a int, b int);
@@ -298,46 +328,62 @@ create user mysqltest_1@localhost;
grant update on mysqltest.t1 to mysqltest_1@localhost;
grant update(b) on mysqltest.t2 to mysqltest_1@localhost;
grant create view,update on test.* to mysqltest_1@localhost;
+connection user1;
create view v1 as select * from mysqltest.t1;
create view v2 as select b from mysqltest.t2;
create view mysqltest.v1 as select * from mysqltest.t1;
ERROR 42000: CREATE VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v1'
create view v3 as select a from mysqltest.t2;
ERROR 42000: ANY command denied to user 'mysqltest_1'@'localhost' for column 'a' in table 't2'
+connection root;
create table mysqltest.v3 (b int);
grant create view on mysqltest.v3 to mysqltest_1@localhost;
drop table mysqltest.v3;
+connection user1;
create view mysqltest.v3 as select b from mysqltest.t2;
+connection root;
grant create view, update on mysqltest.v3 to mysqltest_1@localhost;
drop view mysqltest.v3;
+connection user1;
create view mysqltest.v3 as select b from mysqltest.t2;
create view v4 as select b+1 from mysqltest.t2;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't2'
+connection root;
grant create view,update,select on test.* to mysqltest_1@localhost;
+connection user1;
create view v4 as select b+1 from mysqltest.t2;
ERROR 42000: SELECT command denied to user 'mysqltest_1'@'localhost' for column 'b' in table 't2'
+connection root;
grant update,select(b) on mysqltest.t2 to mysqltest_1@localhost;
+connection user1;
create view v4 as select b+1 from mysqltest.t2;
+connection root;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
drop view v1,v2,v4;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int);
create user mysqltest_1@localhost;
grant all privileges on mysqltest.* to mysqltest_1@localhost;
+connection user1;
use mysqltest;
create view v1 as select * from t1;
use test;
+connection root;
revoke all privileges on mysqltest.* from mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
create table mysqltest.t1 (a int, b int);
create user mysqltest_1@localhost;
grant select on mysqltest.t1 to mysqltest_1@localhost;
grant create view,select on test.* to mysqltest_1@localhost;
+connection user1;
create view v1 as select * from mysqltest.t1;
+connection root;
show create view v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqltest_1`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `mysqltest`.`t1`.`a` AS `a`,`mysqltest`.`t1`.`b` AS `b` from `mysqltest`.`t1` latin1 latin1_swedish_ci
@@ -351,6 +397,7 @@ REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop view v1;
drop database mysqltest;
+connection root;
create database mysqltest;
use mysqltest;
create table t1 (a int);
@@ -370,6 +417,7 @@ grant select on v2 to mysqltest_1@localhost;
grant select on v3 to mysqltest_1@localhost;
grant select on v4 to mysqltest_1@localhost;
grant select on v5 to mysqltest_1@localhost;
+connection user1;
use mysqltest;
select * from v1;
f2()
@@ -384,6 +432,7 @@ ERROR HY000: View 'mysqltest.v4' references invalid table(s) or column(s) or fun
select * from v5;
ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
use test;
+connection root;
drop view v1, v2, v3, v4, v5;
drop function f2;
drop table t1, t2;
@@ -391,6 +440,7 @@ use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
use mysqltest;
create table t1 (a int);
@@ -403,12 +453,14 @@ create user mysqltest_1@localhost;
grant select on t1 to mysqltest_1@localhost;
grant execute on function f2 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
+connection user1;
use mysqltest;
create algorithm=TEMPTABLE view v1 as select f2() from t1;
create algorithm=MERGE view v2 as select f2() from t1;
create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select f2() from t1;
create algorithm=MERGE SQL SECURITY INVOKER view v4 as select f2() from t1;
use test;
+connection root;
create view v5 as select * from v1;
revoke execute on function f2 from mysqltest_1@localhost;
select * from v1;
@@ -430,6 +482,7 @@ use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
use mysqltest;
create table t1 (a int);
@@ -440,6 +493,7 @@ grant select on t1 to mysqltest_1@localhost;
grant select on v1 to mysqltest_1@localhost;
grant create view on mysqltest.* to mysqltest_1@localhost;
drop table v1;
+connection user1;
use mysqltest;
create algorithm=TEMPTABLE view v1 as select *, a as b from t1;
create algorithm=MERGE view v2 as select *, a as b from t1;
@@ -447,6 +501,7 @@ create algorithm=TEMPTABLE SQL SECURITY INVOKER view v3 as select *, a as b from
create algorithm=MERGE SQL SECURITY INVOKER view v4 as select *, a as b from t1;
create view v5 as select * from v1;
use test;
+connection root;
revoke select on t1 from mysqltest_1@localhost;
select * from v1;
ERROR HY000: View 'mysqltest.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
@@ -465,6 +520,7 @@ use test;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
drop user mysqltest_1@localhost;
drop database mysqltest;
+connection root;
create database mysqltest;
use mysqltest;
create table t1 (a int);
@@ -480,6 +536,7 @@ grant select on v2 to mysqltest_1@localhost;
grant select on v3 to mysqltest_1@localhost;
grant select on v4 to mysqltest_1@localhost;
grant select on v5 to mysqltest_1@localhost;
+connection user1;
use mysqltest;
select * from v1;
a b
@@ -494,6 +551,7 @@ ERROR HY000: View 'mysqltest.v4' references invalid table(s) or column(s) or fun
select * from v5;
ERROR HY000: View 'mysqltest.v5' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
use test;
+connection root;
drop view v1, v2, v3, v4, v5;
drop table t1;
use test;
@@ -507,6 +565,8 @@ delete from mysql.user where user='';
flush privileges;
create user 'test14256'@'%';
grant all on test.* to 'test14256'@'%';
+connect test14256,localhost,test14256,,test;
+connection test14256;
use test;
create view v1 as select 42;
show create view v1;
@@ -525,10 +585,13 @@ drop view v1;
select @v1def1, @v1def2, @v1def1=@v1def2;
@v1def1 @v1def2 @v1def1=@v1def2
test14256@% test14256@% 1
+connection root;
+disconnect test14256;
drop user test14256;
insert into mysql.user select * from t1;
flush privileges;
drop table t1;
+connection root;
create database mysqltest;
use mysqltest;
CREATE TABLE t1 (i INT);
@@ -538,15 +601,20 @@ View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`i` AS `i` from `t1` latin1 latin1_swedish_ci
create user mysqltest_1@localhost;
GRANT SELECT, LOCK TABLES ON mysqltest.* TO mysqltest_1@localhost;
+connection user1;
use mysqltest;
LOCK TABLES v1 READ;
SHOW CREATE TABLE v1;
ERROR 42000: SHOW VIEW command denied to user 'mysqltest_1'@'localhost' for table 'v1'
UNLOCK TABLES;
use test;
+connection root;
use test;
drop user mysqltest_1@localhost;
drop database mysqltest;
+disconnect user1;
+disconnect root;
+connection default;
create definer=some_user@`` sql security invoker view v1 as select 1;
Warnings:
Note 1449 The user specified as a definer ('some_user'@'%') does not exist
@@ -579,6 +647,8 @@ GRANT UPDATE ON mysqltest1.v_tu TO readonly@localhost;
GRANT UPDATE,SELECT ON mysqltest1.v_tus TO readonly@localhost;
GRANT DELETE ON mysqltest1.v_td TO readonly@localhost;
GRANT DELETE,SELECT ON mysqltest1.v_tds TO readonly@localhost;
+connect n1,localhost,readonly,,;
+connection n1;
SELECT * FROM mysqltest1.v_t1;
ERROR HY000: View 'mysqltest1.v_t1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
INSERT INTO mysqltest1.v_t1 VALUES(4);
@@ -621,6 +691,8 @@ DELETE FROM mysqltest1.v_td WHERE x= 200;
ERROR 42000: SELECT command denied to user 'readonly'@'localhost' for column 'x' in table 'v_td'
DELETE FROM mysqltest1.v_tds WHERE x= 200;
DELETE FROM mysqltest1.v_td;
+connection default;
+disconnect n1;
DROP VIEW mysqltest1.v_tds;
DROP VIEW mysqltest1.v_td;
DROP VIEW mysqltest1.v_tus;
@@ -648,6 +720,7 @@ DROP TABLE t1;
USE test;
CREATE USER mysqltest_db1@localhost identified by 'PWD';
GRANT ALL ON mysqltest_db1.* TO mysqltest_db1@localhost WITH GRANT OPTION;
+connect session1,localhost,mysqltest_db1,PWD,test;
CREATE SCHEMA mysqltest_db1 ;
USE mysqltest_db1 ;
CREATE TABLE t1 (f1 INTEGER);
@@ -669,6 +742,8 @@ CREATE VIEW view3 AS
SELECT * FROM view2;
SELECT * from view3;
f1
+connection default;
+disconnect session1;
DROP VIEW mysqltest_db1.view3;
DROP VIEW mysqltest_db1.view2;
DROP VIEW mysqltest_db1.view1;
@@ -708,6 +783,7 @@ END|
CREATE SQL SECURITY DEFINER VIEW v3 AS SELECT f2() AS cu;
CREATE USER mysqltest_u1@localhost;
GRANT ALL ON test.* TO mysqltest_u1@localhost;
+connect conn1, localhost, mysqltest_u1,,;
The following tests should all return 1.
@@ -733,6 +809,8 @@ cu = 'root@localhost'
SELECT cu = 'root@localhost' FROM v3;
cu = 'root@localhost'
1
+disconnect conn1;
+connection default;
DROP VIEW v3;
DROP FUNCTION f2;
DROP PROCEDURE p1;
@@ -740,6 +818,8 @@ DROP FUNCTION f1;
DROP VIEW v2;
DROP VIEW v1;
DROP USER mysqltest_u1@localhost;
+connect root,localhost,root,,;
+connection root;
CREATE DATABASE db17254;
USE db17254;
CREATE TABLE t1 (f1 INT);
@@ -749,16 +829,24 @@ GRANT SELECT ON db17254.* TO def_17254@localhost;
CREATE USER inv_17254@localhost;
GRANT SELECT ON db17254.t1 TO inv_17254@localhost;
GRANT CREATE VIEW ON db17254.* TO def_17254@localhost;
+connect def,localhost,def_17254,,db17254;
+connection def;
CREATE VIEW v1 AS SELECT * FROM t1;
+connection root;
DROP USER def_17254@localhost;
+connect inv,localhost,inv_17254,,db17254;
+connection inv;
for a user
SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'inv_17254'@'localhost' for table 'v1'
+connection root;
for a superuser
SELECT * FROM v1;
ERROR HY000: The user specified as a definer ('def_17254'@'localhost') does not exist
DROP USER inv_17254@localhost;
DROP DATABASE db17254;
+disconnect def;
+disconnect inv;
DROP DATABASE IF EXISTS mysqltest_db1;
DROP DATABASE IF EXISTS mysqltest_db2;
DROP USER mysqltest_u1;
@@ -769,6 +857,7 @@ CREATE DATABASE mysqltest_db1;
CREATE DATABASE mysqltest_db2;
GRANT ALL ON mysqltest_db1.* TO mysqltest_u1@localhost WITH GRANT OPTION;
GRANT ALL ON mysqltest_db2.* TO mysqltest_u2@localhost;
+connect conn1, localhost, mysqltest_u1, , mysqltest_db1;
CREATE TABLE t1 (i INT);
INSERT INTO t1 VALUES (1);
CREATE VIEW v1 AS SELECT i FROM t1 WHERE 1 IN (SELECT * FROM t1);
@@ -776,6 +865,7 @@ CREATE TABLE t2 (s CHAR(7));
INSERT INTO t2 VALUES ('public');
GRANT SELECT ON v1 TO mysqltest_u2@localhost;
GRANT SELECT ON t2 TO mysqltest_u2@localhost;
+connect conn2, localhost, mysqltest_u2, , mysqltest_db2;
SELECT * FROM mysqltest_db1.v1, mysqltest_db1.t2;
i s
1 public
@@ -787,20 +877,26 @@ PREPARE stmt2 FROM "SELECT * FROM mysqltest_db1.v1, mysqltest_db1.t2";
EXECUTE stmt2;
i s
1 public
+connection conn1;
REVOKE SELECT ON t2 FROM mysqltest_u2@localhost;
UPDATE t2 SET s = 'private' WHERE s = 'public';
+connection conn2;
SELECT * FROM mysqltest_db1.v1, mysqltest_db1.t2;
ERROR 42000: SELECT command denied to user 'mysqltest_u2'@'localhost' for table 't2'
EXECUTE stmt1;
ERROR 42000: SELECT command denied to user 'mysqltest_u2'@'localhost' for table 't2'
EXECUTE stmt2;
ERROR 42000: SELECT command denied to user 'mysqltest_u2'@'localhost' for table 't2'
+disconnect conn2;
+disconnect conn1;
+connection default;
REVOKE ALL ON mysqltest_db1.* FROM mysqltest_u1@localhost;
REVOKE ALL ON mysqltest_db2.* FROM mysqltest_u2@localhost;
DROP DATABASE mysqltest_db1;
DROP DATABASE mysqltest_db2;
DROP USER mysqltest_u1@localhost;
DROP USER mysqltest_u2@localhost;
+connection root;
CREATE DATABASE db26813;
USE db26813;
CREATE TABLE t1(f1 INT, f2 INT);
@@ -812,20 +908,25 @@ GRANT DROP ON db26813.v1 TO u26813@localhost;
GRANT CREATE VIEW ON db26813.v2 TO u26813@localhost;
GRANT DROP, CREATE VIEW ON db26813.v3 TO u26813@localhost;
GRANT SELECT ON db26813.t1 TO u26813@localhost;
+connect u1,localhost,u26813,,db26813;
+connection u1;
ALTER VIEW v1 AS SELECT f2 FROM t1;
ERROR 42000: CREATE VIEW command denied to user 'u26813'@'localhost' for table 'v1'
ALTER VIEW v2 AS SELECT f2 FROM t1;
ERROR 42000: DROP command denied to user 'u26813'@'localhost' for table 'v2'
ALTER VIEW v3 AS SELECT f2 FROM t1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection root;
SHOW CREATE VIEW v3;
View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
DROP USER u26813@localhost;
DROP DATABASE db26813;
+disconnect u1;
#
# Bug#29908 A user can gain additional access through the ALTER VIEW.
#
+connection root;
CREATE DATABASE mysqltest_29908;
USE mysqltest_29908;
CREATE TABLE t1(f1 INT, f2 INT);
@@ -840,6 +941,7 @@ CREATE USER u29908_2@localhost;
GRANT SELECT, DROP, CREATE VIEW ON mysqltest_29908.v1 TO u29908_2@localhost;
GRANT SELECT, DROP, CREATE VIEW, SHOW VIEW ON mysqltest_29908.v2 TO u29908_2@localhost;
GRANT SELECT ON mysqltest_29908.t1 TO u29908_2@localhost;
+connect u2,localhost,u29908_2,,mysqltest_29908;
ALTER VIEW v1 AS SELECT f2 FROM t1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
ALTER VIEW v2 AS SELECT f2 FROM t1;
@@ -847,6 +949,7 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
+connect u1,localhost,u29908_1,,mysqltest_29908;
ALTER VIEW v1 AS SELECT f2 FROM t1;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@@ -855,6 +958,7 @@ ALTER VIEW v2 AS SELECT f2 FROM t1;
SHOW CREATE VIEW v2;
View Create View character_set_client collation_connection
v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKER VIEW `v2` AS select `t1`.`f2` AS `f2` from `t1` latin1 latin1_swedish_ci
+connection root;
ALTER VIEW v1 AS SELECT f1 FROM t1;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@@ -866,6 +970,8 @@ v2 CREATE ALGORITHM=UNDEFINED DEFINER=`u29908_1`@`localhost` SQL SECURITY INVOKE
DROP USER u29908_1@localhost;
DROP USER u29908_2@localhost;
DROP DATABASE mysqltest_29908;
+disconnect u1;
+disconnect u2;
#######################################################################
DROP DATABASE IF EXISTS mysqltest1;
DROP DATABASE IF EXISTS mysqltest2;
@@ -885,8 +991,7 @@ GRANT INSERT ON mysqltest1.t2 TO mysqltest_u1@localhost;
GRANT SELECT, UPDATE ON mysqltest1.t3 TO mysqltest_u1@localhost;
GRANT SELECT, DELETE ON mysqltest1.t4 TO mysqltest_u1@localhost;
GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u1@localhost;
-
----> connection: bug24040_con
+connect bug24040_con,localhost,mysqltest_u1,,mysqltest2;
SELECT * FROM mysqltest1.t1;
c1
11
@@ -927,8 +1032,7 @@ CREATE VIEW v41 AS SELECT c4, c1 FROM mysqltest1.t4, mysqltest1.t1;
CREATE VIEW v42 AS SELECT c4, c2 FROM mysqltest1.t4, mysqltest1.t2;
ERROR 42000: create view command denied to user 'mysqltest_u1'@'localhost' for column 'c2' in table 'v42'
CREATE VIEW v43 AS SELECT c4, c3 FROM mysqltest1.t4, mysqltest1.t3;
-
----> connection: default
+connection default;
SELECT * FROM mysqltest1.t1;
c1
11
@@ -953,6 +1057,7 @@ SELECT * FROM mysqltest1.t4;
c4
41
42
+disconnect bug24040_con;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
DROP USER mysqltest_u1@localhost;
@@ -963,6 +1068,8 @@ CREATE VIEW v1 AS SELECT f1, f2 FROM t1;
CREATE USER foo;
GRANT SELECT (f1) ON t1 TO foo;
GRANT SELECT (f1) ON v1 TO foo;
+connect addconfoo, localhost, foo,,;
+connection addconfoo;
USE db1;
SELECT f1 FROM t1;
f1
@@ -976,6 +1083,9 @@ SELECT f2 FROM v1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'f2' in table 'v1'
SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'v1'
+connection default;
+disconnect root;
+disconnect addconfoo;
USE test;
REVOKE SELECT (f1) ON db1.t1 FROM foo;
REVOKE SELECT (f1) ON db1.v1 FROM foo;
@@ -983,8 +1093,11 @@ DROP USER foo;
DROP VIEW db1.v1;
DROP TABLE db1.t1;
DROP DATABASE db1;
+connection default;
Bug #11765687/#58677:
No privilege on table/view, but can know #rows / underlying table's name
+connect root,localhost,root,,test;
+connection root;
create database mysqltest1;
create table mysqltest1.t1 (i int);
create table mysqltest1.t2 (j int);
@@ -1008,6 +1121,8 @@ create user pjotr@localhost;
create user quintessa@localhost;
grant all privileges on mysqltest1.* to alice@localhost with grant option;
... as alice
+connect test11765687,localhost,alice,,mysqltest1;
+connection test11765687;
create view v1 as select * from t1;
create view v2 as select * from v1, t2;
create view v3 as select k from t3;
@@ -1051,28 +1166,43 @@ grant select on mysqltest1.t1 to pjotr@localhost;
grant select on mysqltest1.t2 to pjotr@localhost;
grant select, show view on mysqltest1.v2 to pjotr@localhost;
grant select, show view on mysqltest1.v1 to quintessa@localhost;
+disconnect test11765687;
... as bob
+connect test11765687,localhost,bob,,mysqltest1;
+connection test11765687;
select * from v1;
i
explain select * from v1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as cecil
+connect test11765687,localhost,cecil,,mysqltest1;
+connection test11765687;
select * from v1;
ERROR 42000: SELECT command denied to user 'cecil'@'localhost' for table 'v1'
explain select * from v1;
ERROR 42000: SELECT command denied to user 'cecil'@'localhost' for table 'v1'
+disconnect test11765687;
... as dan
+connect test11765687,localhost,dan,,mysqltest1;
+connection test11765687;
select * from v1;
i
explain select * from v1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
+disconnect test11765687;
... as eugene
+connect test11765687,localhost,eugene,,mysqltest1;
+connection test11765687;
select * from v1;
i
explain select * from v1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as fiona
+connect test11765687,localhost,fiona,,mysqltest1;
+connection test11765687;
select * from v2;
i j
show create view v2;
@@ -1086,14 +1216,20 @@ explain select * from t2;
ERROR 42000: SELECT command denied to user 'fiona'@'localhost' for table 't2'
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as greg
+connect test11765687,localhost,greg,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v1;
ERROR 42000: SELECT command denied to user 'greg'@'localhost' for table 'v1'
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as han
+connect test11765687,localhost,han,,mysqltest1;
+connection test11765687;
select * from t3;
ERROR 42000: SELECT command denied to user 'han'@'localhost' for table 't3'
explain select * from t3;
@@ -1108,54 +1244,83 @@ k
explain select * from v3;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 system NULL NULL NULL NULL 0 const row not found
+disconnect test11765687;
... as inga
+connect test11765687,localhost,inga,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as jamie
+connect test11765687,localhost,jamie,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as karl
+connect test11765687,localhost,karl,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as lena
+connect test11765687,localhost,lena,,mysqltest1;
+connection test11765687;
select * from v2;
ERROR 42000: SELECT command denied to user 'lena'@'localhost' for table 'v2'
explain select * from v2;
ERROR 42000: SELECT command denied to user 'lena'@'localhost' for table 'v2'
+disconnect test11765687;
... as mhairi
+connect test11765687,localhost,mhairi,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 system NULL NULL NULL NULL 0 const row not found
1 SIMPLE t2 system NULL NULL NULL NULL 0 const row not found
+disconnect test11765687;
... as noam
+connect test11765687,localhost,noam,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as olga
+connect test11765687,localhost,olga,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as pjotr
+connect test11765687,localhost,pjotr,,mysqltest1;
+connection test11765687;
select * from v2;
i j
explain select * from v2;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as quintessa
+connect test11765687,localhost,quintessa,,mysqltest1;
+connection test11765687;
select * from v1;
i
explain select * from v1;
ERROR HY000: ANALYZE/EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
+disconnect test11765687;
... as root again at last: clean-up time!
+connection root;
drop user alice@localhost;
drop user bob@localhost;
drop user cecil@localhost;
@@ -1174,9 +1339,12 @@ drop user olga@localhost;
drop user pjotr@localhost;
drop user quintessa@localhost;
drop database mysqltest1;
+disconnect root;
+connection default;
select * from information_schema.table_privileges;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME PRIVILEGE_TYPE IS_GRANTABLE
End of 5.0 tests.
+connection default;
DROP VIEW IF EXISTS v1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (i INT);
@@ -1221,12 +1389,15 @@ INSERT INTO t2 VALUES (1), (2);
GRANT CREATE VIEW ON mysqltest1.* TO mysqluser1@localhost;
GRANT SELECT ON t1 TO mysqluser1@localhost;
GRANT INSERT ON t2 TO mysqluser1@localhost;
+connect connection1, localhost, mysqluser1, , mysqltest1;
This would lead to failed assertion.
CREATE VIEW v1 AS SELECT a, b FROM t1, t2;
SELECT * FROM v1;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
SELECT b FROM v1;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
+disconnect connection1;
+connection default;
DROP TABLE t1, t2;
DROP VIEW v1;
DROP DATABASE mysqltest1;
@@ -1241,10 +1412,13 @@ CREATE TABLE t2 ( a INT, b INT );
CREATE VIEW v1 AS SELECT a, b FROM t1;
GRANT SELECT( a ) ON v1 TO mysqluser1@localhost;
GRANT UPDATE( b ) ON t2 TO mysqluser1@localhost;
+connect connection1, localhost, mysqluser1, , test;
SELECT * FROM mysqltest1.v1;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
CREATE VIEW v1 AS SELECT * FROM mysqltest1.t2;
ERROR 42000: ANY command denied to user 'mysqluser1'@'localhost' for table 't2'
+disconnect connection1;
+connection default;
DROP TABLE t1, t2;
DROP VIEW v1;
DROP DATABASE mysqltest1;
@@ -1255,19 +1429,27 @@ USE mysqltest1;
CREATE VIEW v1 AS SELECT * FROM information_schema.tables LIMIT 1;
CREATE ALGORITHM = TEMPTABLE VIEW v2 AS SELECT 1 AS A;
CREATE VIEW test.v3 AS SELECT 1 AS a;
+connection default;
GRANT SELECT ON mysqltest1.* to mysqluser1@localhost;
GRANT ALL ON test.* TO mysqluser1@localhost;
+connect connection1, localhost, mysqluser1, , test;
PREPARE stmt_v1 FROM "SELECT * FROM mysqltest1.v1";
PREPARE stmt_v2 FROM "SELECT * FROM mysqltest1.v2";
+connection default;
REVOKE SELECT ON mysqltest1.* FROM mysqluser1@localhost;
+connection connection1;
EXECUTE stmt_v1;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v1'
EXECUTE stmt_v2;
ERROR 42000: SELECT command denied to user 'mysqluser1'@'localhost' for table 'v2'
+disconnect connection1;
+connect connection2, localhost, mysqluser1,,;
PREPARE stmt FROM "SELECT a FROM v3";
EXECUTE stmt;
a
1
+disconnect connection2;
+connection default;
DROP VIEW v1, v2;
DROP DATABASE mysqltest1;
DROP VIEW test.v3;
@@ -1303,6 +1485,7 @@ GRANT SELECT, SHOW VIEW ON v_t2 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_f1 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_v1 TO mysqluser1@localhost;
GRANT SELECT, SHOW VIEW ON v_v2 TO mysqluser1@localhost;
+connect connection1, localhost, mysqluser1,, mysqltest2;
CREATE VIEW v_mysqluser1_t1 AS SELECT * FROM mysqltest1.t1;
CREATE VIEW v_mysqluser1_t2 AS SELECT * FROM mysqltest1.t2;
CREATE VIEW v_mysqluser1_f1 AS SELECT mysqltest1.f1() AS a;
@@ -1338,10 +1521,12 @@ v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL
SHOW CREATE VIEW v_mysqluser1_v2;
View Create View character_set_client collation_connection
v_mysqluser1_v2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2` latin1 latin1_swedish_ci
+connection default;
REVOKE SELECT ON TABLE t1 FROM mysqluser1@localhost;
REVOKE SELECT (a) ON TABLE t2 FROM mysqluser1@localhost;
REVOKE EXECUTE ON FUNCTION f1 FROM mysqluser1@localhost;
REVOKE SELECT ON TABLE v1 FROM mysqluser1@localhost;
+connection connection1;
SHOW CREATE VIEW mysqltest1.v_t1;
View Create View character_set_client collation_connection
v_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
@@ -1372,12 +1557,14 @@ v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL
SHOW CREATE VIEW v_mysqluser1_v2;
View Create View character_set_client collation_connection
v_mysqluser1_v2 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v2` AS select `v2`.`a` AS `a`,`v2`.`b` AS `b` from `mysqltest1`.`v2` latin1 latin1_swedish_ci
+connection default;
# Testing the case when the views reference missing objects.
# Obviously, there are no privileges to check for, so we
# need only each object type once.
DROP TABLE t1;
DROP FUNCTION f1;
DROP VIEW v1;
+connection connection1;
SHOW CREATE VIEW mysqltest1.v_t1;
View Create View character_set_client collation_connection
v_t1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `mysqltest1`.`v_t1` AS select `mysqltest1`.`t1`.`a` AS `a` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
@@ -1408,9 +1595,11 @@ View Create View character_set_client collation_connection
v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+connection default;
REVOKE SHOW VIEW ON v_t1 FROM mysqluser1@localhost;
REVOKE SHOW VIEW ON v_f1 FROM mysqluser1@localhost;
REVOKE SHOW VIEW ON v_v1 FROM mysqluser1@localhost;
+connection connection1;
SHOW CREATE VIEW mysqltest1.v_t1;
ERROR 42000: SHOW VIEW command denied to user 'mysqluser1'@'localhost' for table 'v_t1'
SHOW CREATE VIEW mysqltest1.v_f1;
@@ -1432,6 +1621,8 @@ View Create View character_set_client collation_connection
v_mysqluser1_v1 CREATE ALGORITHM=UNDEFINED DEFINER=`mysqluser1`@`localhost` SQL SECURITY DEFINER VIEW `v_mysqluser1_v1` AS select `v1`.`a` AS `a` from `mysqltest1`.`v1` latin1 latin1_swedish_ci
Warnings:
Warning 1356 View 'mysqltest2.v_mysqluser1_v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+disconnect connection1;
+connection default;
DROP USER mysqluser1@localhost;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
@@ -1460,10 +1651,13 @@ CREATE USER mysqluser1;
GRANT SELECT ON TABLE t1 TO mysqluser1;
GRANT SELECT, SHOW VIEW ON TABLE v1 TO mysqluser1;
GRANT SELECT, SHOW VIEW ON TABLE v2 TO mysqluser1;
+connect mysqluser1, localhost, mysqluser1,,mysqltest1;
SELECT a FROM v1;
a
SELECT a FROM v2;
a
+connection default;
+disconnect mysqluser1;
DROP USER mysqluser1;
DROP DATABASE mysqltest1;
USE test;
@@ -1502,12 +1696,10 @@ GRANT SELECT ON t1 TO 'mysqluser1'@'%';
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser1'@'%';
-#
-# Connection 'mysqluser1'.
+connect mysqluser1, localhost, mysqluser1,,mysqltest1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
-#
-# Connection 'default'.
+connection default;
CREATE USER 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser2'@'%';
@@ -1515,8 +1707,7 @@ GRANT SELECT ON t2 TO 'mysqluser2'@'%';
GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser2'@'%';
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
-#
-# Connection 'mysqluser2'.
+connect mysqluser2, localhost, mysqluser2,,mysqltest1;
# The below statement should succeed thanks to suid nature of v2_uses_t1.
SELECT * FROM v2_uses_t1;
i
@@ -1526,8 +1717,7 @@ SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# 2) INVOKER-security view uses INVOKER-security view.
-#
-# Connection 'default'.
+connection default;
DROP VIEW v2_uses_t1, v2_uses_t2;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
@@ -1535,16 +1725,14 @@ GRANT SELECT ON v2_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser2'@'%';
-#
-# Connection 'mysqluser1'.
+connection mysqluser1;
# For both versions of 'v2' 'mysqluser1' privileges should be used.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
-#
-# Connection 'mysqluser2'.
+connection mysqluser2;
# And now for both versions of 'v2' 'mysqluser2' privileges should
# be used.
SELECT * FROM v2_uses_t1;
@@ -1554,21 +1742,17 @@ j
2
#
# 3) INVOKER-security view uses DEFINER-security view.
-#
-# Connection 'default'.
+connection default;
DROP VIEW v1_uses_t1, v1_uses_t2;
# To be able create 'v1_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
-#
-# Connection 'mysqluser1'.
+connection mysqluser1;
CREATE SQL SECURITY DEFINER VIEW v1_uses_t1 AS SELECT * FROM t1;
CREATE SQL SECURITY DEFINER VIEW v1_uses_t2 AS SELECT * FROM t2;
-#
-# Connection 'default'.
+connection default;
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
-#
-# Connection 'mysqluser2'.
+connection mysqluser2;
# Due to suid nature of v1_uses_t1 and v1_uses_t2 the first
# select should succeed and the second select should fail.
SELECT * FROM v2_uses_t1;
@@ -1578,27 +1762,26 @@ SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
#
# 4) DEFINER-security view uses DEFINER-security view.
-#
-# Connection 'default'.
+connection default;
DROP VIEW v2_uses_t1, v2_uses_t2;
# To be able create 'v2_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
-#
-# Connection 'mysqluser2'.
+connection mysqluser2;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
-#
-# Connection 'default'.
+connection default;
# Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
-#
-# Connection 'mysqluser2'.
+connection mysqluser2;
# Again privileges of creator of innermost views should apply.
SELECT * FROM v2_uses_t1;
i
1
SELECT * FROM v2_uses_t2;
ERROR HY000: View 'mysqltest1.v2_uses_t2' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
+disconnect mysqluser1;
+disconnect mysqluser2;
+connection default;
USE test;
DROP DATABASE mysqltest1;
DROP USER 'mysqluser1'@'%';
@@ -1656,8 +1839,7 @@ where t2.id = v1.id;
create sql security invoker view v42 as
select v2.id as id, v2.val as val from mysqltest2.t2 as t2, mysqltest2.v2_merge as v2
where t2.id = v2.id;
-#
-# Connect as user_11766767
+connect conn_11766767, localhost, user_11766767,,;
#
# A) Check how we handle privilege checking in multi-update for
# directly used views.
@@ -1748,7 +1930,8 @@ update mysqltest1.t11 as t11, mysqltest2.v42 as v4 set v4.val= 'test20'
#
# Clean-up.
#
-# Switching to connection 'default'.
+disconnect conn_11766767;
+connection default;
drop user user_11766767;
drop database mysqltest1;
drop database mysqltest2;
diff --git a/mysql-test/r/wait_timeout.result b/mysql-test/r/wait_timeout.result
index adb7d6bafd9..aa145ecf39b 100644
--- a/mysql-test/r/wait_timeout.result
+++ b/mysql-test/r/wait_timeout.result
@@ -1,6 +1,8 @@
SET @@global.wait_timeout= 2;
disconnect default;
+connect wait_con,localhost,root,,test,,;
connection wait_con;
+connect default,localhost,root,,test,,;
connection default;
--disable_reconnect;
SELECT 1;
@@ -14,14 +16,15 @@ Got one of the listed errors
SELECT 3;
3
3
-disconnection default;
+disconnect default;
connection wait_con;
-connection con1;
+connect con1,127.0.0.1,root,,test,$MASTER_MYPORT,;
--disable_reconnect;
SELECT 1;
1
1
connection wait_con;
+disconnect wait_con;
connection con1;
SELECT 2;
Got one of the listed errors
@@ -30,4 +33,5 @@ SELECT 3;
3
3
SET @@global.wait_timeout= <start_value>;
-disconnection con1;
+disconnect con1;
+connect default,localhost,root,,test,,;
diff --git a/mysql-test/r/xa.result b/mysql-test/r/xa.result
index 6c242d950ab..de1d507bd4b 100644
--- a/mysql-test/r/xa.result
+++ b/mysql-test/r/xa.result
@@ -28,6 +28,8 @@ begin;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
create table t2 (a int);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+connect con1,localhost,root,,;
+connection con1;
xa start 'testa','testb';
ERROR XAE08: XAER_DUPID: The XID already exists
xa start 'testa','testb', 123;
@@ -41,6 +43,7 @@ ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction
xa recover;
formatID gtrid_length bqual_length data
11 5 5 testb 0@P`
+connection default;
xa prepare 'testa','testb';
xa recover;
formatID gtrid_length bqual_length data
@@ -54,16 +57,24 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
select * from t1;
a
20
+disconnect con1;
+connection default;
drop table t1;
drop table if exists t1;
create table t1(a int, b int, c varchar(20), primary key(a)) engine = innodb;
insert into t1 values(1, 1, 'a');
insert into t1 values(2, 2, 'b');
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
xa start 'a','b';
update t1 set c = 'aa' where a = 1;
+connection con2;
xa start 'a','c';
update t1 set c = 'bb' where a = 2;
+connection con1;
update t1 set c = 'bb' where a = 2;
+connection con2;
update t1 set c = 'aa' where a = 1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select count(*) from t1;
@@ -72,7 +83,13 @@ count(*)
xa end 'a','c';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
xa rollback 'a','c';
+disconnect con2;
+connect con3,localhost,root,,;
+connection con3;
xa start 'a','c';
+disconnect con1;
+disconnect con3;
+connection default;
drop table t1;
#
# BUG#51342 - more xid crashing
@@ -108,20 +125,28 @@ xa prepare 'a';
xa commit 'a';
CREATE TABLE t1(a INT, KEY(a)) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1),(2);
+connect con1,localhost,root,,;
BEGIN;
UPDATE t1 SET a=3 WHERE a=1;
+connection default;
BEGIN;
UPDATE t1 SET a=4 WHERE a=2;
+connection con1;
UPDATE t1 SET a=5 WHERE a=2;
+connection default;
UPDATE t1 SET a=5 WHERE a=1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ROLLBACK;
+connection con1;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=3 WHERE a=1;
+connection default;
XA START 'xid1';
UPDATE t1 SET a=4 WHERE a=2;
+connection con1;
UPDATE t1 SET a=5 WHERE a=2;
+connection default;
UPDATE t1 SET a=5 WHERE a=1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA END 'xid1';
@@ -130,6 +155,7 @@ XA ROLLBACK 'xid1';
XA START 'xid1';
XA END 'xid1';
XA ROLLBACK 'xid1';
+disconnect con1;
DROP TABLE t1;
#
# Bug#56448 Assertion failed: ! is_set() with second xa end
@@ -148,24 +174,25 @@ XA ROLLBACK 'x';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a)) engine=InnoDB;
INSERT INTO t1 VALUES (1, 1), (2, 2);
-# Connection con1
+connect con1, localhost, root;
XA START 'a';
UPDATE t1 SET b= 3 WHERE a=1;
-# Connection default
+connection default;
XA START 'b';
UPDATE t1 SET b=4 WHERE a=2;
# Sending:
UPDATE t1 SET b=5 WHERE a=1;
-# Connection con1
+connection con1;
UPDATE t1 SET b=6 WHERE a=2;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA COMMIT 'a';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
-# Connection default
+connection default;
# Reaping: UPDATE t1 SET b=5 WHERE a=1
XA END 'b';
XA ROLLBACK 'b';
DROP TABLE t1;
+disconnect con1;
#
# Bug#11766752 59936: multiple xa assertions - transactional
# statement fuzzer
@@ -209,24 +236,25 @@ CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
-# Connection con2
+connect con2,localhost,root;
XA START 'xid1';
# Sending:
INSERT INTO t2 SELECT a FROM t1;
-# Connection default
+connection default;
# Waiting until INSERT ... is blocked
DELETE FROM t1;
-# Connection con2
+connection con2;
# Reaping: INSERT INTO t2 SELECT a FROM t1
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA COMMIT 'xid1';
ERROR XA102: XA_RBDEADLOCK: Transaction branch was rolled back: deadlock was detected
-# Connection default
+connection default;
COMMIT;
-# Connection con2
+connection con2;
XA START 'xid1';
XA END 'xid1';
XA PREPARE 'xid1';
XA ROLLBACK 'xid1';
-# Connection default
+connection default;
DROP TABLE t1, t2;
+disconnect con2;
diff --git a/mysql-test/r/xa_sync.result b/mysql-test/r/xa_sync.result
index 769a13d1773..1482ff5cacf 100644
--- a/mysql-test/r/xa_sync.result
+++ b/mysql-test/r/xa_sync.result
@@ -2,23 +2,41 @@
# MDEV-7793 - Race condition between XA COMMIT/ROLLBACK and disconnect
#
# Note that this test is meaningful only with valgrind.
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
XA START 'xatest';
XA END 'xatest';
XA PREPARE 'xatest';
+connection con2;
SET debug_sync='xa_after_search SIGNAL parked WAIT_FOR go';
XA COMMIT 'xatest';
+connection default;
SET debug_sync='now WAIT_FOR parked';
+disconnect con1;
# Waiting for thread to get deleted
SET debug_sync='now SIGNAL go';
+connection con2;
ERROR XAE04: XAER_NOTA: Unknown XID
+disconnect con2;
+connection default;
SET debug_sync='RESET';
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
XA START 'xatest';
XA END 'xatest';
XA PREPARE 'xatest';
+connection con2;
SET debug_sync='xa_after_search SIGNAL parked WAIT_FOR go';
XA ROLLBACK 'xatest';
+connection default;
SET debug_sync='now WAIT_FOR parked';
+disconnect con1;
# Waiting for thread to get deleted
SET debug_sync='now SIGNAL go';
+connection con2;
ERROR XAE04: XAER_NOTA: Unknown XID
+disconnect con2;
+connection default;
SET debug_sync='RESET';
diff --git a/mysql-test/suite/binlog/r/binlog_bug23533.result b/mysql-test/suite/binlog/r/binlog_bug23533.result
index d5cd93284a2..cc9799506c3 100644
--- a/mysql-test/suite/binlog/r/binlog_bug23533.result
+++ b/mysql-test/suite/binlog/r/binlog_bug23533.result
@@ -5,6 +5,8 @@ COUNT(*)
1000
SET GLOBAL binlog_cache_size=4096;
SET GLOBAL max_binlog_cache_size=4096;
+disconnect default;
+connect default,localhost,root,,test;
START TRANSACTION;
CREATE TABLE t2 SELECT * FROM t1;
ERROR HY000: Multi-statement transaction required more than 'max_binlog_cache_size' bytes of storage; increase this mysqld variable and try again
@@ -13,3 +15,5 @@ SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
DROP TABLE t1;
+disconnect default;
+connect default,localhost,root,,test;
diff --git a/mysql-test/suite/binlog/r/binlog_checkpoint.result b/mysql-test/suite/binlog/r/binlog_checkpoint.result
index f76fc6da189..a636952a1cd 100644
--- a/mysql-test/suite/binlog/r/binlog_checkpoint.result
+++ b/mysql-test/suite/binlog/r/binlog_checkpoint.result
@@ -6,8 +6,10 @@ RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
CREATE TABLE t2 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Myisam;
*** Test that RESET MASTER waits for pending commit checkpoints to complete.
+connect con1,localhost,root,,;
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_go";
INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
INSERT INTO t2 VALUES (1, REPEAT("x", 4100));
INSERT INTO t2 VALUES (2, REPEAT("x", 4100));
@@ -24,11 +26,14 @@ master-bin.000004 # Gtid_list # # [#-#-#]
master-bin.000004 # Binlog_checkpoint # # master-bin.000001
SET DEBUG_SYNC= "execute_command_after_close_tables SIGNAL reset_master_done";
RESET MASTER;
+connect con2,localhost,root,,;
This will timeout, as RESET MASTER is blocked
SET DEBUG_SYNC= "now WAIT_FOR reset_master_done TIMEOUT 1";
Warnings:
Warning 1639 debug sync point wait timed out
SET DEBUG_SYNC= "now SIGNAL con1_go";
+connection con1;
+connection default;
show binary logs;
Log_name File_size
master-bin.000001 #
@@ -39,11 +44,15 @@ master-bin.000001 # Gtid_list # # []
master-bin.000001 # Binlog_checkpoint # # master-bin.000001
*** Test that binlog N is active, and commit checkpoint for (N-1) is
*** done while there is still a pending commit checkpoint for (N-2).
+connection con1;
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR con1_continue";
INSERT INTO t1 VALUES (20, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+connection con2;
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR con2_continue";
INSERT INTO t1 VALUES (21, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
show binary logs;
Log_name File_size
@@ -79,6 +88,8 @@ SET DEBUG_SYNC= "RESET";
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
SET DEBUG_SYNC= "now SIGNAL con2_continue";
+connection con2;
+connection default;
con1 is still pending, no new binlog checkpoint should have been logged.
SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
SET GLOBAL debug_dbug= @old_dbug;
@@ -89,6 +100,8 @@ master-bin.000003 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
master-bin.000003 # Gtid_list # # [#-#-#]
master-bin.000003 # Binlog_checkpoint # # master-bin.000001
SET DEBUG_SYNC= "now SIGNAL con1_continue";
+connection con1;
+connection default;
No commit checkpoints are pending, a new binlog checkpoint should have been logged.
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -97,6 +110,7 @@ master-bin.000003 # Gtid_list # # [#-#-#]
master-bin.000003 # Binlog_checkpoint # # master-bin.000001
master-bin.000003 # Binlog_checkpoint # # master-bin.000003
*** MDEV-4322: Broken XID counting during binlog rotation ***
+connection default;
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done";
FLUSH LOGS;
@@ -114,8 +128,10 @@ master-bin.000005 #
master-bin.000006 #
SET debug_sync = 'reset';
*** MDEV-7402: 'reset master' hangs, waits for signalled COND_xid_list ***
+connect con3,localhost,root,,;
SET debug_sync="reset_logs_after_set_reset_master_pending SIGNAL reset_master_ready WAIT_FOR reset_master_cont";
RESET MASTER;
+connection default;
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,inject_binlog_background_thread_before_mark_xid_done";
SET debug_sync="now WAIT_FOR reset_master_ready";
@@ -123,6 +139,8 @@ RESET MASTER;
SET debug_sync="now WAIT_FOR injected_binlog_background_thread";
SET GLOBAL debug_dbug=@old_dbug;
SET debug_sync="now SIGNAL reset_master_cont";
+connection con3;
+connection default;
SET debug_sync = 'reset';
DROP TABLE t1, t2;
SET GLOBAL max_binlog_size= @old_max_binlog_size;
diff --git a/mysql-test/suite/binlog/r/binlog_commit_wait.result b/mysql-test/suite/binlog/r/binlog_commit_wait.result
index 07019c12905..89e905b0313 100644
--- a/mysql-test/suite/binlog/r/binlog_commit_wait.result
+++ b/mysql-test/suite/binlog/r/binlog_commit_wait.result
@@ -4,6 +4,10 @@ SET @old_count= @@GLOBAL.binlog_commit_wait_count;
SET GLOBAL binlog_commit_wait_count= 3;
SET @old_usec= @@GLOBAL.binlog_commit_wait_usec;
SET GLOBAL binlog_commit_wait_usec= 20000000;
+connect con1,localhost,root,,test;
+connect con2,localhost,root,,test;
+connect con3,localhost,root,,test;
+connection default;
SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits';
SELECT variable_value INTO @group_commit_trigger_count FROM information_schema.global_status
@@ -12,11 +16,16 @@ SELECT variable_value INTO @group_commit_trigger_timeout FROM information_schema
WHERE variable_name = 'binlog_group_commit_trigger_timeout';
SELECT variable_value INTO @group_commit_trigger_lock_wait FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
+connection default;
SET @a= current_timestamp();
+connection con1;
BEGIN;
INSERT INTO t1 VALUES (1,0);
COMMIT;
+connection con2;
INSERT INTO t1 VALUES (1,1);
+connection con1;
+connection default;
SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
@@ -37,11 +46,19 @@ SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.
WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_trigger_lock_wait
1
+connection con2;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+connection default;
SET @a= current_timestamp();
+connection con1;
INSERT INTO t1 VALUES (2,0);
+connection con2;
INSERT INTO t1 VALUES (3,0);
+connection con3;
INSERT INTO t1 VALUES (4,0);
+connection con1;
+connection con2;
+connection default;
SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
@@ -62,16 +79,23 @@ SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.
WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_trigger_lock_wait
1
+connection default;
SET @a= current_timestamp();
+connection con1;
INSERT INTO t1 VALUES (6,0);
+connection con2;
BEGIN;
UPDATE t1 SET b=b+1 WHERE a=1;
+connection con3;
UPDATE t1 SET b=b+10 WHERE a=1;
+connection con2;
SELECT SLEEP(0.25);
SLEEP(0.25)
0
UPDATE t1 SET b=b+1 WHERE a=3;
COMMIT;
+connection con1;
+connection default;
SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
@@ -92,9 +116,14 @@ SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.
WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_trigger_lock_wait
2
+connection default;
SET @a= current_timestamp();
+connection con1;
INSERT INTO t1 VALUES (7,0);
+connection con2;
INSERT INTO t1 VALUES (8,0);
+connection con3;
+connection default;
SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
SELECT IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"));
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20"))
@@ -115,9 +144,12 @@ SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.
WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_trigger_lock_wait
2
+connection default;
SET @a= current_timestamp();
SET GLOBAL binlog_commit_wait_usec= 5*1000*1000;
+connection con1;
INSERT INTO t1 VALUES (9,0);
+connection default;
SET @b= unix_timestamp(current_timestamp()) - unix_timestamp(@a);
SELECT IF(@b < 4, CONCAT("Error: too little time elapsed: ", @b, " seconds < 4"),
IF(@b < 20, "Ok", CONCAT("Error: too much time elapsed: ", @b, " seconds >= 20")));
@@ -140,6 +172,7 @@ SELECT variable_value - @group_commit_trigger_lock_wait FROM information_schema.
WHERE variable_name = 'binlog_group_commit_trigger_lock_wait';
variable_value - @group_commit_trigger_lock_wait
2
+connection default;
SELECT * FROM t1 ORDER BY a;
a b
1 11
@@ -150,6 +183,7 @@ a b
7 0
8 0
9 0
+connection default;
DROP TABLE t1;
SET GLOBAL binlog_commit_wait_count= @old_count;
SET GLOBAL binlog_commit_wait_usec= @old_usec;
diff --git a/mysql-test/suite/binlog/r/binlog_grant.result b/mysql-test/suite/binlog/r/binlog_grant.result
index 618e00af72a..201e7b9e722 100644
--- a/mysql-test/suite/binlog/r/binlog_grant.result
+++ b/mysql-test/suite/binlog/r/binlog_grant.result
@@ -1,29 +1,43 @@
+connection default;
reset master;
set @saved_binlog_format = @@global.binlog_format;
create user mysqltest_1@localhost;
show grants for mysqltest_1@localhost;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
+connect plain,localhost,mysqltest_1,,test;
+connect root,localhost,root,,test;
**** Variable SQL_LOG_BIN ****
+connection root;
[root]
set session sql_log_bin = 1;
+connection plain;
[plain]
set session sql_log_bin = 1;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
**** Variable BINLOG_FORMAT ****
+connection root;
[root]
set global binlog_format = row;
set session binlog_format = row;
+connection plain;
[plain]
set global binlog_format = row;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
set session binlog_format = row;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
**** Clean up ****
+disconnect plain;
+disconnect root;
+connection default;
set global binlog_format = @saved_binlog_format;
drop user mysqltest_1@localhost;
CREATE USER 'mysqltest_1'@'localhost';
GRANT REPLICATION CLIENT ON *.* TO 'mysqltest_1'@'localhost';
+connect rpl,localhost,mysqltest_1,,;
+connection rpl;
SHOW MASTER LOGS;
SHOW BINARY LOGS;
+disconnect rpl;
+connection default;
DROP USER 'mysqltest_1'@'localhost';
diff --git a/mysql-test/suite/binlog/r/binlog_killed.result b/mysql-test/suite/binlog/r/binlog_killed.result
index 9f2d0dc2cd5..cda4e8ad6f4 100644
--- a/mysql-test/suite/binlog/r/binlog_killed.result
+++ b/mysql-test/suite/binlog/r/binlog_killed.result
@@ -1,13 +1,19 @@
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
create table t1 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
create table t2 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=MyISAM;
create table t3 (a int auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB;
+connection con1;
select get_lock("a", 20);
get_lock("a", 20)
1
+connection con2;
reset master;
insert into t2 values (null, null), (null, get_lock("a", 10));
+connection con1;
kill query ID;
+connection con2;
select
(@a:=load_file("MYSQLTEST_VARDIR/tmp/kill_query_calling_sp.binlog"))
is not null;
@@ -15,43 +21,56 @@ set @result= 2 - 1 - 1;
select @result /* must be zero either way */;
@result
0
+connection con1;
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
delete from t1;
delete from t2;
insert into t1 values (1,1),(2,2);
+connection con1;
begin;
update t1 set b=11 where a=2;
+connection con2;
begin;
update t1 set b=b+10;
+connection con1;
kill query ID;
rollback;
+connection con2;
rollback;
select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
a b
1 1
2 2
+connection con1;
begin;
delete from t1 where a=2;
+connection con2;
begin;
delete from t1 where a=2;
+connection con1;
kill query ID;
rollback;
+connection con2;
rollback;
select * from t1 order by a /* must be the same as before (1,1),(2,2) */;
a b
1 1
2 2
+connection con1;
drop table if exists t4;
create table t4 (a int, b int) engine=innodb;
insert into t4 values (3, 3);
begin;
insert into t1 values (3, 3);
+connection con2;
begin;
insert into t1 select * from t4 for update;
+connection con1;
kill query ID;
rollback;
+connection con2;
rollback;
select * from t1 /* must be the same as before (1,1),(2,2) */;
a b
@@ -73,15 +92,19 @@ end|
delete from t4;
insert into t4 values (1,1), (1,1);
reset master;
+connection con1;
select get_lock("a", 20);
get_lock("a", 20)
1
+connection con2;
set @b= 0;
update t4 set b=b + bug27563(b);
+connection con1;
select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
count(*)
1
kill query ID;
+connection con2;
ERROR 70100: Query execution was interrupted
select * from t4 order by b /* must be (1,1), (1,2) */;
a b
@@ -107,21 +130,26 @@ is not null
select 0 /* must return 0 to mean the killed update is in */;
0
0
+connection con1;
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
delete from t4;
insert into t4 values (1,1), (2,2);
reset master;
+connection con1;
select get_lock("a", 20);
get_lock("a", 20)
1
+connection con2;
set @b= 0;
delete from t4 where b=bug27563(1) or b=bug27563(2);
+connection con1;
select count(*) FROM INFORMATION_SCHEMA.PROCESSLIST where state='User lock';
count(*)
1
kill query ID;
+connection con2;
ERROR 70100: Query execution was interrupted
select count(*) from t4 /* must be 1 */;
count(*)
@@ -145,10 +173,14 @@ is not null
select 0 /* must return 0 to mean the killed delete is in */;
0
0
+connection con1;
select RELEASE_LOCK("a");
RELEASE_LOCK("a")
1
drop table t4;
drop function bug27563;
+connection default;
+disconnect con1;
+disconnect con2;
drop table t1,t2,t3;
end of the tests
diff --git a/mysql-test/suite/binlog/r/binlog_mdev342.result b/mysql-test/suite/binlog/r/binlog_mdev342.result
index e940fd2a764..9dd806a3c8c 100644
--- a/mysql-test/suite/binlog/r/binlog_mdev342.result
+++ b/mysql-test/suite/binlog/r/binlog_mdev342.result
@@ -2,15 +2,21 @@ SET GLOBAL max_binlog_size= 4096;
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
+connect con1,localhost,root,,;
SET DEBUG_SYNC= "binlog_open_before_update_index SIGNAL con1_ready WAIT_FOR con1_cont";
SET SESSION debug_dbug="+d,crash_create_critical_before_update_index";
INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
+connect con2,localhost,root,,;
SET DEBUG_SYNC= "ha_commit_trans_after_prepare SIGNAL con2_ready";
INSERT INTO t1 VALUES (2, NULL);
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con2_ready";
SET DEBUG_SYNC= "now SIGNAL con1_cont";
+connection con1;
Got one of the listed errors
+connection default;
SELECT a FROM t1 ORDER BY a;
a
1
@@ -30,4 +36,5 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/binlog_row_binlog.result b/mysql-test/suite/binlog/r/binlog_row_binlog.result
index 181f254cd5d..710c95546fd 100644
--- a/mysql-test/suite/binlog/r/binlog_row_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_row_binlog.result
@@ -758,6 +758,8 @@ INSERT INTO test.t1 VALUES (1), (2);
CREATE TABLE test.t2 SELECT * FROM test.t1;
USE test;
DROP TABLES t1, t2;
+connect fresh,localhost,root,,test;
+connection fresh;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY);
BINLOG '
@@ -851,3 +853,4 @@ SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks OFF
DROP TABLE t1;
+disconnect fresh;
diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result
index d7cb9bb97ad..056e658b1fc 100644
--- a/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_row_drop_tbl.result
@@ -1,11 +1,20 @@
DROP TABLE IF EXISTS t1;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
RESET MASTER;
CREATE TABLE t1 (a INT);
SET AUTOCOMMIT=OFF;
BEGIN;
INSERT INTO t1 VALUES(1);
+connection con2;
DROP TABLE t1;;
+connection con1;
COMMIT;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
index dce2cc1408c..d82a9654261 100644
--- a/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_row_drop_tmp_tbl.result
@@ -1,4 +1,7 @@
DROP DATABASE IF EXISTS `drop-temp+table-test`;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
RESET MASTER;
CREATE DATABASE `drop-temp+table-test`;
USE `drop-temp+table-test`;
@@ -20,6 +23,8 @@ SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
USE test;
+disconnect con1;
+connection con2;
SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
@@ -42,12 +47,15 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORAR
DROP DATABASE `drop-temp+table-test`;
RESET MASTER;
CREATE TABLE t1 ( i text );
+connect con1,localhost,root,,;
CREATE TEMPORARY TABLE ttmp1 ( i text );
SET @@session.binlog_format=ROW;
INSERT INTO t1 VALUES ('1');
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
+disconnect con1;
+connection default;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
index f8f4fa5ec31..ca5faa9f5a3 100644
--- a/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result
@@ -1,5 +1,8 @@
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
drop table if exists t1, t2;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
reset master;
@@ -100,6 +103,8 @@ get_lock("a",10)
begin;
insert into t1 values(8);
insert into t2 select * from t1;
+disconnect con1;
+connection con2;
select get_lock("a",10);
get_lock("a",10)
1
@@ -221,6 +226,8 @@ master-bin.000001 # Query # # SAVEPOINT `my_savepoint`
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
+connect con3,localhost,root,,;
+connection con3;
delete from t1;
delete from t2;
alter table t2 engine=MyISAM;
@@ -229,12 +236,15 @@ begin;
select * from t1 for update;
a
1
+connection con2;
select (@before:=unix_timestamp())*0;
(@before:=unix_timestamp())*0
0
begin;
select * from t1 for update;
+connection con3;
insert into t2 values (20);
+connection con2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select (@after:=unix_timestamp())*0;
(@after:=unix_timestamp())*0
@@ -242,9 +252,12 @@ select (@after:=unix_timestamp())*0;
select (@after-@before) >= 2;
(@after-@before) >= 2
1
+connection con3;
commit;
+connection con2;
drop table t1,t2;
commit;
+connection con2;
begin;
create temporary table ti (a int) engine=innodb;
rollback;
@@ -263,6 +276,8 @@ insert into t0 select GET_LOCK("lock1",0);
set autocommit=0;
create table t2 (n int) engine=innodb;
insert into t2 values (3);
+disconnect con2;
+connection con3;
select get_lock("lock1",60);
get_lock("lock1",60)
1
@@ -439,6 +454,8 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+connect con4,localhost,root,,;
+connection con3;
reset master;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
@@ -448,6 +465,8 @@ get_lock("a",10)
begin;
insert into t1 values(8);
insert into t2 select * from t1;
+disconnect con3;
+connection con4;
select get_lock("a",10);
get_lock("a",10)
1
diff --git a/mysql-test/suite/binlog/r/binlog_stm_binlog.result b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
index 3a6af15e88a..812fd4386ab 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_binlog.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_binlog.result
@@ -573,6 +573,8 @@ INSERT INTO test.t1 VALUES (1), (2);
CREATE TABLE test.t2 SELECT * FROM test.t1;
USE test;
DROP TABLES t1, t2;
+connect fresh,localhost,root,,test;
+connection fresh;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY);
BINLOG '
@@ -665,3 +667,4 @@ SHOW SESSION VARIABLES LIKE "unique_checks";
Variable_name Value
unique_checks OFF
DROP TABLE t1;
+disconnect fresh;
diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result
index d9f9dc99731..d958bb2602f 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tbl.result
@@ -1,11 +1,20 @@
DROP TABLE IF EXISTS t1;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
RESET MASTER;
CREATE TABLE t1 (a INT);
SET AUTOCOMMIT=OFF;
BEGIN;
INSERT INTO t1 VALUES(1);
+connection con2;
DROP TABLE t1;;
+connection con1;
COMMIT;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
index 127df219b02..3b144755aa3 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_drop_tmp_tbl.result
@@ -1,4 +1,7 @@
DROP DATABASE IF EXISTS `drop-temp+table-test`;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
RESET MASTER;
CREATE DATABASE `drop-temp+table-test`;
USE `drop-temp+table-test`;
@@ -20,6 +23,8 @@ SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
USE test;
+disconnect con1;
+connection con2;
SELECT GET_LOCK("a",10);
GET_LOCK("a",10)
1
@@ -64,12 +69,15 @@ master-bin.000001 # Query # # use `drop-temp+table-test`; DROP /*!40005 TEMPORAR
DROP DATABASE `drop-temp+table-test`;
RESET MASTER;
CREATE TABLE t1 ( i text );
+connect con1,localhost,root,,;
CREATE TEMPORARY TABLE ttmp1 ( i text );
SET @@session.binlog_format=ROW;
INSERT INTO t1 VALUES ('1');
SELECT @@session.binlog_format;
@@session.binlog_format
ROW
+disconnect con1;
+connection default;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
index 0ac4716f383..e250c04fa4b 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_mix_innodb_myisam.result
@@ -1,6 +1,9 @@
CALL mtr.add_suppression("Statement may not be safe to log in statement format.");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
drop table if exists t1, t2;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
reset master;
@@ -96,6 +99,8 @@ insert into t1 values(8);
insert into t2 select * from t1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
+disconnect con1;
+connection con2;
select get_lock("a",10);
get_lock("a",10)
1
@@ -205,6 +210,8 @@ master-bin.000001 # Query # # use `test`; insert into t1 values(16)
master-bin.000001 # Query # # SAVEPOINT `my_savepoint`
master-bin.000001 # Query # # use `test`; insert into t1 values(18)
master-bin.000001 # Xid # # COMMIT /* XID */
+connect con3,localhost,root,,;
+connection con3;
delete from t1;
delete from t2;
alter table t2 engine=MyISAM;
@@ -213,12 +220,15 @@ begin;
select * from t1 for update;
a
1
+connection con2;
select (@before:=unix_timestamp())*0;
(@before:=unix_timestamp())*0
0
begin;
select * from t1 for update;
+connection con3;
insert into t2 values (20);
+connection con2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select (@after:=unix_timestamp())*0;
(@after:=unix_timestamp())*0
@@ -226,9 +236,12 @@ select (@after:=unix_timestamp())*0;
select (@after-@before) >= 2;
(@after-@before) >= 2
1
+connection con3;
commit;
+connection con2;
drop table t1,t2;
commit;
+connection con2;
begin;
create temporary table ti (a int) engine=innodb;
rollback;
@@ -249,6 +262,8 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
set autocommit=0;
create table t2 (n int) engine=innodb;
insert into t2 values (3);
+disconnect con2;
+connection con3;
select get_lock("lock1",60);
get_lock("lock1",60)
1
@@ -434,6 +449,8 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `t2` /* generated by server */
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+connect con4,localhost,root,,;
+connection con3;
reset master;
create table t1 (a int) engine=innodb;
create table t2 (a int) engine=myisam;
@@ -445,6 +462,8 @@ insert into t1 values(8);
insert into t2 select * from t1;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
+disconnect con3;
+connection con4;
select get_lock("a",10);
get_lock("a",10)
1
diff --git a/mysql-test/suite/binlog/r/binlog_stm_row.result b/mysql-test/suite/binlog/r/binlog_stm_row.result
index 7fc1d1f447c..68df53a3c6e 100644
--- a/mysql-test/suite/binlog/r/binlog_stm_row.result
+++ b/mysql-test/suite/binlog/r/binlog_stm_row.result
@@ -12,50 +12,54 @@ select @@SESSION.BINLOG_FORMAT;
STATEMENT
INSERT INTO t1 VALUES(1);
INSERT INTO t2 VALUES(2);
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
#
# Ensure that INSERT INTO .. SELECT FROM under SBR takes a read
# lock that will prevent the source table from being modified.
#
-# con1
+connection con1;
SELECT GET_LOCK('Bug#34306', 120);
GET_LOCK('Bug#34306', 120)
1
-# con2
+connection con2;
PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
EXECUTE stmt;;
-# default
+connection default;
INSERT INTO t2 VALUES (3);;
-# con1
+connection con1;
SELECT RELEASE_LOCK('Bug#34306');
RELEASE_LOCK('Bug#34306')
1
-# con2
+connection con2;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT RELEASE_LOCK('Bug#34306');
RELEASE_LOCK('Bug#34306')
1
-# default
+connection default;
#
# Ensure that INSERT INTO .. SELECT FROM prepared under SBR does
# not prevent the source table from being modified if under RBR.
#
-# con2
+connection con2;
SET SESSION BINLOG_FORMAT = ROW;
-# con1
+connection con1;
SELECT GET_LOCK('Bug#34306', 120);
GET_LOCK('Bug#34306', 120)
1
-# con2
+connection con2;
EXECUTE stmt;;
-# default
-# con1
+connection default;
+connection con1;
INSERT INTO t2 VALUES (4);
SELECT RELEASE_LOCK('Bug#34306');
RELEASE_LOCK('Bug#34306')
1
-# con2
-# default
+connection con2;
+disconnect con1;
+disconnect con2;
+connection default;
# Show binlog events
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/suite/binlog/r/binlog_tmp_table.result b/mysql-test/suite/binlog/r/binlog_tmp_table.result
index 91702aa7335..bfc26aaf961 100644
--- a/mysql-test/suite/binlog/r/binlog_tmp_table.result
+++ b/mysql-test/suite/binlog/r/binlog_tmp_table.result
@@ -1,19 +1,34 @@
RESET MASTER;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect master1,127.0.0.1,root,,test,$MASTER_MYPORT,;
create table foo (a int);
flush logs;
+connection master;
create temporary table tmp1_foo like foo;
+connection master1;
create temporary table tmp2_foo (a int);
+connection master;
insert into tmp1_foo values (1), (2), (3), (4);
+connection master1;
replace into tmp2_foo values (1), (2), (3), (4);
+connection master;
update tmp1_foo set a=2*a-1;
+connection master1;
update tmp2_foo set a=2*a;
+connection master;
delete from tmp1_foo where a < 5;
+connection master1;
delete from tmp2_foo where a < 5;
+connection master;
insert into foo select * from tmp1_foo;
+connection master1;
insert into foo select * from tmp2_foo;
+connection master;
truncate table tmp1_foo;
+connection master1;
truncate table tmp2_foo;
flush logs;
+connection default;
select * from foo;
a
5
@@ -30,13 +45,23 @@ a
8
drop table foo;
RESET MASTER;
+connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection con1;
create database b51226;
use b51226;
create temporary table t1(i int);
+connection con2;
use b51226;
create temporary table t1(i int);
+connection con1;
create temporary table t1(i int);
ERROR 42S01: Table 't1' already exists
+disconnect con1;
+connection default;
+connection con2;
insert into t1 values(1);
+disconnect con2;
+connection default;
DROP DATABASE b51226;
FLUSH LOGS;
diff --git a/mysql-test/suite/binlog/r/binlog_truncate_kill.result b/mysql-test/suite/binlog/r/binlog_truncate_kill.result
index 9161f3dc10d..780b84ecfc6 100644
--- a/mysql-test/suite/binlog/r/binlog_truncate_kill.result
+++ b/mysql-test/suite/binlog/r/binlog_truncate_kill.result
@@ -14,8 +14,6 @@ connection default;
ERROR 70100: Query execution was interrupted
connection con1;
include/show_binlog_events.inc
-connection con1;
-connection con1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB
@@ -23,8 +21,6 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Intvar # # INSERT_ID=1
master-bin.000001 # Query # # use `test`; INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10)
master-bin.000001 # Xid # # COMMIT /* XID */
-connection con1;
-connection con1;
disconnect con1;
connection default;
SELECT * FROM t1;
diff --git a/mysql-test/suite/binlog/r/binlog_truncate_myisam.result b/mysql-test/suite/binlog/r/binlog_truncate_myisam.result
index 90cc335ee0a..56944e6ee0c 100644
--- a/mysql-test/suite/binlog/r/binlog_truncate_myisam.result
+++ b/mysql-test/suite/binlog/r/binlog_truncate_myisam.result
@@ -20,18 +20,17 @@ DROP TABLE t1,t2;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
CREATE TABLE t2 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
-# Connection: default
BEGIN;
INSERT INTO t2 SELECT * FROM t1;
-# Connection: truncate
+connect truncate,localhost,root,,;
TRUNCATE TABLE t1;
-# Connection: default
+connection default;
INSERT INTO t2 SELECT * FROM t1;
SELECT COUNT(*) FROM t2;
COUNT(*)
4
COMMIT;
-# Connection: truncate
+connection truncate;
# Reaping TRUNCATE TABLE
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -39,7 +38,7 @@ COUNT(*)
SELECT COUNT(*) FROM t2;
COUNT(*)
4
-# Connection: default
+connection default;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
@@ -52,6 +51,7 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+disconnect truncate;
DROP TABLE t1,t2;
SET BINLOG_FORMAT=STATEMENT;
RESET MASTER;
@@ -74,18 +74,17 @@ DROP TABLE t1,t2;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
CREATE TABLE t2 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1),(2);
-# Connection: default
BEGIN;
INSERT INTO t2 SELECT * FROM t1;
-# Connection: truncate
+connect truncate,localhost,root,,;
TRUNCATE TABLE t1;
-# Connection: default
+connection default;
INSERT INTO t2 SELECT * FROM t1;
SELECT COUNT(*) FROM t2;
COUNT(*)
4
COMMIT;
-# Connection: truncate
+connection truncate;
# Reaping TRUNCATE TABLE
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -93,7 +92,7 @@ COUNT(*)
SELECT COUNT(*) FROM t2;
COUNT(*)
4
-# Connection: default
+connection default;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
@@ -104,5 +103,6 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t2 SELECT * FROM t1
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; TRUNCATE TABLE t1
+disconnect truncate;
DROP TABLE t1,t2;
SET BINLOG_FORMAT=@old_binlog_format;
diff --git a/mysql-test/suite/binlog/r/binlog_xa_recover.result b/mysql-test/suite/binlog/r/binlog_xa_recover.result
index e9e5b23176d..2c0e677bf1c 100644
--- a/mysql-test/suite/binlog/r/binlog_xa_recover.result
+++ b/mysql-test/suite/binlog/r/binlog_xa_recover.result
@@ -5,21 +5,29 @@ CREATE TABLE t1 (a INT PRIMARY KEY, b MEDIUMTEXT) ENGINE=Innodb;
INSERT INTO t1 VALUES (100, REPEAT("x", 4100));
INSERT INTO t1 VALUES (101, REPEAT("x", 4100));
INSERT INTO t1 VALUES (102, REPEAT("x", 4100));
+connect con1,localhost,root,,;
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con1_wait WAIT_FOR con1_cont";
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con1_ready WAIT_FOR _ever";
INSERT INTO t1 VALUES (1, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_wait";
+connect con2,localhost,root,,;
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con2_wait WAIT_FOR con2_cont";
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con2_ready WAIT_FOR _ever";
INSERT INTO t1 VALUES (2, NULL);
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con2_wait";
+connect con3,localhost,root,,;
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con3_wait WAIT_FOR con3_cont";
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con3_ready WAIT_FOR _ever";
INSERT INTO t1 VALUES (3, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con3_wait";
+connect con4,localhost,root,,;
SET DEBUG_SYNC= "ha_commit_trans_before_log_and_order SIGNAL con4_wait WAIT_FOR con4_cont";
SET SESSION debug_dbug="+d,crash_commit_after_log";
INSERT INTO t1 VALUES (4, NULL);
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con4_wait";
SET DEBUG_SYNC= "now SIGNAL con1_cont";
SET DEBUG_SYNC= "now WAIT_FOR con1_ready";
@@ -83,7 +91,9 @@ master-bin.000004 #
master-bin.000005 #
master-bin.000006 #
SET DEBUG_SYNC= "now SIGNAL con4_cont";
+connection con4;
Got one of the listed errors
+connection default;
SELECT a FROM t1 ORDER BY a;
a
1
@@ -97,14 +107,20 @@ Test that with multiple binlog checkpoints, recovery starts from the last one.
SET GLOBAL max_binlog_size= 4096;
SET GLOBAL innodb_flush_log_at_trx_commit= 1;
RESET MASTER;
+connect con10,localhost,root,,;
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con10_ready WAIT_FOR con10_cont";
INSERT INTO t1 VALUES (10, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con10_ready";
+connect con11,localhost,root,,;
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con11_ready WAIT_FOR con11_cont";
INSERT INTO t1 VALUES (11, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con11_ready";
+connect con12,localhost,root,,;
SET DEBUG_SYNC= "commit_after_group_release_commit_ordered SIGNAL con12_ready WAIT_FOR con12_cont";
INSERT INTO t1 VALUES (12, REPEAT("x", 4100));
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con12_ready";
INSERT INTO t1 VALUES (13, NULL);
show binary logs;
@@ -123,12 +139,18 @@ master-bin.000004 # Table_map # # table_id: # (test.t1)
master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000004 # Xid # # COMMIT /* XID */
SET DEBUG_SYNC= "now SIGNAL con10_cont";
+connection con10;
+connection default;
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,binlog_background_checkpoint_processed";
SET DEBUG_SYNC= "now SIGNAL con12_cont";
+connection con12;
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR binlog_background_checkpoint_processed";
SET GLOBAL debug_dbug= @old_dbug;
SET DEBUG_SYNC= "now SIGNAL con11_cont";
+connection con11;
+connection default;
Checking that master-bin.000004 is the last binlog checkpoint
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -145,6 +167,7 @@ Now crash the server
SET SESSION debug_dbug="+d,crash_commit_after_log";
INSERT INTO t1 VALUES (14, NULL);
Got one of the listed errors
+connection default;
SELECT a FROM t1 ORDER BY a;
a
1
@@ -206,4 +229,5 @@ master-bin.000004 # Table_map # # table_id: # (test.t1)
master-bin.000004 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000004 # Xid # # COMMIT /* XID */
master-bin.000004 # Rotate # # master-bin.000005;pos=POS
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result
index f09216cb539..59a1f598c2b 100644
--- a/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result
+++ b/mysql-test/suite/binlog/r/temptable_uservar_disconnect-7938.result
@@ -1,7 +1,10 @@
+connect con1,localhost,root,,;
create table t1 (i int);
create trigger tr after insert on t1 for each row set @b=@a;
create temporary table tmp like t1;
insert into t1 values (1);
+disconnect con1;
+connection default;
select * from t1;
i
1
diff --git a/mysql-test/suite/binlog/t/binlog_stm_row.test b/mysql-test/suite/binlog/t/binlog_stm_row.test
index 87758d57725..bade737c114 100644
--- a/mysql-test/suite/binlog/t/binlog_stm_row.test
+++ b/mysql-test/suite/binlog/t/binlog_stm_row.test
@@ -42,14 +42,11 @@ INSERT INTO t2 VALUES(2);
--echo #
--connection con1
---echo # con1
SELECT GET_LOCK('Bug#34306', 120);
--connection con2
---echo # con2
PREPARE stmt FROM "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
--send EXECUTE stmt;
--connection default
---echo # default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
state = "User lock" AND
@@ -57,18 +54,15 @@ let $wait_condition=
--source include/wait_condition.inc
--send INSERT INTO t2 VALUES (3);
--connection con1
---echo # con1
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
state = "Waiting for table level lock" and info = "INSERT INTO t2 VALUES (3)";
--source include/wait_condition.inc
SELECT RELEASE_LOCK('Bug#34306');
--connection con2
---echo # con2
--reap
SELECT RELEASE_LOCK('Bug#34306');
--connection default
---echo # default
--reap
--echo #
@@ -77,33 +71,26 @@ SELECT RELEASE_LOCK('Bug#34306');
--echo #
--connection con2
---echo # con2
SET SESSION BINLOG_FORMAT = ROW;
--connection con1
---echo # con1
SELECT GET_LOCK('Bug#34306', 120);
--connection con2
---echo # con2
--send EXECUTE stmt;
--connection default
---echo # default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist WHERE
state = "User lock" AND
info = "INSERT INTO t1 SELECT * FROM t2 WHERE GET_LOCK('Bug#34306', 120)";
--source include/wait_condition.inc
--connection con1
---echo # con1
INSERT INTO t2 VALUES (4);
SELECT RELEASE_LOCK('Bug#34306');
--connection con2
---echo # con2
--reap
--disconnect con1
--disconnect con2
--connection default
---echo # default
--echo # Show binlog events
source include/show_binlog_events.inc;
diff --git a/mysql-test/suite/binlog/t/binlog_truncate_kill.test b/mysql-test/suite/binlog/t/binlog_truncate_kill.test
index 92c23f18cb4..0b9e873d17e 100644
--- a/mysql-test/suite/binlog/t/binlog_truncate_kill.test
+++ b/mysql-test/suite/binlog/t/binlog_truncate_kill.test
@@ -20,7 +20,6 @@
--source include/have_debug_sync.inc
--source include/have_binlog_format_statement.inc
RESET MASTER;
---enable_connect_log
--connection default
CREATE TABLE t1(id INT AUTO_INCREMENT PRIMARY KEY, a INT, b INT) ENGINE=INNODB;
INSERT INTO t1(a, b) VALUES(1,2),(2,4),(3,6),(4,8),(5,10);
@@ -54,4 +53,3 @@ SELECT * FROM t1;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
---disable_connect_log
diff --git a/mysql-test/suite/csv/csv.result b/mysql-test/suite/csv/csv.result
index 5f1b380f96b..833cd688be5 100644
--- a/mysql-test/suite/csv/csv.result
+++ b/mysql-test/suite/csv/csv.result
@@ -4978,11 +4978,16 @@ c1
5
DROP TABLE bug14672;
CREATE TABLE test_concurrent_insert ( val integer not null ) ENGINE = CSV;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
LOCK TABLES test_concurrent_insert READ LOCAL;
+connection con2;
INSERT INTO test_concurrent_insert VALUES (1);
SELECT * FROM test_concurrent_insert;
val
1
+connection con1;
SELECT * FROM test_concurrent_insert;
val
UNLOCK TABLES;
@@ -4994,6 +4999,9 @@ val
2
UNLOCK TABLES;
DROP TABLE test_concurrent_insert;
+connection default;
+disconnect con1;
+disconnect con2;
CREATE TABLE test_repair_table ( val integer not null ) ENGINE = CSV;
CHECK TABLE test_repair_table;
Table Op Msg_type Msg_text
@@ -5391,8 +5399,12 @@ That
drop table t1;
create table t1 (a int not null) engine=csv;
lock tables t1 read;
+connect con1,localhost,root,,;
+connection con1;
select * from t1;
ERROR HY000: File 'MYSQLD_DATADIR/test/t1.CSV' not found (Errcode: 2 "No such file or directory")
+disconnect con1;
+connection default;
unlock tables;
drop table t1;
CREATE TABLE t1 (e enum('foo','bar') NOT NULL) ENGINE = CSV;
diff --git a/mysql-test/suite/encryption/r/create_or_replace.result b/mysql-test/suite/encryption/r/create_or_replace.result
index 54d41972e7c..1671043b50d 100644
--- a/mysql-test/suite/encryption/r/create_or_replace.result
+++ b/mysql-test/suite/encryption/r/create_or_replace.result
@@ -12,7 +12,12 @@ INSERT /*! IGNORE */ INTO table1_int_autoinc VALUES (4, NULL, NULL);
INSERT IGNORE INTO `table0_int_autoinc` ( `col_int_key` ) VALUES ( 1 ), ( 3 ), ( 4 ), ( 1 );
INSERT IGNORE INTO `table1_int_autoinc` ( `col_int` ) VALUES ( 1 ), ( 0 ), ( 7 ), ( 9 );
INSERT IGNORE INTO `table10_int_autoinc` ( `col_int` ) VALUES ( 6 ), ( 2 ), ( 3 ), ( 6 );
+connect con1,localhost,root,,test;
+connect con2,localhost,root,,test;
+connection default;
drop table if exists create_or_replace_t, table1_int_autoinc, table0_int_autoinc, table10_int_autoinc;
+disconnect con1;
+disconnect con2;
SET GLOBAL innodb_encrypt_tables = OFF;
SET GLOBAL innodb_encryption_threads = 4;
# Wait max 10 min for key encryption threads to decrypt all spaces
diff --git a/mysql-test/suite/encryption/r/tempfiles.result b/mysql-test/suite/encryption/r/tempfiles.result
index a0b7596dd5a..e335e644400 100644
--- a/mysql-test/suite/encryption/r/tempfiles.result
+++ b/mysql-test/suite/encryption/r/tempfiles.result
@@ -26,6 +26,7 @@ i 10
j 10
drop table t1;
set global binlog_cache_size=8192;
+connect con1, localhost, root;
create table t1 (a text) engine=innodb;
start transaction;
insert t1 select repeat(seq, 1000) from seq_1_to_15;
@@ -34,6 +35,8 @@ start transaction;
insert t1 select repeat(seq, 1000) from seq_1_to_8;
commit;
drop table t1;
+disconnect con1;
+connect con2, localhost, root;
create table t1 (a text) engine=innodb;
start transaction;
insert t1 select repeat(seq, 1000) from seq_1_to_15;
@@ -43,4 +46,6 @@ rollback to savepoint foo;
insert t1 select repeat(seq, 1000) from seq_31_to_40;
commit;
drop table t1;
+disconnect con2;
+connection default;
set global binlog_cache_size=default;
diff --git a/mysql-test/suite/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result
index 7a351b9df6f..76ac6e422cd 100644
--- a/mysql-test/suite/federated/assisted_discovery.result
+++ b/mysql-test/suite/federated/assisted_discovery.result
@@ -1,5 +1,10 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
CREATE TABLE t1 (
`id` int(20) primary key,
`group` int NOT NULL default 1,
@@ -7,6 +12,7 @@ CREATE TABLE t1 (
`a\\` int unsigned,
`name` varchar(32) default 'name')
DEFAULT CHARSET=latin1;
+connection master;
CREATE TABLE t1 ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SHOW CREATE TABLE t1;
@@ -26,12 +32,15 @@ id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
+connection slave;
SELECT * FROM t1;
id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/error_on_close-8313.result b/mysql-test/suite/federated/error_on_close-8313.result
index 93b0edb4e49..d8b72c1c52a 100644
--- a/mysql-test/suite/federated/error_on_close-8313.result
+++ b/mysql-test/suite/federated/error_on_close-8313.result
@@ -1,4 +1,8 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
connection slave;
create table t1 (foo int, bar int);
diff --git a/mysql-test/suite/federated/error_on_close-8313.test b/mysql-test/suite/federated/error_on_close-8313.test
index b0b12861a66..a71ee67ce27 100644
--- a/mysql-test/suite/federated/error_on_close-8313.test
+++ b/mysql-test/suite/federated/error_on_close-8313.test
@@ -3,8 +3,6 @@
#
source include/federated.inc;
-enable_connect_log;
-
connection slave;
create table t1 (foo int, bar int);
diff --git a/mysql-test/suite/federated/federated.result b/mysql-test/suite/federated/federated.result
index a71a16e07c7..7734546fbf4 100644
--- a/mysql-test/suite/federated/federated.result
+++ b/mysql-test/suite/federated/federated.result
@@ -1,5 +1,10 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='non_existing';
ERROR HY000: server name: 'non_existing' doesn't exist!
SHOW WARNINGS;
@@ -13,7 +18,9 @@ drop table t1;
select * from fed;
Got one of the listed errors
drop table fed;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_archive.result b/mysql-test/suite/federated/federated_archive.result
index 6ff1da69725..bbafa2b9eac 100644
--- a/mysql-test/suite/federated/federated_archive.result
+++ b/mysql-test/suite/federated/federated_archive.result
@@ -1,10 +1,16 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
DROP TABLE IF EXISTS federated.archive_table;
CREATE TABLE federated.archive_table (
`id` int(4) NOT NULL,
`name` varchar(54) default NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(4) NOT NULL,
@@ -32,8 +38,11 @@ id name
1 foo
2 bar
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.archive_table;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_bug_13118.result b/mysql-test/suite/federated/federated_bug_13118.result
index a645bc58bc2..e98bcce9dc3 100644
--- a/mysql-test/suite/federated/federated_bug_13118.result
+++ b/mysql-test/suite/federated/federated_bug_13118.result
@@ -1,10 +1,16 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
DROP TABLE IF EXISTS federated.bug_13118_table;
CREATE TABLE federated.bug_13118_table (
`foo` integer,
`bar` integer
);
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`foo` integer,
@@ -23,8 +29,11 @@ foo bar
1 1
1 1
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.bug_13118_table;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_bug_25714.result b/mysql-test/suite/federated/federated_bug_25714.result
index ace76b77348..9ac15672038 100644
--- a/mysql-test/suite/federated/federated_bug_25714.result
+++ b/mysql-test/suite/federated/federated_bug_25714.result
@@ -1,7 +1,13 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection master;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
+connection slave;
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
DROP TABLE IF EXISTS federated.bug_13118_table;
@@ -12,6 +18,7 @@ CREATE TABLE federated.t1 (
INSERT INTO federated.t1 SET value=1;
INSERT INTO federated.t1 SET value=2;
INSERT INTO federated.t1 SET value=2;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int auto_increment primary key,
@@ -45,9 +52,12 @@ id value
8 55
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
+connection slave;
DROP TABLE federated.t1;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_bug_32426.result b/mysql-test/suite/federated/federated_bug_32426.result
index fbfa6dc3d52..102b66c07ee 100644
--- a/mysql-test/suite/federated/federated_bug_32426.result
+++ b/mysql-test/suite/federated/federated_bug_32426.result
@@ -1,11 +1,17 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
#
# Bug #32426: FEDERATED query returns corrupt results for ORDER BY
# on a TEXT column
#
+connection slave;
CREATE TABLE federated.t1(a TEXT);
INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
+connection master;
CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
SELECT * FROM federated.t1 ORDER BY A;
@@ -23,8 +29,12 @@ f
de
abc
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.t1;
+connection default;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_bug_35333.result b/mysql-test/suite/federated/federated_bug_35333.result
index 38a3a51ef28..be01d8ca24a 100644
--- a/mysql-test/suite/federated/federated_bug_35333.result
+++ b/mysql-test/suite/federated/federated_bug_35333.result
@@ -8,7 +8,11 @@
# the remote connection error and push a warning instead. This allows the SELECT operation
# to complete while still indicating a problem. This fix applies to any non-fatal system
# error that occurs during a query against I_S.TABLES.de
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
DROP TABLE IF EXISTS federated.t0;
#
@@ -33,7 +37,9 @@ Warning 1017 Can't find file: './test/t1.MYI' (errno: 2 "No such file or directo
#
# Cleanup
#
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_bug_585688.result b/mysql-test/suite/federated/federated_bug_585688.result
index d846e3a26cf..84c08944ce0 100644
--- a/mysql-test/suite/federated/federated_bug_585688.result
+++ b/mysql-test/suite/federated/federated_bug_585688.result
@@ -1,26 +1,50 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
#
# Bug #585688: maridb crashes in federatedx code
#
+connection slave;
CREATE TABLE federated.t1(a TEXT);
INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
+connect conn_1,127.0.0.1,root,,,$MASTER_MYPORT;
+connection master;
flush tables;
+connection conn_1;
CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
+disconnect conn_1;
+connection master;
flush tables;
+connect conn_2,127.0.0.1,root,,,$MASTER_MYPORT;
+connect conn_3,127.0.0.1,root,,,$MASTER_MYPORT;
+connection conn_2;
describe federated.t1;
Field Type Null Key Default Extra
a text YES NULL
+connection conn_3;
show table status from federated;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 FEDERATED 10 Dynamic 5 20 X X X X X X X X latin1_swedish_ci NULL
+disconnect conn_2;
+connect conn_4,127.0.0.1,root,,,$MASTER_MYPORT;
+connection conn_4;
show table status from federated;
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment
t1 FEDERATED 10 Dynamic 5 20 X X X X X X X X latin1_swedish_ci NULL
+disconnect conn_3;
+disconnect conn_4;
+connection master;
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.t1;
+connection default;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_debug.result b/mysql-test/suite/federated/federated_debug.result
index 58c7ebefea3..14024f39f71 100644
--- a/mysql-test/suite/federated/federated_debug.result
+++ b/mysql-test/suite/federated/federated_debug.result
@@ -1,12 +1,16 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
#
# Bug#47525: MySQL crashed (Federated)
#
-# Switch to slave
+connection slave;
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
-# Switch to master
+connection master;
CREATE TABLE t1(a INT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SELECT * FROM t1;
@@ -20,9 +24,13 @@ a
1
# Drop tables on master and slave
DROP TABLE t1;
+connection slave;
DROP TABLE t1;
+connection default;
# Federated cleanup
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_debug.test b/mysql-test/suite/federated/federated_debug.test
index a640987a127..cbd769a1770 100644
--- a/mysql-test/suite/federated/federated_debug.test
+++ b/mysql-test/suite/federated/federated_debug.test
@@ -7,12 +7,10 @@
--echo #
connection slave;
---echo # Switch to slave
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1);
connection master;
---echo # Switch to master
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE t1(a INT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
diff --git a/mysql-test/suite/federated/federated_innodb.result b/mysql-test/suite/federated/federated_innodb.result
index 526a886f0ce..e7571913acc 100644
--- a/mysql-test/suite/federated/federated_innodb.result
+++ b/mysql-test/suite/federated/federated_innodb.result
@@ -1,7 +1,13 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
create table federated.t1 (a int primary key, b varchar(64))
engine=myisam;
+connection master;
create table federated.t1 (a int primary key, b varchar(64))
engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
@@ -11,15 +17,20 @@ select * from federated.t1;
a b
1 Larry
2 Curly
+connection slave;
truncate federated.t1;
alter table federated.t1 engine=innodb;
+connection master;
insert into federated.t1 values (1,"Larry"), (2,"Curly"), (1,"Moe");
ERROR 23000: Can't write; duplicate key in table 't1'
select * from federated.t1;
a b
drop table federated.t1;
+connection slave;
drop table federated.t1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_maybe_16324629.result b/mysql-test/suite/federated/federated_maybe_16324629.result
index b1dd8097cac..0417b5c0659 100644
--- a/mysql-test/suite/federated/federated_maybe_16324629.result
+++ b/mysql-test/suite/federated/federated_maybe_16324629.result
@@ -1,6 +1,12 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
create table federated.t1 (a int, b int, unique key (a), key (b));
+connection master;
create table t1 (a int, b int, unique key (a), key (b))
engine=federated CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
insert into t1 values (3, 3), (7, 7);
@@ -10,7 +16,11 @@ a b
3 3
7 7
drop table t1;
+connection slave;
+connection default;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_partition.result b/mysql-test/suite/federated/federated_partition.result
index 26a6443ffad..8d0840a1d2d 100644
--- a/mysql-test/suite/federated/federated_partition.result
+++ b/mysql-test/suite/federated/federated_partition.result
@@ -1,8 +1,14 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
drop table if exists t1;
+connection slave;
create table federated.t1_1 (s1 int primary key) engine=myisam;
create table federated.t1_2 (s1 int primary key) engine=innodb;
+connection master;
create table t1 (s1 int primary key) engine=federated
partition by list (s1)
(partition p1 values in (1,3)
@@ -25,6 +31,7 @@ s1
3
2
4
+connection slave;
select * from federated.t1_1;
s1
1
@@ -33,11 +40,15 @@ select * from federated.t1_2;
s1
2
4
+connection master;
drop table t1;
+connection slave;
drop table federated.t1_1;
drop table federated.t1_2;
End of 5.1 tests
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_server.result b/mysql-test/suite/federated/federated_server.result
index 2f04f1443ba..45616839b89 100644
--- a/mysql-test/suite/federated/federated_server.result
+++ b/mysql-test/suite/federated/federated_server.result
@@ -1,5 +1,10 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
create database first_db;
create database second_db;
use first_db;
@@ -36,6 +41,7 @@ CREATE TABLE second_db.t2 (
`name` varchar(64) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
+connection master;
drop server if exists 'server_one';
create server 'server_one' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
@@ -156,6 +162,7 @@ drop server 'server_one';
drop server 'server_two';
select * from mysql.servers order by db;
Server_name Host Db Username Password Port Socket Wrapper Owner
+connection slave;
drop table first_db.t1;
drop table second_db.t1;
drop database first_db;
@@ -175,8 +182,10 @@ CREATE TABLE db_bogus.t1 (
)
;
INSERT INTO db_bogus.t1 VALUES ('2','this is bogus');
+connection slave;
create user test_fed@localhost identified by 'foo';
grant all on db_legitimate.* to test_fed@localhost;
+connection master;
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
DATABASE 'db_legitimate',
@@ -198,22 +207,32 @@ CREATE TABLE federated.t1 (
select * from federated.t1;
id name
1 this is legitimate
+connect conn_select,127.0.0.1,guest_select,,federated,$MASTER_MYPORT;
+connect conn_usage,127.0.0.1,guest_usage,,,$MASTER_MYPORT;
+connect conn_super,127.0.0.1,guest_super,,,$MASTER_MYPORT;
+connection conn_select;
alter server s1 options (database 'db_bogus');
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection master;
flush tables;
select * from federated.t1;
id name
1 this is legitimate
+connection conn_usage;
alter server s1 options (database 'db_bogus');
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection master;
flush tables;
select * from federated.t1;
id name
1 this is legitimate
+connection conn_super;
alter server s1 options (database 'db_bogus');
+connection master;
flush tables;
select * from federated.t1;
Got one of the listed errors
+connection conn_select;
drop server if exists 's1';
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
create server 's1' foreign data wrapper 'mysql' options
@@ -225,6 +244,7 @@ PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection conn_super;
drop server 's1';
create server 's1' foreign data wrapper 'mysql' options
(HOST '127.0.0.1',
@@ -234,13 +254,19 @@ PASSWORD 'foo',
PORT SLAVE_PORT,
SOCKET '',
OWNER 'root');
+connection master;
flush tables;
select * from federated.t1;
id name
1 this is legitimate
+connection slave;
drop user test_fed@localhost;
drop database db_legitimate;
drop database db_bogus;
+disconnect conn_select;
+disconnect conn_usage;
+disconnect conn_super;
+connection master;
drop user guest_super@localhost;
drop user guest_usage@localhost;
drop user guest_select@localhost;
@@ -255,6 +281,8 @@ alter server 's1' options
password '', socket '', owner '', port 3306);
drop server 's1';
# End of 5.1 tests
+connect other,localhost,root,,;
+connection master;
use test;
create table t1(a int);
insert into t1 values (1);
@@ -274,13 +302,18 @@ SET v = v + 1;
END WHILE;
select a into @a from t1; # Just reset warnings
END//
+connection other;
use test;
call p1();
+connection master;
call p1();
+connection other;
drop procedure p1;
drop table t1;
drop server if exists s;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federated_transactions.result b/mysql-test/suite/federated/federated_transactions.result
index 52a0686741e..b6569bbc241 100644
--- a/mysql-test/suite/federated/federated_transactions.result
+++ b/mysql-test/suite/federated/federated_transactions.result
@@ -1,5 +1,10 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 'federated.t1'
@@ -8,6 +13,7 @@ CREATE TABLE federated.t1 (
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1 ENGINE=innodb;
+connection master;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 'federated.t1'
@@ -34,7 +40,9 @@ id name
5 foe
6 fig
DELETE FROM federated.t1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/federated/federatedx.result b/mysql-test/suite/federated/federatedx.result
index 4d5d94443f3..06992038668 100644
--- a/mysql-test/suite/federated/federatedx.result
+++ b/mysql-test/suite/federated/federatedx.result
@@ -1,7 +1,13 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE federated;
+connection slave;
CREATE DATABASE federated;
+connection default;
SET @OLD_MASTER_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
+connection slave;
SET @OLD_SLAVE_CONCURRENT_INSERT= @@GLOBAL.CONCURRENT_INSERT;
SET @@GLOBAL.CONCURRENT_INSERT= 0;
DROP TABLE IF EXISTS federated.t1;
@@ -15,6 +21,7 @@ CREATE TABLE federated.t1 (
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 'federated.t1'
@@ -109,6 +116,7 @@ id name
1 foo
2 fee
DROP TABLE federated.t2;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP TABLE IF EXISTS federated.`t1%`;
Warnings:
@@ -118,6 +126,7 @@ CREATE TABLE federated.`t1%` (
`name` varchar(32) NOT NULL default ''
)
DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 'federated.t1'
@@ -149,6 +158,7 @@ id name
2 fee
DELETE FROM federated.`t1%`;
DROP TABLE IF EXISTS federated.`t1%`;
+connection slave;
DROP TABLE IF EXISTS federated.`t1%`;
DROP TABLE IF EXISTS federated.t1;
Warnings:
@@ -160,6 +170,7 @@ CREATE TABLE federated.t1 (
`created` datetime default '2004-04-04 04:04:04',
PRIMARY KEY (`id`))
DEFAULT CHARSET=latin1;
+connection master;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`name` varchar(32) NOT NULL default '',
@@ -285,6 +296,7 @@ id name other created
DELETE FROM federated.t1;
SELECT * FROM federated.t1 WHERE id = 5;
id name other created
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -296,6 +308,7 @@ key name(`name`),
key other(`other`),
key created(`created`))
DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -433,12 +446,14 @@ id name other created
DELETE FROM federated.t1;
SELECT * FROM federated.t1 WHERE id = 5;
id name other created
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
`name` varchar(32),
`other` varchar(20),
PRIMARY KEY (`id`) );
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -496,6 +511,7 @@ id name other
7 Seventh Name seven seven
8 Eigth Name 88888
9 Ninth Name 99999
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -503,6 +519,7 @@ CREATE TABLE federated.t1 (
`other` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY nameoth (name, other) );
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -528,6 +545,7 @@ id name other
SELECT * FROM federated.t1 WHERE name = 'Third Name' AND other = '3333';
id name other
3 Third Name 3333
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
@@ -539,6 +557,7 @@ PRIMARY KEY (id),
KEY nameoth(name, other),
KEY bincol(bincol),
KEY floatval(floatval));
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
@@ -592,6 +611,7 @@ id name bincol floatval other
SELECT * FROM federated.t1 WHERE name='third' and other=2222;
id name bincol floatval other
3 third g 22.22 2222
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
@@ -604,6 +624,7 @@ key col1(col1),
key col2(col2),
key col3(col3),
key col4(col4));
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int NOT NULL auto_increment,
@@ -805,6 +826,7 @@ id col1 col2 col3 col4
7 7 seven Sevenseven 77777 7777
8 8 eight eight eight 88888 88
9 9 nine Nine 999999 999999
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`col1` varchar(8) NOT NULL DEFAULT '',
@@ -815,6 +837,7 @@ primary key (`col1`, `col2`, `col3`, `col4`),
key 3key(`col2`,`col3`,`col4`),
key 2key (`col3`,`col4`),
key col4(col4));
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`col1` varchar(8) NOT NULL DEFAULT '',
@@ -912,12 +935,14 @@ gggg ggggggggggggggggggg gagagagaga gcgcgcgcgcgcgcgc
hhhh hhhhhhhhhhhhhhhhhhh hahahahaha hchchchchchchchc
SELECT * FROM federated.t1 WHERE col4 NOT LIKE '%c%';
col1 col2 col3 col4
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`col1` varchar(8) NOT NULL DEFAULT '',
`col2` int(8) NOT NULL DEFAULT 0,
`col3` varchar(8) NOT NULL DEFAULT '',
primary key (`col1`, `col2`, `col3`));
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`col1` varchar(8) NOT NULL DEFAULT '',
@@ -932,6 +957,7 @@ INSERT INTO federated.t1 VALUES ('aaa', '111', 'ccc');
INSERT INTO federated.t1 VALUES ('bbb', '222', 'yyy');
INSERT INTO federated.t1 VALUES ('ccc', '111', 'zzz');
INSERT INTO federated.t1 VALUES ('ccd', '112', 'zzzz');
+connection slave;
SELECT col3 FROM federated.t1 WHERE (
(col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND
(col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111'));
@@ -939,6 +965,7 @@ col3
ccc
yyy
zzz
+connection master;
SELECT col3 FROM federated.t1 WHERE (
(col1 = 'aaa' AND col2 >= '111') OR col1 > 'aaa') AND
(col1 < 'ccc' OR ( col1 = 'ccc' AND col2 <= '111'));
@@ -946,6 +973,7 @@ col3
ccc
yyy
zzz
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int,
@@ -953,6 +981,7 @@ CREATE TABLE federated.t1 (
`floatval` float,
`other` int)
DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int,
@@ -983,6 +1012,7 @@ AND floatval IS NULL
AND other IS NULL;
count(*)
2
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`blurb_id` int NOT NULL DEFAULT 0,
@@ -991,6 +1021,7 @@ PRIMARY KEY (blurb_id))
DEFAULT CHARSET=latin1;
Warnings:
Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`blurb_id` int NOT NULL DEFAULT 0,
@@ -1011,12 +1042,14 @@ blurb_id blurb
2 All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.
3 A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined.
4 Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`a` int NOT NULL,
`b` int NOT NULL,
`c` int NOT NULL,
PRIMARY KEY (a),key(b));
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`a` int NOT NULL,
@@ -1028,6 +1061,7 @@ ENGINE="FEDERATED"
DEFAULT CHARSET=latin1
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
INSERT INTO federated.t1 VALUES (3,3,3),(1,1,1),(2,2,2),(4,4,4);
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
int, i9 int, i10 int, i11 int, i12 int, i13 int, i14 int, i15 int, i16 int, i17
@@ -1154,6 +1188,7 @@ int, i975 int, i976 int, i977 int, i978 int, i979 int, i980 int, i981 int, i982
int, i983 int, i984 int, i985 int, i986 int, i987 int, i988 int, i989 int, i990
int, i991 int, i992 int, i993 int, i994 int, i995 int, i996 int, i997 int, i998
int, i999 int, i1000 int, b varchar(256)) row_format=dynamic;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1
(i1 int, i2 int, i3 int, i4 int, i5 int, i6 int, i7 int, i8
@@ -1341,8 +1376,10 @@ i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i
DELETE FROM federated.t1 WHERE i50=20;
SELECT * FROM federated.t1;
i1 i2 i3 i4 i5 i6 i7 i8 i9 i10 i11 i12 i13 i14 i15 i16 i17 i18 i19 i20 i21 i22 i23 i24 i25 i26 i27 i28 i29 i30 i31 i32 i33 i34 i35 i36 i37 i38 i39 i40 i41 i42 i43 i44 i45 i46 i47 i48 i49 i50 i51 i52 i53 i54 i55 i56 i57 i58 i59 i60 i61 i62 i63 i64 i65 i66 i67 i68 i69 i70 i71 i72 i73 i74 i75 i76 i77 i78 i79 i80 i81 i82 i83 i84 i85 i86 i87 i88 i89 i90 i91 i92 i93 i94 i95 i96 i97 i98 i99 i100 i101 i102 i103 i104 i105 i106 i107 i108 i109 i110 i111 i112 i113 i114 i115 i116 i117 i118 i119 i120 i121 i122 i123 i124 i125 i126 i127 i128 i129 i130 i131 i132 i133 i134 i135 i136 i137 i138 i139 i140 i141 i142 i143 i144 i145 i146 i147 i148 i149 i150 i151 i152 i153 i154 i155 i156 i157 i158 i159 i160 i161 i162 i163 i164 i165 i166 i167 i168 i169 i170 i171 i172 i173 i174 i175 i176 i177 i178 i179 i180 i181 i182 i183 i184 i185 i186 i187 i188 i189 i190 i191 i192 i193 i194 i195 i196 i197 i198 i199 i200 i201 i202 i203 i204 i205 i206 i207 i208 i209 i210 i211 i212 i213 i214 i215 i216 i217 i218 i219 i220 i221 i222 i223 i224 i225 i226 i227 i228 i229 i230 i231 i232 i233 i234 i235 i236 i237 i238 i239 i240 i241 i242 i243 i244 i245 i246 i247 i248 i249 i250 i251 i252 i253 i254 i255 i256 i257 i258 i259 i260 i261 i262 i263 i264 i265 i266 i267 i268 i269 i270 i271 i272 i273 i274 i275 i276 i277 i278 i279 i280 i281 i282 i283 i284 i285 i286 i287 i288 i289 i290 i291 i292 i293 i294 i295 i296 i297 i298 i299 i300 i301 i302 i303 i304 i305 i306 i307 i308 i309 i310 i311 i312 i313 i314 i315 i316 i317 i318 i319 i320 i321 i322 i323 i324 i325 i326 i327 i328 i329 i330 i331 i332 i333 i334 i335 i336 i337 i338 i339 i340 i341 i342 i343 i344 i345 i346 i347 i348 i349 i350 i351 i352 i353 i354 i355 i356 i357 i358 i359 i360 i361 i362 i363 i364 i365 i366 i367 i368 i369 i370 i371 i372 i373 i374 i375 i376 i377 i378 i379 i380 i381 i382 i383 i384 i385 i386 i387 i388 i389 i390 i391 i392 i393 i394 i395 i396 i397 i398 i399 i400 i401 i402 i403 i404 i405 i406 i407 i408 i409 i410 i411 i412 i413 i414 i415 i416 i417 i418 i419 i420 i421 i422 i423 i424 i425 i426 i427 i428 i429 i430 i431 i432 i433 i434 i435 i436 i437 i438 i439 i440 i441 i442 i443 i444 i445 i446 i447 i448 i449 i450 i451 i452 i453 i454 i455 i456 i457 i458 i459 i460 i461 i462 i463 i464 i465 i466 i467 i468 i469 i470 i471 i472 i473 i474 i475 i476 i477 i478 i479 i480 i481 i482 i483 i484 i485 i486 i487 i488 i489 i490 i491 i492 i493 i494 i495 i496 i497 i498 i499 i500 i501 i502 i503 i504 i505 i506 i507 i508 i509 i510 i511 i512 i513 i514 i515 i516 i517 i518 i519 i520 i521 i522 i523 i524 i525 i526 i527 i528 i529 i530 i531 i532 i533 i534 i535 i536 i537 i538 i539 i540 i541 i542 i543 i544 i545 i546 i547 i548 i549 i550 i551 i552 i553 i554 i555 i556 i557 i558 i559 i560 i561 i562 i563 i564 i565 i566 i567 i568 i569 i570 i571 i572 i573 i574 i575 i576 i577 i578 i579 i580 i581 i582 i583 i584 i585 i586 i587 i588 i589 i590 i591 i592 i593 i594 i595 i596 i597 i598 i599 i600 i601 i602 i603 i604 i605 i606 i607 i608 i609 i610 i611 i612 i613 i614 i615 i616 i617 i618 i619 i620 i621 i622 i623 i624 i625 i626 i627 i628 i629 i630 i631 i632 i633 i634 i635 i636 i637 i638 i639 i640 i641 i642 i643 i644 i645 i646 i647 i648 i649 i650 i651 i652 i653 i654 i655 i656 i657 i658 i659 i660 i661 i662 i663 i664 i665 i666 i667 i668 i669 i670 i671 i672 i673 i674 i675 i676 i677 i678 i679 i680 i681 i682 i683 i684 i685 i686 i687 i688 i689 i690 i691 i692 i693 i694 i695 i696 i697 i698 i699 i700 i701 i702 i703 i704 i705 i706 i707 i708 i709 i710 i711 i712 i713 i714 i715 i716 i717 i718 i719 i720 i721 i722 i723 i724 i725 i726 i727 i728 i729 i730 i731 i732 i733 i734 i735 i736 i737 i738 i739 i740 i741 i742 i743 i744 i745 i746 i747 i748 i749 i750 i751 i752 i753 i754 i755 i756 i757 i758 i759 i760 i761 i762 i763 i764 i765 i766 i767 i768 i769 i770 i771 i772 i773 i774 i775 i776 i777 i778 i779 i780 i781 i782 i783 i784 i785 i786 i787 i788 i789 i790 i791 i792 i793 i794 i795 i796 i797 i798 i799 i800 i801 i802 i803 i804 i805 i806 i807 i808 i809 i810 i811 i812 i813 i814 i815 i816 i817 i818 i819 i820 i821 i822 i823 i824 i825 i826 i827 i828 i829 i830 i831 i832 i833 i834 i835 i836 i837 i838 i839 i840 i841 i842 i843 i844 i845 i846 i847 i848 i849 i850 i851 i852 i853 i854 i855 i856 i857 i858 i859 i860 i861 i862 i863 i864 i865 i866 i867 i868 i869 i870 i871 i872 i873 i874 i875 i876 i877 i878 i879 i880 i881 i882 i883 i884 i885 i886 i887 i888 i889 i890 i891 i892 i893 i894 i895 i896 i897 i898 i899 i900 i901 i902 i903 i904 i905 i906 i907 i908 i909 i910 i911 i912 i913 i914 i915 i916 i917 i918 i919 i920 i921 i922 i923 i924 i925 i926 i927 i928 i929 i930 i931 i932 i933 i934 i935 i936 i937 i938 i939 i940 i941 i942 i943 i944 i945 i946 i947 i948 i949 i950 i951 i952 i953 i954 i955 i956 i957 i958 i959 i960 i961 i962 i963 i964 i965 i966 i967 i968 i969 i970 i971 i972 i973 i974 i975 i976 i977 i978 i979 i980 i981 i982 i983 i984 i985 i986 i987 i988 i989 i990 i991 i992 i993 i994 i995 i996 i997 i998 i999 i1000 b
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (id int NOT NULL auto_increment, code char(20) NOT NULL, fileguts blob NOT NULL, creation_date datetime, entered_time datetime default '2004-04-04 04:04:04', PRIMARY KEY(id), index(code), index(fileguts(10))) DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
id int NOT NULL auto_increment,
@@ -1366,8 +1403,10 @@ id code fileguts creation_date entered_time
SELECT * FROM federated.t1 WHERE fileguts = 'jimbob';
id code fileguts creation_date entered_time
3 DEUEUEUEUEUEUEUEUEU jimbob 2004-04-04 04:04:04 2004-04-04 04:04:04
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (`a` BLOB);
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`a` BLOB)
@@ -1381,6 +1420,7 @@ HEX(a)
00
0001
0100
+connection slave;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
@@ -1389,6 +1429,7 @@ CREATE TABLE federated.t1 (
`other` varchar(20),
PRIMARY KEY (`id`),
key (country_id));
+connection master;
DROP TABLE IF EXISTS federated.countries;
Warnings:
Note 1051 Unknown table 'federated.countries'
@@ -1489,11 +1530,13 @@ federated.t1 repair status OK
REPAIR TABLE federated.t1 USE_FRM;
Table Op Msg_type Msg_text
federated.t1 repair status OK
+connection slave;
DROP TABLE IF EXISTS federated.normal_table;
CREATE TABLE federated.normal_table (
`id` int(4) NOT NULL,
`name` varchar(10) default NULL
) DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.alter_me;
CREATE TABLE federated.alter_me (
`id` int(4) NOT NULL,
@@ -1514,11 +1557,13 @@ id name
1 Monty
2 David
DROP TABLE federated.alter_me;
+connection slave;
DROP TABLE federated.normal_table;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`bitty` bit(3)
) DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`bitty` bit(3)
@@ -1541,13 +1586,16 @@ bitty


drop table federated.t1;
+connection slave;
drop table federated.t1;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 'federated.t1'
CREATE TABLE federated.t1 (
`id` int(20) NOT NULL auto_increment,
PRIMARY KEY (`id`));
+connection master;
DROP TABLE IF EXISTS federated.t1;
Warnings:
Note 1051 Unknown table 'federated.t1'
@@ -1585,7 +1633,9 @@ id
4
5
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.t1;
+connection slave;
DROP TABLE IF EXISTS federated.bug_17377_table;
CREATE TABLE federated.bug_17377_table (
`fld_cid` bigint(20) NOT NULL auto_increment,
@@ -1600,6 +1650,7 @@ KEY `fld_cid` (`fld_cid`)
insert into federated.bug_17377_table( fld_name )
values
("Mats"), ("Sivert"), ("Sigvard"), ("Torgny"), ("Torkel");
+connection master;
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`fld_cid` bigint(20) NOT NULL auto_increment,
@@ -1628,7 +1679,9 @@ fld_cid fld_name fld_parentid fld_delt
4 Torgny 0 0
5 Torkel 0 0
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.bug_17377_table;
+connection slave;
DROP TABLE IF EXISTS federated.test;
CREATE TABLE federated.test (
`id` int(11) NOT NULL,
@@ -1636,6 +1689,7 @@ CREATE TABLE federated.test (
`val2` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+connection master;
DROP TABLE IF EXISTS federated.test_local;
DROP TABLE IF EXISTS federated.test_remote;
CREATE TABLE federated.test_local (
@@ -1666,9 +1720,12 @@ id val1 val2
1 foo bar
DROP TABLE federated.test_local;
DROP TABLE federated.test_remote;
+connection slave;
DROP TABLE federated.test;
+connection slave;
drop table if exists federated.t1;
create table federated.t1 (a int, b int, c int);
+connection master;
drop table if exists federated.t1;
drop table if exists federated.t2;
create table federated.t1 (a int, b int, c int) engine=federated connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
@@ -1699,9 +1756,12 @@ a b c
3 4 12
5 6 30
drop tables federated.t1, federated.t2;
+connection slave;
drop table federated.t1;
+connection slave;
create table federated.t1 (i1 int, i2 int, i3 int);
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20));
+connection master;
create table federated.t1 (i1 int, i2 int, i3 int) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t2';
insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
@@ -1742,9 +1802,12 @@ id c1 c2
2 test t ppc
9 abc ppc
drop table federated.t1, federated.t2;
+connection slave;
drop table federated.t1, federated.t2;
+connection slave;
create table federated.t1 (i1 int, i2 int, i3 int, primary key (i1));
create table federated.t2 (id int, c1 varchar(20), c2 varchar(20), primary key (id));
+connection master;
create table federated.t1 (i1 int auto_increment not null, i2 int, i3 int, primary key (i1)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
create table federated.t2 (id int auto_increment not null, c1 varchar(20), c2 varchar(20), primary key(id)) ENGINE=FEDERATED CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t2';
insert into federated.t1 values (1,5,10),(3,7,12),(4,5,2),(9,10,15),(2,2,2);
@@ -1785,8 +1848,11 @@ id c1 c2
2 test t ppc
9 abc ppc
drop table federated.t1, federated.t2;
+connection slave;
drop table federated.t1, federated.t2;
+connection slave;
create table t1 (id int not null auto_increment primary key, val int);
+connection master;
create table t1
(id int not null auto_increment primary key, val int) engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
@@ -1796,13 +1862,17 @@ select * from t1;
id val
1 NULL
2 0
+connection slave;
select * from t1;
id val
1 NULL
2 0
drop table t1;
+connection master;
drop table t1;
+connection slave;
create table t1 (a longblob not null);
+connection master;
create table t1
(a longblob not null) engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
@@ -1810,11 +1880,14 @@ insert into t1 values (repeat('a',5000));
select length(a) from t1;
length(a)
5000
+connection slave;
select length(a) from t1;
length(a)
5000
drop table t1;
+connection master;
drop table t1;
+connection slave;
set sql_mode="";
DROP TABLE IF EXISTS federated.test;
CREATE TABLE federated.test (
@@ -1825,6 +1898,7 @@ PRIMARY KEY (`i`,`j`),
UNIQUE KEY `i` (`i`,`c`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
set sql_mode=default;
+connection master;
DROP TABLE IF EXISTS federated.test1;
DROP TABLE IF EXISTS federated.test2;
create table federated.test1 (
@@ -1843,13 +1917,16 @@ key (i))
engine = federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/test';
drop table federated.test1, federated.test2;
+connection slave;
drop table federated.test;
+connection slave;
set names utf8;
create table federated.t1 (a varchar(64)) DEFAULT CHARSET=utf8;
insert into federated.t1 values (0x6DC3A56E6164);
select hex(a) from federated.t1;
hex(a)
6DC3A56E6164
+connection master;
create table federated.t1 (a varchar(64))
ENGINE=FEDERATED
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
@@ -1865,13 +1942,17 @@ hex(a)
6DC3A56E6164
C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
+connection slave;
select hex(a) from federated.t1;
hex(a)
6DC3A56E6164
C3A4C3B6C3BCC39F
D18DD184D184D0B5D0BAD182D0B8D0B2D0BDD183D18E
+connection master;
drop table federated.t1;
+connection slave;
drop table federated.t1;
+connection slave;
CREATE TABLE federated.t1 (
categoryId int(11) NOT NULL AUTO_INCREMENT,
domainId varchar(745) NOT NULL DEFAULT '',
@@ -1880,6 +1961,7 @@ PRIMARY KEY (categoryId),
UNIQUE KEY idx_unique_category_categoryName (domainId, categoryName),
KEY idx_category_domainId (domainId)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+connection master;
CREATE TABLE federated.t1 (
categoryId int(11) NOT NULL AUTO_INCREMENT,
domainId varchar(745) NOT NULL DEFAULT '',
@@ -1908,9 +1990,12 @@ categoryId
1
2
drop table federated.t1;
+connection slave;
drop table federated.t1;
+connection slave;
create table federated.t1 (a int primary key, b varchar(64))
DEFAULT CHARSET=utf8;
+connection master;
create table federated.t1 (a int primary key, b varchar(64))
ENGINE=FEDERATED
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
@@ -1932,9 +2017,12 @@ a b
1 Moe
3 Curly
drop table federated.t1;
+connection slave;
drop table federated.t1;
+connection slave;
create table federated.t1 (a int primary key, b varchar(64))
DEFAULT CHARSET=utf8;
+connection master;
create table federated.t1 (a int primary key, b varchar(64))
ENGINE=FEDERATED
connection='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
@@ -1947,6 +2035,7 @@ a b
1 Larry
2 Curly
drop table federated.t1;
+connection slave;
drop table federated.t1;
Bug#18287 create federated table always times out, error 1159 ' '
@@ -1954,7 +2043,9 @@ Bug#18287 create federated table always times out, error 1159 ' '
Test that self-references work
fix LOCK_open before reenabling test for Bug#18287
+connection slave;
CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8;
+connection master;
CREATE TABLE federated.t1 (a INT PRIMARY KEY)
ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1'
@@ -1972,10 +2063,13 @@ a
1
2
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.t1;
+connection slave;
create table t1 (a varchar(256));
drop view if exists v1;
create view v1 as select a from t1;
+connection master;
create table t1
(a varchar(256)) engine=federated
connection='mysql://root@127.0.0.1:SLAVE_PORT/test/v1';
@@ -2082,10 +2176,13 @@ select 1 from t1 order by a;
1
1
drop table t1;
+connection slave;
drop table t1;
drop view v1;
+connection slave;
CREATE TABLE t1 (a INT, b INT, KEY(a,b));
INSERT INTO t1 VALUES(NULL,1),(1,NULL),(NULL,NULL),(1,1),(2,2);
+connection master;
CREATE TABLE t1 (a INT, b INT, KEY(a,b)) ENGINE=federated
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SELECT * FROM t1 WHERE a IS NULL;
@@ -2107,34 +2204,45 @@ SELECT * FROM t1 WHERE a IS NOT NULL AND b=1;
a b
1 1
DROP TABLE t1;
+connection slave;
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
DROP TABLE t1;
+connection slave;
CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
+connection master;
CREATE TABLE t1
(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
CHECKSUM TABLE t1;
Table Checksum
test.t1 2465757603
+connection slave;
DROP TABLE t1;
+connection master;
DROP TABLE t1;
+connection slave;
CREATE TABLE t1 (a TEXT, b TEXT, KEY(b(1)));
INSERT INTO t1 VALUES (NULL, NULL), (NULL, NULL), (NULL, NULL), (NULL, NULL);
+connection master;
CREATE TABLE t1
(a TEXT, b TEXT, KEY(b(1))) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SELECT t1.a FROM t1, t1 as t2 WHERE t2.b NOT LIKE t1.b;
a
+connection slave;
DROP TABLE t1;
+connection master;
DROP TABLE t1;
#
# BUG#21360 - mysqldump error on federated tables
#
+connection slave;
#Switch to Connection Slave
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id));
INSERT INTO t1 VALUES ('text1'),('text2'),('text3'),('text4');
+connection master;
#Switch to Connection Master
CREATE TABLE t1(id VARCHAR(20) NOT NULL, PRIMARY KEY(id)) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
@@ -2147,30 +2255,41 @@ CREATE TABLE `t1` (
) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE t1;
+connection slave;
#Switch to Connection Slave
DROP TABLE t1;
+connection default;
End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (host 'foo');
drop server 's1';
#
# Bug #32426: FEDERATED query returns corrupt results for ORDER BY on a TEXT
#
+connection slave;
CREATE TABLE federated.t1(a TEXT);
INSERT INTO federated.t1 VALUES('abc'), ('gh'), ('f'), ('ijk'), ('de');
+connection master;
CREATE TABLE federated.t1(a TEXT) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
DROP TABLE federated.t1;
+connection slave;
DROP TABLE federated.t1;
+connection default;
End of 5.1 tests
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_MASTER_CONCURRENT_INSERT;
+connection slave;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_SLAVE_CONCURRENT_INSERT;
+connection default;
#
# MDEV-9346 - The federatedx and spider engine make mysqld crash when
# they are configured withtout username
#
+connection master;
CREATE TABLE t1 (a INT) ENGINE=FEDERATED CONNECTION='mysql://@127.0.0.1:SLAVE_PORT/federated/t1';
ERROR HY000: Can't create federated table. Foreign data src error: database: 'federated' username: '' hostname: '127.0.0.1'
+connection master;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
+connection slave;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
diff --git a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
index 098b8c6eca2..ee8a923485a 100644
--- a/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_key_column_usage.inc
@@ -125,18 +125,15 @@ ORDER BY constraint_catalog, constraint_schema, constraint_name,
# show view of user root
eval $select;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $select;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
eval $select;
# Cleanup
---echo # Switch to connection default and close connections testuser1, testuser2
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/datadict/is_routines.inc b/mysql-test/suite/funcs_1/datadict/is_routines.inc
index ecbb1b8c0da..a6e0931ca42 100644
--- a/mysql-test/suite/funcs_1/datadict/is_routines.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_routines.inc
@@ -180,26 +180,22 @@ TO 'testuser2'@'localhost';
GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost';
FLUSH PRIVILEGES;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--replace_column 24 "YYYY-MM-DD hh:mm:ss" 25 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.routines;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
--replace_column 24 "YYYY-MM-DD hh:mm:ss" 25 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.routines;
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , test);
--replace_column 24 "YYYY-MM-DD hh:mm:ss" 25 "YYYY-MM-DD hh:mm:ss"
SELECT * FROM information_schema.routines;
# Cleanup
---echo # Switch to connection default and close connections testuser1,testuser2,testuser3
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/datadict/is_schemata.inc b/mysql-test/suite/funcs_1/datadict/is_schemata.inc
index 29e1f6af4ef..18c759b91d1 100644
--- a/mysql-test/suite/funcs_1/datadict/is_schemata.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_schemata.inc
@@ -103,7 +103,6 @@ eval $my_select;
--sorted_result
eval $my_show;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict_1);
# Shows db_datadict_1
@@ -111,7 +110,6 @@ eval $my_select;
--sorted_result
eval $my_show;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict_2);
# Shows db_datadict_1 and db_datadict_2
@@ -119,7 +117,6 @@ eval $my_select;
--sorted_result
eval $my_show;
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , test);
# Shows neither db_datadict_1 nor db_datadict_2
@@ -128,7 +125,6 @@ eval $my_select;
eval $my_show;
# Cleanup
---echo # Switch to connection default and close connections testuser1,testuser2,testuser3
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/datadict/is_tables.inc b/mysql-test/suite/funcs_1/datadict/is_tables.inc
index 0177ca05e50..de0681d952b 100644
--- a/mysql-test/suite/funcs_1/datadict/is_tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_tables.inc
@@ -129,7 +129,6 @@ let $my_select = SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
let $my_show = SHOW TABLES FROM db_datadict;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
# tb2 is not granted to anyone
@@ -182,7 +181,6 @@ eval $my_select;
--sorted_result
eval $my_show;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
if ($have_bug_32285)
@@ -195,7 +193,6 @@ eval $my_select;
--sorted_result
eval $my_show;
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , db_datadict);
if ($have_bug_32285)
@@ -208,7 +205,6 @@ eval $my_select;
--sorted_result
eval $my_show;
---echo # Switch to connection default (user=root)
connection default;
# we see only 'public' tables
if ($have_bug_32285)
@@ -222,7 +218,6 @@ eval $my_select;
eval $my_show;
# Cleanup
---echo # Close connection testuser1, testuser2, testuser3
disconnect testuser1;
disconnect testuser2;
disconnect testuser3;
diff --git a/mysql-test/suite/funcs_1/datadict/is_triggers.inc b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
index 6c618e533b2..cb2c461dd39 100644
--- a/mysql-test/suite/funcs_1/datadict/is_triggers.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_triggers.inc
@@ -123,7 +123,6 @@ GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
let $my_select = SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
let $my_show = SHOW TRIGGERS FROM db_datadict;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--replace_result $engine_type <engine_type>
@@ -138,7 +137,6 @@ GRANT SELECT ON db_datadict.t1 TO 'testuser3'@'localhost';
eval $my_select;
eval $my_show;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
SHOW GRANTS FOR 'testuser2'@'localhost';
@@ -146,7 +144,6 @@ SHOW GRANTS FOR 'testuser2'@'localhost';
eval $my_select;
eval $my_show;
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , test);
SHOW GRANTS FOR 'testuser3'@'localhost';
@@ -154,7 +151,6 @@ SHOW GRANTS FOR 'testuser3'@'localhost';
eval $my_select;
eval $my_show;
---echo # Establish connection testuser4 (user=testuser4)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser4, localhost, testuser4, , test);
SHOW GRANTS FOR 'testuser4'@'localhost';
@@ -165,7 +161,6 @@ DESC db_datadict.t1;
eval $my_select;
eval $my_show;
---echo # Switch to connection default and close connections testuser1 - testuser4
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/datadict/is_views.inc b/mysql-test/suite/funcs_1/datadict/is_views.inc
index 716d50f5794..3330bea4462 100644
--- a/mysql-test/suite/funcs_1/datadict/is_views.inc
+++ b/mysql-test/suite/funcs_1/datadict/is_views.inc
@@ -108,23 +108,19 @@ let $select = SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
eval $select;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
eval $select;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , test);
eval $select;
---echo # Establish connection test_no_views (user=test_no_views)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (test_no_views, localhost, test_no_views, , test);
eval $select;
# Cleanup
---echo # Switch to connection default and close all other connections
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/datadict/processlist_val.inc b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
index 6e76cedde2e..cfc3c5e751a 100644
--- a/mysql-test/suite/funcs_1/datadict/processlist_val.inc
+++ b/mysql-test/suite/funcs_1/datadict/processlist_val.inc
@@ -135,14 +135,8 @@ echo
# Ensure that the information about an inactive connection is correct.
#--------------------------------------------------------------------------
;
-echo
-# ----- establish connection con1 (user = test_user) -----
-;
connect (con1,localhost,test_user,ddictpass,information_schema);
#
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
# We have now a second connection.
# First working phase for the new connection is with Command = 'Connect'.
@@ -206,9 +200,6 @@ echo
# because he has not the PROCESS privilege.
#----------------------------------------------------------------------------
;
-echo
-# ----- switch to connection con1 (user = test_user) -----
-;
connection con1;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -220,13 +211,7 @@ echo
# Ensure that the user test_user sees all connections with his username.
#----------------------------------------------------------------------------
;
-echo
------ establish connection con2 (user = test_user) ------
-;
connect (con2,localhost,test_user,ddictpass,information_schema);
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
# If the testing box is under heavy load we might see within some of the
# next queries connection
@@ -239,9 +224,6 @@ echo
let $wait_condition= SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE USER = 'test_user' AND COMMAND = 'Sleep' AND STATE = '';
--source include/wait_condition.inc
-echo
-# ----- switch to connection con2 (user = test_user) -----
-;
connection con2;
# Just dump what we get
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME> 9 <TIME_MS> 13 <MEMORY> 14 <ROWS> 15 <QUERY_ID> 17 <TID>
@@ -249,9 +231,6 @@ SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 6 <TIME>
SHOW FULL PROCESSLIST;
#
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
# Pull the ID of con2, we will need it later
SELECT ID INTO @test_user_con2_id FROM INFORMATION_SCHEMA.PROCESSLIST
@@ -263,9 +242,6 @@ echo
# Ensure we get correct information about a connection during work
#----------------------------------------------------------------------------
;
-echo
-# ----- switch to connection con2 (user = test_user) -----
-;
connection con2;
# "Organise" a long running command to be observed by the root user.
echo
@@ -283,9 +259,6 @@ SELECT sleep(10), 17;
send;
eval $sleep_command;
#
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
echo
# Poll till connection con2 is in state 'User sleep'.
@@ -324,17 +297,11 @@ let $wait_timeout= 10;
let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID = @test_user_con2_id AND INFO IS NOT NULL AND TIME > @time;
--source include/wait_condition.inc
-echo
-# ----- switch to connection con2 (user = testuser) -----
-;
connection con2;
echo
# Pull("reap") the result set from the statement executed with "send".
;
reap;
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
echo
# Poll till all connections of 'test_user' are in a state with COMMAND = 'Sleep'
@@ -352,9 +319,6 @@ echo
;
LOCK TABLE test.t1 WRITE;
#
-echo
-# ----- switch to connection con2 (user = test_user) -----
-;
connection con2;
echo
# Send a statement to the server, but do not wait till the result
@@ -362,9 +326,6 @@ echo
;
send
SELECT COUNT(*) FROM test.t1;
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
echo
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
@@ -379,9 +340,6 @@ let $wait_condition= SELECT COUNT(*) FROM INFORMATION_SCHEMA.PROCESSLIST
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
UNLOCK TABLES;
#
-echo
-# ----- switch to connection con2 (user = test_user) -----
-;
connection con2;
echo
# Pull("reap") the result set from the statement executed with "send".
@@ -395,15 +353,9 @@ echo
;
# We do not want to waste runtime, therefore we run the following test based
# on "Lock collision" and not with some "sleep(10)".
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
LOCK TABLE test.t1 WRITE;
#
-echo
-# ----- switch to connection con2 (user = test_user) -----
-;
connection con2;
echo
# Send a long (~20 KB code) statement to the server, but do not wait
@@ -417,9 +369,6 @@ let $my_statement =
SELECT count(*),'$string' AS "Long string" FROM test.t1;
send;
eval $my_statement;
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
echo
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
@@ -441,9 +390,6 @@ SHOW FULL PROCESSLIST;
--replace_column 1 <ID> 3 <HOST_NAME> 5 <COMMAND> 6 <TIME> 7 <STATE>
SHOW PROCESSLIST;
UNLOCK TABLES;
-echo
-# ----- switch to connection con2 (user = test_user) -----
-;
connection con2;
echo
# Pull("reap") the result set from the monster statement executed with "send".
@@ -452,13 +398,7 @@ reap;
# Cleanup
-echo
-# ----- switch to connection default (user = root) -----
-;
connection default;
-echo
------ disconnect con1 and con2 -----
-;
disconnect con1;
disconnect con2;
DROP USER test_user@'localhost';
diff --git a/mysql-test/suite/funcs_1/datadict/statistics.inc b/mysql-test/suite/funcs_1/datadict/statistics.inc
index 00fd7a1b06b..56a291a59bb 100644
--- a/mysql-test/suite/funcs_1/datadict/statistics.inc
+++ b/mysql-test/suite/funcs_1/datadict/statistics.inc
@@ -41,15 +41,12 @@ ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
--replace_column 10 #CARD#
eval $my_select;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,db_datadict);
--replace_column 10 #CARD#
eval $my_select;
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
-
diff --git a/mysql-test/suite/funcs_1/datadict/table_constraints.inc b/mysql-test/suite/funcs_1/datadict/table_constraints.inc
index 9e57976862b..74e4c038876 100644
--- a/mysql-test/suite/funcs_1/datadict/table_constraints.inc
+++ b/mysql-test/suite/funcs_1/datadict/table_constraints.inc
@@ -32,12 +32,10 @@ WHERE table_schema = '$table_schema'
ORDER BY table_schema,table_name,constraint_name;
eval $my_select;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,db_datadict);
eval $my_select;
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
diff --git a/mysql-test/suite/funcs_1/datadict/tables.inc b/mysql-test/suite/funcs_1/datadict/tables.inc
index 5aa072d184c..5c83b11eb66 100644
--- a/mysql-test/suite/funcs_1/datadict/tables.inc
+++ b/mysql-test/suite/funcs_1/datadict/tables.inc
@@ -36,7 +36,6 @@ DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
@@ -46,7 +45,6 @@ SHOW TABLES FROM test1;
SHOW TABLES FROM test2;
--enable_abort_on_error
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
diff --git a/mysql-test/suite/funcs_1/datadict/tables1.inc b/mysql-test/suite/funcs_1/datadict/tables1.inc
index 2e054a9dcfb..36a4ee568f4 100644
--- a/mysql-test/suite/funcs_1/datadict/tables1.inc
+++ b/mysql-test/suite/funcs_1/datadict/tables1.inc
@@ -26,12 +26,10 @@ DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1,localhost,testuser1,,test1);
--source suite/funcs_1/datadict/tables2.inc
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER testuser1@localhost;
diff --git a/mysql-test/suite/funcs_1/r/charset_collation.result b/mysql-test/suite/funcs_1/r/charset_collation.result
index b3183ba48e1..31bd30c5acf 100644
--- a/mysql-test/suite/funcs_1/r/charset_collation.result
+++ b/mysql-test/suite/funcs_1/r/charset_collation.result
@@ -1,6 +1,6 @@
DROP USER dbdict_test@localhost;
CREATE USER dbdict_test@localhost;
-# Establish connection con (user=dbdict_test)
+connect con,localhost,dbdict_test,,;
SELECT *
FROM information_schema.character_sets
@@ -36,5 +36,6 @@ latin1_bin latin1
latin1_general_ci latin1
utf8_bin utf8
utf8_general_ci utf8
-# Switch to connection default + disconnect con
+connection default;
+disconnect con;
DROP USER dbdict_test@localhost;
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
index 1131477869a..2cf079a75f8 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_06.result
@@ -66,6 +66,7 @@ load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -80,6 +81,7 @@ grant all on db_storedproc_1.* to 'user_1'@'localhost';
revoke create routine on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
DROP PROCEDURE IF EXISTS sp1;
+connect user1a, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -88,10 +90,13 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+disconnect user1a;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
+connect user1b, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -99,6 +104,8 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+disconnect user1b;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -114,6 +121,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
+connect user2, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp3(v1 char(20))
@@ -124,6 +132,8 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+disconnect user2;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -146,6 +156,7 @@ CREATE PROCEDURE sp4(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+connect user3, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -167,6 +178,8 @@ SQL_DATA_ACCESS CONTAINS SQL
SECURITY_TYPE DEFINER
SQL_MODE
ROUTINE_COMMENT
+disconnect user3;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp4;
@@ -187,6 +200,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
grant SELECT on db_storedproc_1.* to 'user_2'@'localhost';
grant execute on db_storedproc_1.* to 'user_2'@'localhost';
flush privileges;
+connect user5_1, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp5_s_i () sql security definer
@@ -202,6 +216,8 @@ CREATE PROCEDURE sp5_ins () sql security definer
BEGIN
insert into db_storedproc_1.t3165 values ('inserted', 'from sp5_ins', 1000);
END//
+disconnect user5_1;
+connect user5_2, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -210,12 +226,14 @@ CALL sp5_ins();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+connection default;
root@localhost db_storedproc_1
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
grant insert on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -223,12 +241,14 @@ ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165
CALL sp5_ins();
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+connection default;
root@localhost db_storedproc_1
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
grant SELECT on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -242,10 +262,12 @@ inserted outside of SP NULL
inserted from sp5_ins 2000-10-00
inserted from sp5_s_i 2000-10-00
inserted from sp5_ins 2000-10-00
+connection default;
root@localhost db_storedproc_1
REVOKE INSERT on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -263,10 +285,12 @@ inserted outside of SP NULL
inserted from sp5_ins 2000-10-00
inserted from sp5_s_i 2000-10-00
inserted from sp5_ins 2000-10-00
+connection default;
root@localhost db_storedproc_1
REVOKE SELECT on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -275,6 +299,8 @@ CALL sp5_ins();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+disconnect user5_2;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp5_s_i;
@@ -299,6 +325,7 @@ GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc_1.* TO 'user_2'@'localhost';
GRANT EXECUTE ON db_storedproc_1.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_1, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp3166_s_i () SQL SECURITY INVOKER
@@ -314,6 +341,8 @@ CREATE PROCEDURE sp3166_ins () SQL SECURITY INVOKER
BEGIN
insert into db_storedproc_1.t3166 values ('inserted from sp3166_ins');
END//
+disconnect user6_1;
+connect user6_2, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -325,6 +354,7 @@ ERROR 42000: INSERT command denied to user 'user_2'@'localhost' for table 't3166
CALL sp3166_sel();
c1
inserted outside SP
+connection default;
root@localhost db_storedproc_1
CALL sp3166_sel();
@@ -332,6 +362,8 @@ c1
inserted outside SP
GRANT INSERT ON db_storedproc_1.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+disconnect user6_2;
+connect user6_3, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -343,6 +375,8 @@ c1
inserted outside SP
inserted from sp3166_s_i
inserted from sp3166_ins
+disconnect user6_3;
+connection default;
root@localhost db_storedproc_1
CALL sp3166_sel();
@@ -352,6 +386,7 @@ inserted from sp3166_s_i
inserted from sp3166_ins
REVOKE SELECT ON db_storedproc_1.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_4, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -359,6 +394,8 @@ ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166
CALL sp3166_ins();
CALL sp3166_sel();
ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166'
+disconnect user6_4;
+connection default;
CALL sp3166_s_i();
c1
inserted outside SP
@@ -369,6 +406,7 @@ inserted from sp3166_ins
root@localhost db_storedproc_1
REVOKE EXECUTE on db_storedproc_1.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_5, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -377,6 +415,8 @@ CALL sp3166_ins();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_ins'
CALL sp3166_sel();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_sel'
+disconnect user6_5;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp3166_s_i;
diff --git a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
index d731979a095..0d846a019dd 100644
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
@@ -81,6 +81,7 @@ create user 'user_2'@'localhost';
GRANT CREATE ROUTINE ON db_storedproc.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user2_1, localhost, user_1, , db_storedproc;
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
@@ -93,6 +94,8 @@ DECLARE res INT;
SET res = n * n;
RETURN res;
END//
+disconnect user2_1;
+connect user2_2, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
@@ -111,6 +114,8 @@ fn31105( 9 )
81
GRANT EXECUTE ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+disconnect user2_2;
+connect user2_3, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
@@ -119,6 +124,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+disconnect user2_3;
connection default;
USE db_storedproc;
@@ -131,12 +137,15 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+connect user2_4, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+disconnect user2_4;
+connection default;
USE db_storedproc;
root@localhost db_storedproc
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03.result b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
index 5edef4cf3af..98f599da3e5 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03.result
@@ -86,9 +86,13 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.3.2:
-----------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -96,17 +100,20 @@ use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_2-yes';
+connection default;
select current_user;
current_user
root@localhost
@@ -125,9 +132,11 @@ trig 3.5.3.2_2-yes
Testcase 3.5.3.6:
-----------------
+connection no_privs;
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
@@ -135,8 +144,10 @@ f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
+connection yes_privs;
use priv_db;
drop trigger trg1_2;
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1 order by f1;
@@ -145,7 +156,10 @@ insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
+connection default;
drop trigger trg1_2;
+disconnect no_privs;
+disconnect yes_privs;
Testcase 3.5.3.7a:
------------------
@@ -160,6 +174,9 @@ grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection no_privs_424a;
select current_user;
current_user
test_noprivs@localhost
@@ -175,6 +192,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -184,6 +202,7 @@ insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
+connection yes_privs_424a;
use priv_db;
select current_user;
current_user
@@ -193,6 +212,7 @@ Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
@@ -202,6 +222,8 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
+disconnect no_privs_424a;
+disconnect yes_privs_424a;
Testcase 3.5.3.7b:
------------------
@@ -219,6 +241,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -226,6 +252,7 @@ GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEM
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1 order by f1;
f1
@@ -246,6 +273,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4b_1;
+connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -253,6 +281,7 @@ GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
@@ -274,6 +303,8 @@ trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4b_2;
+disconnect no_privs_424b;
+disconnect yes_privs_424b;
Testcase 3.5.3.7c
-----------------
@@ -291,6 +322,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -298,6 +333,7 @@ GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIE
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -310,6 +346,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4c_1;
+connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -317,6 +354,7 @@ GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1 order by f1;
f1
@@ -329,6 +367,8 @@ trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4c_2;
+disconnect no_privs_424c;
+disconnect yes_privs_424c;
Testcase 3.5.3.7d:
------------------
@@ -344,6 +384,10 @@ grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -351,6 +395,7 @@ GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -364,6 +409,7 @@ trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4d_1;
+connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -371,6 +417,7 @@ GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1 order by f1;
f1
@@ -384,6 +431,8 @@ trig 3.5.3.7-2b
trig 3.5.3.7-2c
trig 3.5.3.7-2d
drop trigger trg4d_2;
+disconnect no_privs_424d;
+disconnect yes_privs_424d;
Testcase 3.5.3.8a:
------------------
@@ -398,6 +447,10 @@ grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425a;
select current_user;
current_user
test_noprivs@localhost
@@ -407,6 +460,7 @@ Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
+connection default;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
@@ -417,6 +471,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1a
drop trigger trg5a_1;
+connection yes_privs_425a;
use priv_db;
select current_user;
current_user
@@ -426,6 +481,7 @@ Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
@@ -435,6 +491,8 @@ select @test_var;
@test_var
insert 3.5.3.8-2a
drop trigger trg5a_2;
+disconnect no_privs_425a;
+disconnect yes_privs_425a;
Testcase: 3.5.3.8b
------------------
@@ -453,6 +511,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -460,6 +522,7 @@ GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEM
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@@ -471,6 +534,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1b
drop trigger trg5b_1;
+connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -478,6 +542,7 @@ GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-2b';
insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@@ -488,6 +553,8 @@ select @test_var;
@test_var
update 3.5.3.8-2b
drop trigger trg5b_2;
+disconnect no_privs_425b;
+disconnect yes_privs_425b;
Testcase 3.5.3.8c:
------------------
@@ -506,6 +573,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -513,6 +584,7 @@ GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIE
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
@@ -520,6 +592,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1c
drop trigger trg5c_1;
+connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -527,12 +600,15 @@ GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-2c';
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
insert 3.5.3.8-2c
drop trigger trg5c_2;
+disconnect no_privs_425c;
+disconnect yes_privs_425c;
Testcase: 3.5.3.8d:
-------------------
@@ -550,6 +626,10 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -557,6 +637,7 @@ GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
@@ -564,6 +645,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1d
drop trigger trg5d_1;
+connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -571,6 +653,7 @@ GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-2d';
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@@ -594,12 +677,15 @@ Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection yes_353x;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1 before insert on t1 for each row
insert into t2 values (new.f1);
+connection default;
use priv_db;
insert into t1 (f1) values (4);
ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -612,10 +698,12 @@ f1
select f2 from t2 order by f2;
f2
4
+connection yes_353x;
use priv_db;
drop trigger trg1;
create trigger trg2 before insert on t1 for each row
update t2 set f2=new.f1-1;
+connection default;
use priv_db;
insert into t1 (f1) values (2);
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -629,10 +717,12 @@ f1
select f2 from t2 order by f2;
f2
1
+connection yes_353x;
use priv_db;
drop trigger trg2;
create trigger trg3 before insert on t1 for each row
select f2 into @aaa from t2 where f2=new.f1;
+connection default;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -650,10 +740,12 @@ f2
select @aaa;
@aaa
1
+connection yes_353x;
use priv_db;
drop trigger trg3;
create trigger trg4 before insert on t1 for each row
delete from t2;
+connection default;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table 't2'
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
index 6d8bba4714b..e44e17c6392 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_03e.result
@@ -24,6 +24,7 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
--------------------------------------------
@@ -31,11 +32,13 @@ use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv_db;
insert into t1 (f1) values ('insert-yes');
select f1 from t1 order by f1;
f1
insert-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -47,12 +50,14 @@ GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
-----------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -62,6 +67,7 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for colum
select f1 from t1 order by f1;
f1
insert-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -72,6 +78,7 @@ select f1 from t1 order by f1;
f1
insert-yes
trig 1_2-yes
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -82,6 +89,7 @@ f1
insert-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -93,12 +101,14 @@ GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
no trigger privilege on db level for drop:
------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -116,10 +126,12 @@ trig 1_2-yes
trigger privilege at activation time:
-------------------------------------
+connection default;
select current_user;
current_user
root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -134,6 +146,7 @@ trig 1_2-yes
trigger privilege on db level for drop:
---------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -148,6 +161,7 @@ takes effect after use priv_db:
-------------------------------
use priv_db;
drop trigger trg1_2;
+connection default;
select current_user;
current_user
root@localhost
@@ -174,6 +188,7 @@ GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
use db with trigger privilege on db level and without...:
---------------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -191,6 +206,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
use priv_db;
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -216,6 +232,8 @@ trig 1_2-yes
trig 1_2-yes
trig 1_3-yes
trig 1_3-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -229,6 +247,8 @@ drop trigger trg1_4;
ERROR HY000: Trigger does not exist
use priv_db;
drop trigger trg1_4;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -251,9 +271,12 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on table level for create:
-----------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -269,6 +292,7 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -279,6 +303,7 @@ t1
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -287,6 +312,7 @@ insert into t1 (f1) values ('insert1-yes');
select f1 from t1 order by f1;
f1
insert1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -308,6 +334,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
trigger privilege on table level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -315,6 +342,7 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -324,6 +352,7 @@ f1
insert1-yes
insert2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -342,6 +371,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
no trigger privilege on table level for drop:
---------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -350,6 +380,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
no trigger privilege at activation time:
----------------------------------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -361,6 +392,7 @@ insert1-yes
insert2-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -368,6 +400,7 @@ grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
trigger privilege at activation time:
-------------------------------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -382,6 +415,7 @@ trig 1_2-yes
trigger privilege on table level for drop:
------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -390,6 +424,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
drop trigger trg1_2;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -402,6 +437,7 @@ insert7-yes
trig 1_2-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -434,6 +470,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
use table with trigger privilege and without...:
------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -451,6 +488,7 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -469,6 +507,8 @@ trig 1_2-yes
trig 1_2-yes
trig 1_2-yes
trig 1_3-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -478,6 +518,8 @@ drop trigger trg1_3;
drop trigger trg2_2;
ERROR HY000: Trigger does not exist
drop trigger trg1_4;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -509,6 +551,9 @@ grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -532,6 +577,7 @@ f1
trig 1_1-yes
trig 1_1-yes
drop trigger priv_db.trg1_5;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -542,6 +588,7 @@ f1
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -557,6 +604,8 @@ revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+disconnect yes_privs;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_yesprivs@localhost
@@ -567,6 +616,7 @@ select * from information_schema.triggers;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -579,12 +629,14 @@ use priv_db;
no trigger privilege on db level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -597,6 +649,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -608,6 +661,7 @@ GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
-----------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -625,6 +679,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger priv_db.trg1_9 before UPDATE on priv_db.t1
for each row
set new.f1 = 'trig 1_9-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -645,6 +700,7 @@ f1
insert-yes
drop trigger priv_db.trg1_9;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -665,6 +721,7 @@ grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -672,6 +729,7 @@ use no_priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -692,12 +750,16 @@ select f1 from t1 order by f1;
f1
insert-yes
insert-yes
+disconnect yes_privs;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_yesprivs@localhost
use no_priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+disconnect yes_privs;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -720,6 +782,8 @@ f1
insert-yes
insert-yes
trig 1_2-yes
+disconnect no_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -760,11 +824,14 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
trigger privilege on one db1 db level, not on db2
-------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -777,6 +844,7 @@ use priv2_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig1_1-yes';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -811,6 +879,7 @@ trig 2_1-yes
revoke trigger privilege on table level (not existing)
------------------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -822,6 +891,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -832,6 +902,7 @@ ERROR HY000: Trigger does not exist
use priv1_db;
drop trigger trg1_1;
drop trigger trg2_1;
+connection default;
select current_user;
current_user
root@localhost
@@ -840,6 +911,7 @@ revoke TRIGGER on priv1_db.* from test_yesprivs@localhost;
no trigger privilege on table level for create:
-----------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -847,6 +919,7 @@ use priv1_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -862,6 +935,7 @@ GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
trigger privilege on table level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -872,6 +946,7 @@ set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
set new.f1 = 'trig 2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -894,6 +969,7 @@ f1
insert1_yes
insert21-yes
insert22-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -904,6 +980,7 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -913,6 +990,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
use priv1_db;
create trigger trg2_1 before INSERT on t2 for each row
set new.f1 = 'trig 2_1-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -948,11 +1026,15 @@ trig 2_1-yes
trig 2_1-yes
trig 2_1-yes
trig 2_1-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
drop trigger trg1_2;
drop trigger trg2_1;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -973,6 +1055,8 @@ create User test_useprivs@localhost;
set password for test_useprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_useprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -987,6 +1071,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1000,6 +1085,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert2-no'')';
+connect use_privs,localhost,test_useprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_useprivs@localhost
@@ -1010,6 +1096,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1018,6 +1105,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1028,6 +1116,7 @@ f1
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert4-no'')';
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1038,6 +1127,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1046,6 +1136,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1056,6 +1147,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert6-no'')';
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1067,6 +1159,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert7-no'')';
+connection default;
select current_user;
current_user
root@localhost
@@ -1075,6 +1168,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1086,6 +1180,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1097,6 +1192,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1105,6 +1201,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1116,6 +1213,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1128,6 +1226,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1136,6 +1235,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1150,6 +1250,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
deallocate prepare ins1;
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1164,6 +1265,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
deallocate prepare ins1;
+connection default;
select current_user;
current_user
root@localhost
@@ -1172,13 +1274,17 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
drop trigger trg1_1;
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1195,6 +1301,8 @@ create table t1 (f1 char(20)) engine= innodb;
create User test_yesprivs@localhost;
set password for test_yesprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -1209,6 +1317,7 @@ before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
grant select, insert, update
on priv_db.t1 to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1219,6 +1328,7 @@ select f1 from t1 order by f1;
f1
drop trigger trg1_0;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -1228,6 +1338,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1256,11 +1367,13 @@ select f1 from t1 order by f1;
f1
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
grant trigger on priv_db.* to test_yesprivs@localhost
with grant option;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1273,9 +1386,12 @@ create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1291,6 +1407,8 @@ create table t1 (f1 char(20)) engine= innodb;
create User test_yesprivs@localhost;
set password for test_yesprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -1300,6 +1418,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1329,9 +1448,12 @@ ERROR HY000: Trigger does not exist
drop trigger trg1_2;
commit work;
set autocommit=1;
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1362,9 +1484,12 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
update only on column:
----------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1372,6 +1497,7 @@ grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t1
to test_yesprivs@localhost;
grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t2
to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1382,6 +1508,7 @@ create trigger trg1_1 before UPDATE on t1 for each row
set new.f1 = 'trig 1_1-yes';
create trigger trg2_1 before UPDATE on t2 for each row
set new.f1 = 'trig 2_1-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1402,6 +1529,7 @@ update t2 set f1 = 'update1_no'
select f1 from t2 order by f1;
f1
trig 2_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1415,12 +1543,14 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
insert into t1 (f1) values ('insert2-yes');
insert into t2 (f1) values ('insert2-yes');
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1446,6 +1576,7 @@ trig 2_1-yes
check if access only on one of three columns
--------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1453,6 +1584,7 @@ alter table priv_db.t1 add f2 char(20), add f3 int;
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
grant TRIGGER,SELECT on priv_db.t1 to test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1465,6 +1597,7 @@ insert2-yes insert2-yes 1
insert3-yes insert3-yes 2
trig 1_1-yes NULL NULL
trig 1_1-yes NULL NULL
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1479,11 +1612,13 @@ trig 1_1-yes NULL NULL
trig 1_1-yes NULL NULL
trig 1_1-yes update4-yes 10
trig 1_1-yes update4-yes 20
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
create trigger trg1_2 after UPDATE on t1 for each row
set @f2 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1522,10 +1657,12 @@ trig 2_1-yes
check if rejected without trigger privilege:
--------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1545,6 +1682,7 @@ trig 1_2-yes
check trigger, but not update privilege on column:
--------------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1556,6 +1694,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1563,6 +1702,7 @@ use priv_db;
drop trigger trg1_1;
create trigger trg1_3 before UPDATE on t1 for each row
set new.f1 = 'trig 1_3-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1585,6 +1725,7 @@ NULL
NULL
10
20
+connection default;
select current_user;
current_user
root@localhost
@@ -1596,6 +1737,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1613,6 +1755,9 @@ NULL
------------------------------------------------
grant TRIGGER(f1) on priv_db.t1 to test_yesprivs@localhost;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(f1) on priv_db.t1 to test_yesprivs@localhost' at line 1
+disconnect yes_privs;
+disconnect no_privs;
+connection default;
select current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
index c51347d5fa8..d450096176d 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_0407.result
@@ -69,13 +69,18 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+connect con1_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con1_super,localhost,test_super,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.4:
---------------
+connection default;
use test;
Testcase 3.5.4.1:
-----------------
+connection con1_super;
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
@@ -83,28 +88,33 @@ grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
+connection con1_general;
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
+connection con1_super;
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where trigger_schema = 'db_drop'
order by trigger_name;
trigger_schema trigger_name event_object_table
+connection con1_general;
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
+connection con1_super;
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.2:
-----------------
+connection con1_super;
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
@@ -116,6 +126,7 @@ drop database if exists db_drop2;
Testcase 3.5.4.3:
-----------------
+connection con1_super;
create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
@@ -139,17 +150,20 @@ drop database if exists db_drop3;
Testcase 3.5.4.4:
-----------------
+connection con1_super;
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
+connection con1_general;
Use db_drop4;
Insert into t1 values ('Insert 3.5.4.4');
Select * from t1;
f1
Trigger 3.5.4.4
+connection con1_super;
Drop database db_drop4;
Show databases like 'db_drop4';
Database (db_drop4)
@@ -161,10 +175,12 @@ create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
+connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
f1
2nd Insert 3.5.4.4
+connection con1_super;
drop trigger trg4;
ERROR HY000: Trigger does not exist
drop database if exists db_drop4;
@@ -172,17 +188,20 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.5:
-----------------
+connection con1_super;
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
+connection con1_general;
Use db_drop5;
Insert into t1 values ('Insert 3.5.4.5');
Select * from t1;
f1
Trigger 3.5.4.5
+connection con1_super;
Drop table t1;
Show tables;
Tables_in_db_drop5
@@ -192,10 +211,12 @@ where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
+connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
f1
2nd Insert 3.5.4.5
+connection con1_super;
drop trigger trg5;
ERROR HY000: Trigger does not exist
drop database if exists db_drop5;
@@ -203,6 +224,7 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.5:
---------------
+connection default;
use test;
Testcase 3.5.5.1:
@@ -228,6 +250,7 @@ drop view vw3;
Testcase 3.5.5.4:
-----------------
+connection con1_super;
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
@@ -238,6 +261,7 @@ on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
ERROR HY000: Trigger in wrong schema
grant INSERT, SELECT on dbtest_two.t2 to test_general;
grant SELECT on dbtest_one.* to test_general;
+connection con1_general;
use dbtest_two;
Insert into t2 values ('1st Insert 3.5.5.4');
Warnings:
@@ -253,12 +277,14 @@ Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
+connection con1_super;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
DROP DATABASE if exists dbtest_one;
drop database if EXISTS dbtest_two;
Testcase 3.5.6:
---------------
+connection default;
use test;
Testcase 3.5.6.1 (see Testcase 3.5.1.1)
@@ -466,6 +492,7 @@ delete from tb3 where f121='Test 3.5.7.15/16';
Testcase 3.5.7.17 (see Testcase 3.5.1.1)
----------------------------------------
+connection default;
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
diff --git a/mysql-test/suite/funcs_1/r/innodb_trig_08.result b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
index 20354088a0f..a45a31c31bd 100644
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
@@ -69,6 +69,9 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+connect con2_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con2_super,localhost,test_super,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.8.1: (implied in previous tests)
---------------------------------------------
@@ -78,6 +81,7 @@ Testcase 3.5.8.2: (implied in previous tests)
Testcase 3.5.8.3/4:
-------------------
+connection con2_super;
create database db_test;
grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
grant LOCK TABLES on db_test.* to test_general;
@@ -124,6 +128,7 @@ delete from db_test.t1_d where d136= new.f136;
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
END//
+connection con2_general;
Use test;
set @test_var=0;
Insert into tb3 (f120, f122, f136, f144, f163)
@@ -153,11 +158,13 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
+connection con2_super;
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
+connection con2_general;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
@@ -176,11 +183,13 @@ I 00222 0000023456 1.050000000000000000000000000000
3.5.8.4 - single SQL - update
-----------------------------
+connection con2_super;
drop trigger trg2;
Create trigger trg3 BEFORE UPDATE on tb3 for each row
update db_test.t1_u
set u120=new.f120
where u136=new.f136;
+connection con2_general;
update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
where f122='Test 3.5.8.4-Single Insert';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
@@ -197,9 +206,11 @@ U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
+connection con2_super;
drop trigger trg3;
Create trigger trg4 AFTER UPDATE on tb3 for each row
delete from db_test.t1_d where d136= new.f136;
+connection con2_general;
update tb3 set f120='D', f136=444,
f122='Test 3.5.8.4-Single Delete'
where f122='Test 3.5.8.4-Single Update';
@@ -213,10 +224,12 @@ c 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - select
-------------------------------
+connection con2_super;
drop trigger trg4;
Create trigger trg5 AFTER UPDATE on tb3 for each row
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
+connection con2_general;
set @test_var=0;
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.4-Single Select'
@@ -227,6 +240,7 @@ S Test 3.5.8.4-Single Select 00111 0000023456 1.050000000000000000000000000000
select @test_var;
@test_var
999.990000000000000000000000000000
+connection default;
drop trigger trg1;
drop trigger trg5;
drop database if exists db_test;
@@ -519,6 +533,7 @@ Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+connection default;
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
diff --git a/mysql-test/suite/funcs_1/r/is_basics_mixed.result b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
index 3ac17803688..2d14ada4f89 100644
--- a/mysql-test/suite/funcs_1/r/is_basics_mixed.result
+++ b/mysql-test/suite/funcs_1/r/is_basics_mixed.result
@@ -4,7 +4,7 @@ information_schema
#######################################################################
# Testcase 3.2.1.20: USE INFORMATION_SCHEMA is supported
#######################################################################
-# Switch to connection default
+connection default;
USE test;
SELECT DATABASE();
DATABASE()
@@ -15,7 +15,7 @@ DATABASE()
information_schema
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
SELECT DATABASE();
DATABASE()
test
@@ -23,7 +23,8 @@ USE information_schema;
SELECT DATABASE();
DATABASE()
information_schema
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER 'testuser1'@'localhost';
#######################################################################
# Testcase TBD1: The INFORMATION_SCHEMA cannot be dropped.
@@ -38,7 +39,7 @@ ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_
##################################################################################
# Testcase 3.2.1.6+3.2.1.7: No user may create an INFORMATION_SCHEMA table or view
##################################################################################
-# Switch to connection default (user=root)
+connection default;
USE information_schema;
CREATE TABLE schemata ( c1 INT );
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
@@ -128,7 +129,7 @@ GRANT ALL ON *.* TO testuser1@localhost;
SHOW GRANTS FOR testuser1@localhost;
Grants for testuser1@localhost
GRANT ALL PRIVILEGES ON *.* TO 'testuser1'@'localhost'
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
USE information_schema;
CREATE TABLE schemata ( c1 INT );
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
@@ -212,7 +213,8 @@ SELECT * FROM information_schema.tables;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
CREATE VIEW information_schema.v1 AS SELECT 'garbage';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'information_schema'
-# Switch to connection default (user=root) and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER 'testuser1'@'localhost';
###############################################################################
# Testcase 3.2.1.1+3.2.1.2: INFORMATION_SCHEMA tables can be queried via SELECT
@@ -324,7 +326,7 @@ GRANT SELECT on information_schema.* TO testuser1@localhost;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
GRANT CREATE VIEW ON information_schema.* TO 'u_6_401018'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT table_schema,table_name FROM information_schema.tables
WHERE table_schema = 'information_schema' AND table_name = 'tables';
table_schema table_name
@@ -349,7 +351,7 @@ TABLE_SCHEMA TABLE_NAME TABLE_TYPE
db_datadict t1 BASE TABLE
db_datadict v2 VIEW
GRANT SELECT ON db_datadict.v2 to testuser2@localhost;
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM db_datadict.v2;
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
@@ -358,7 +360,9 @@ SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
TABLE_SCHEMA TABLE_NAME TABLE_TYPE
db_datadict v2 VIEW
-# Switch to connection default and close connections testuser1 and testuser2
+connection default;
+disconnect testuser1;
+disconnect testuser2;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP DATABASE db_datadict;
@@ -533,7 +537,7 @@ db_datadict
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
GRANT ALL ON test.* TO 'testuser1'@'localhost';
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
SELECT DISTINCT table_schema FROM information_schema.columns
WHERE table_schema LIKE 'db_data%';
table_schema
@@ -573,7 +577,8 @@ trigger_schema event_object_schema
SELECT DISTINCT table_schema FROM information_schema.views
WHERE table_schema LIKE 'db_data%';
table_schema
-# Switch to connection default and close connections testuser1 and testuser2
+connection default;
+disconnect testuser1;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges.result b/mysql-test/suite/funcs_1/r/is_column_privileges.result
index a57970dbcaa..a56ef002935 100644
--- a/mysql-test/suite/funcs_1/r/is_column_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_column_privileges.result
@@ -105,7 +105,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict t1 f3 UPDATE YES
'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
'testuser3'@'localhost' def db_datadict t1 f3 SELECT YES
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -115,13 +115,13 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser1'@'localhost' def db_datadict t1 f2 UPDATE YES
'testuser1'@'localhost' def db_datadict t1 f3 SELECT YES
'testuser1'@'localhost' def db_datadict t1 f3 UPDATE YES
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , db_datadict;
# FIXME: Is it correct that granted TABLES do not occur in COLUMN_PRIVILEGES?
SELECT * FROM information_schema.table_privileges
WHERE grantee LIKE '''testuser%'''
@@ -163,7 +163,7 @@ WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRANTABLE
'testuser3'@'localhost' def db_datadict t1 f3 SELECT YES
-# Switch to connection testuser2 (user=testuser2)
+connection testuser2;
SELECT * FROM information_schema.column_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -171,7 +171,10 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME PRIVILEGE_TYPE IS_GRAN
'testuser2'@'localhost' def db_datadict t1 f1 SELECT NO
'testuser2'@'localhost' def db_datadict t1 f2 SELECT NO
'testuser2'@'localhost' def db_datadict t1 f3 SELECT NO
-# Switch to connection default and close connections testuser1,testuser2,testuser3
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
DROP DATABASE db_datadict;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
@@ -194,7 +197,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -203,7 +206,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-# Switch to connection default
+connection default;
GRANT SELECT (f1,f3) ON db_datadict.my_table TO 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -216,7 +219,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -228,7 +231,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection default
+connection default;
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
@@ -243,7 +246,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -258,7 +261,7 @@ GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
SELECT f1, f3 FROM db_datadict.my_table;
ERROR 42S22: Unknown column 'f3' in 'field list'
-# Switch to connection default
+connection default;
ALTER TABLE db_datadict.my_table CHANGE COLUMN f1 my_col BIGINT;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -272,7 +275,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -285,7 +288,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection default
+connection default;
DROP TABLE db_datadict.my_table;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -299,7 +302,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -312,7 +315,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
GRANT SELECT (f3, f1), UPDATE (f1) ON `db_datadict`.`my_table` TO 'testuser1'@'localhost'
-# Switch to connection default
+connection default;
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
@@ -322,7 +325,7 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.column_privileges
WHERE table_name = 'my_table'
ORDER BY grantee, table_schema,table_name,column_name,privilege_type;
@@ -331,7 +334,8 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT ALL PRIVILEGES ON `test`.* TO 'testuser1'@'localhost'
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
########################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_column_privileges_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_column_privileges_is_mysql_test.result
index acf26587004..1492bd26b5d 100644
--- a/mysql-test/suite/funcs_1/r/is_column_privileges_is_mysql_test.result
+++ b/mysql-test/suite/funcs_1/r/is_column_privileges_is_mysql_test.result
@@ -19,7 +19,7 @@ mysql
SHOW DATABASES LIKE 'test';
Database (test)
test
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.column_privileges
WHERE table_schema IN ('information_schema','mysql','test')
ORDER BY table_schema, table_name, column_name;
@@ -32,6 +32,6 @@ Database (mysql)
SHOW DATABASES LIKE 'test';
Database (test)
test
-# Switch to connection default and close connection testuser1
+connection default;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_columns.result b/mysql-test/suite/funcs_1/r/is_columns.result
index ada8110d229..ff833b092d1 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -147,7 +147,7 @@ SHOW COLUMNS FROM db_datadict.v1;
Field Type Null Key Default Extra
f1 int(1) NO 0
f2 int(1) NO 0
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
@@ -164,7 +164,7 @@ ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 't2
SHOW COLUMNS FROM db_datadict.v1;
Field Type Null Key Default Extra
f2 int(1) NO 0
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.columns
WHERE table_schema = 'db_datadict'
ORDER BY table_schema, table_name, ordinal_position;
@@ -179,7 +179,9 @@ f1 char(10) NO PRI NULL
f2 text YES NULL
SHOW COLUMNS FROM db_datadict.v1;
ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'v1'
-# Switch to connection default and close connections testuser1, testuser2
+connection default;
+disconnect testuser1;
+disconnect testuser2;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP DATABASE IF EXISTS db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_key_column_usage.result b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
index e27b4d06d25..79310904d0f 100644
--- a/mysql-test/suite/funcs_1/r/is_key_column_usage.result
+++ b/mysql-test/suite/funcs_1/r/is_key_column_usage.result
@@ -170,21 +170,23 @@ table_catalog, table_schema, table_name, ordinal_position;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.key_column_usage
WHERE table_name LIKE 't1_%'
ORDER BY constraint_catalog, constraint_schema, constraint_name,
table_catalog, table_schema, table_name, ordinal_position;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
def db_datadict PRIMARY def db_datadict t1_1 f1 1 NULL NULL NULL NULL
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.key_column_usage
WHERE table_name LIKE 't1_%'
ORDER BY constraint_catalog, constraint_schema, constraint_name,
table_catalog, table_schema, table_name, ordinal_position;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSITION POSITION_IN_UNIQUE_CONSTRAINT REFERENCED_TABLE_SCHEMA REFERENCED_TABLE_NAME REFERENCED_COLUMN_NAME
def db_datadict PRIMARY def db_datadict t1_2 f1 1 NULL NULL NULL NULL
-# Switch to connection default and close connections testuser1, testuser2
+connection default;
+disconnect testuser1;
+disconnect testuser2;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP TABLE t1_1;
diff --git a/mysql-test/suite/funcs_1/r/is_routines.result b/mysql-test/suite/funcs_1/r/is_routines.result
index 525b5c92a68..0afb6a3a7ae 100644
--- a/mysql-test/suite/funcs_1/r/is_routines.result
+++ b/mysql-test/suite/funcs_1/r/is_routines.result
@@ -187,19 +187,22 @@ GRANT EXECUTE ON PROCEDURE db_datadict_2.sp_6_408002_2
TO 'testuser2'@'localhost';
GRANT EXECUTE ON db_datadict_2.* TO 'testuser2'@'localhost';
FLUSH PRIVILEGES;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.routines;
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
sp_6_408002_1 def db_datadict sp_6_408002_1 PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.routines;
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
sp_6_408002_2 def db_datadict_2 sp_6_408002_2 PROCEDURE NULL NULL NULL NULL NULL NULL NULL NULL SQL NULL NULL NULL SQL NO CONTAINS SQL NULL DEFINER YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.routines;
SPECIFIC_NAME ROUTINE_CATALOG ROUTINE_SCHEMA ROUTINE_NAME ROUTINE_TYPE DATA_TYPE CHARACTER_MAXIMUM_LENGTH CHARACTER_OCTET_LENGTH NUMERIC_PRECISION NUMERIC_SCALE DATETIME_PRECISION CHARACTER_SET_NAME COLLATION_NAME DTD_IDENTIFIER ROUTINE_BODY ROUTINE_DEFINITION EXTERNAL_NAME EXTERNAL_LANGUAGE PARAMETER_STYLE IS_DETERMINISTIC SQL_DATA_ACCESS SQL_PATH SECURITY_TYPE CREATED LAST_ALTERED SQL_MODE ROUTINE_COMMENT DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
-# Switch to connection default and close connections testuser1,testuser2,testuser3
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges.result b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
index 9d4b2a537d6..cf9b70308de 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges.result
@@ -104,7 +104,7 @@ GRANT INSERT ON db_datadict_2.t1 TO 'testuser1'@'localhost';
GRANT SELECT ON db_datadict_4.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT ON db_datadict_3.* TO 'testuser2'@'localhost';
GRANT SELECT ON db_datadict_1.* TO 'testuser2'@'localhost';
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
GRANT SELECT ON db_datadict_4.* TO 'testuser2'@'localhost';
# Root granted INSERT db_datadict_1 to me -> visible
# Root granted SELECT db_datadict_1 to testuser2 -> invisible
@@ -128,7 +128,7 @@ GRANT SELECT ON `db_datadict_4`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT INSERT ON `db_datadict_2`.`t1` TO 'testuser1'@'localhost'
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , test;
# Root granted SELECT db_datadict_1 to me -> visible
# Root granted INSERT db_datadict_1 to testuser1 -> invisible
# Root granted INSERT db_datadict_2.t1 but not db_datadict_1 to testuser1 -> invisible
@@ -149,7 +149,9 @@ GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_3`.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_1`.* TO 'testuser2'@'localhost'
GRANT SELECT ON `db_datadict_4`.* TO 'testuser2'@'localhost'
-# Switch to connection default and close connections testuser1 and testuser2
+connection default;
+disconnect testuser1;
+disconnect testuser2;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema LIKE 'db_datadict%'
ORDER BY grantee,table_schema,privilege_type;
@@ -189,25 +191,24 @@ SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
-# Switch to connection default
+connection default;
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict UPDATE NO
-# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict UPDATE NO
-# Switch to connection default
+connection default;
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
@@ -215,7 +216,6 @@ ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT NO
'testuser1'@'localhost' def db_datadict UPDATE NO
-# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
@@ -223,6 +223,7 @@ GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT NO
'testuser1'@'localhost' def db_datadict UPDATE NO
# Switch to connection default
+connection default;
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
@@ -230,14 +231,13 @@ ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT YES
'testuser1'@'localhost' def db_datadict UPDATE YES
-# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT YES
'testuser1'@'localhost' def db_datadict UPDATE YES
-# Switch to connection default
+connection default;
DROP SCHEMA db_datadict;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
@@ -245,48 +245,45 @@ ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT YES
'testuser1'@'localhost' def db_datadict UPDATE YES
-# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT YES
'testuser1'@'localhost' def db_datadict UPDATE YES
-# Switch to connection default
+connection default;
REVOKE UPDATE ON db_datadict.* FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT YES
-# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'testuser1'@'localhost' def db_datadict SELECT YES
-# Switch to connection default
+connection default;
RENAME USER 'testuser1'@'localhost' TO 'the_user'@'localhost';
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'the_user'@'localhost' def db_datadict SELECT YES
-# Switch to connection testuser1
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'the_user'@'localhost' def db_datadict SELECT YES
-# Close connection testuser1
-# Establish connection the_user (user=the_user)
+disconnect testuser1;
+connect the_user, localhost, the_user, , test;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
GRANTEE TABLE_CATALOG TABLE_SCHEMA PRIVILEGE_TYPE IS_GRANTABLE
'the_user'@'localhost' def db_datadict SELECT YES
-# Close connection the_user
-# Switch to connection default
+disconnect the_user;
+connection default;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema = 'db_datadict'
ORDER BY grantee,table_schema,privilege_type;
diff --git a/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
index a55d3ea8e4d..38257899a4b 100644
--- a/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
+++ b/mysql-test/suite/funcs_1/r/is_schema_privileges_is_mysql_test.result
@@ -35,7 +35,7 @@ mysql
SHOW DATABASES LIKE 'test';
Database (test)
test
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.schema_privileges
WHERE table_schema IN ('information_schema','mysql','test')
ORDER BY grantee, table_schema, privilege_type;
@@ -48,6 +48,6 @@ Database (mysql)
SHOW DATABASES LIKE 'test';
Database (test)
test
-# Switch to connection default and close connection testuser1
+connection default;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_schemata.result b/mysql-test/suite/funcs_1/r/is_schemata.result
index 92e01814b0e..d0f2b734f7e 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata.result
@@ -83,7 +83,7 @@ SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict_1;
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
@@ -91,7 +91,7 @@ def db_datadict_1 latin1 latin1_swedish_ci NULL
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict_2;
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
@@ -101,13 +101,16 @@ SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
db_datadict_1
db_datadict_2
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.schemata
WHERE schema_name LIKE 'db_datadict_%' ORDER BY schema_name;
CATALOG_NAME SCHEMA_NAME DEFAULT_CHARACTER_SET_NAME DEFAULT_COLLATION_NAME SQL_PATH
SHOW DATABASES LIKE 'db_datadict_%';
Database (db_datadict_%)
-# Switch to connection default and close connections testuser1,testuser2,testuser3
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result b/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
index b4c8e465c71..0679142bd82 100644
--- a/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
+++ b/mysql-test/suite/funcs_1/r/is_schemata_is_mysql_test.result
@@ -22,7 +22,7 @@ mysql
SHOW DATABASES LIKE 'test';
Database (test)
test
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.schemata
WHERE schema_name IN ('information_schema','mysql','test')
ORDER BY schema_name;
@@ -37,6 +37,6 @@ Database (mysql)
SHOW DATABASES LIKE 'test';
Database (test)
test
-# Switch to connection default and close connection testuser1
+connection default;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics.result b/mysql-test/suite/funcs_1/r/is_statistics.result
index e800d9b63fd..f58c3e56772 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics.result
@@ -195,7 +195,7 @@ GRANT USAGE ON *.* TO 'testuser1'@'localhost'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
@@ -205,7 +205,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , test;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
@@ -215,7 +215,7 @@ ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-# Switch to connection default
+connection default;
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost';
SELECT * FROM information_schema.statistics
@@ -240,7 +240,7 @@ GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
@@ -258,7 +258,7 @@ GRANT SELECT ON `db_datadict`.`t1` TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
SHOW GRANTS FOR 'testuser2'@'localhost';
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'mysql'
-# Switch to connection testuser2
+connection testuser2;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
@@ -268,13 +268,13 @@ ERROR 42000: Access denied for user 'testuser2'@'localhost' to database 'mysql'
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
-# Switch to connection default
+connection default;
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.statistics
WHERE table_schema LIKE 'db_datadict%'
ORDER BY table_schema,table_name,index_name,seq_in_index,column_name;
@@ -287,7 +287,9 @@ SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT (f5, f1) ON `db_datadict_2`.`t3` TO 'testuser1'@'localhost'
-# Switch to connection default and close connections testuser1, testuser2
+connection default;
+disconnect testuser1;
+disconnect testuser2;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_is.result b/mysql-test/suite/funcs_1/r/is_statistics_is.result
index f04a5e4c515..a4fe6054d0e 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_is.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_is.result
@@ -7,11 +7,12 @@ SELECT * FROM information_schema.statistics
WHERE table_schema = 'information_schema'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.statistics
WHERE table_schema = 'information_schema'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
index c9e21a12663..dc3ed5f9839 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql.result
@@ -79,11 +79,12 @@ def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL
def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME NON_UNIQUE INDEX_SCHEMA INDEX_NAME SEQ_IN_INDEX COLUMN_NAME COLLATION CARDINALITY SUB_PART PACKED NULLABLE INDEX_TYPE COMMENT INDEX_COMMENT
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
index dbe786d39ef..cbc9a8f17ce 100644
--- a/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_statistics_mysql_embedded.result
@@ -79,7 +79,7 @@ def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL
def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.statistics
WHERE table_schema = 'mysql'
ORDER BY table_schema, table_name, index_name, seq_in_index, column_name;
@@ -156,6 +156,7 @@ def mysql time_zone_transition_type 0 mysql PRIMARY 1 Time_zone_id A #CARD# NULL
def mysql time_zone_transition_type 0 mysql PRIMARY 2 Transition_type_id A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 1 Host A #CARD# NULL NULL BTREE
def mysql user 0 mysql PRIMARY 2 User A #CARD# NULL NULL BTREE
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints.result b/mysql-test/suite/funcs_1/r/is_table_constraints.result
index ea2dd5ccd98..37fcce5ae42 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints.result
@@ -127,7 +127,7 @@ SHOW INDEXES FROM db_datadict.t2;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t2 0 PRIMARY 1 f1 ### ### ### ### ### ### ###
t2 0 PRIMARY 2 f2 ### ### ### ### ### ### ###
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SHOW GRANTS FOR 'testuser1'@'localhost';
Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
@@ -148,7 +148,8 @@ t1 0 my_idx1 2 f1 ### ### ### ### ### ### ###
t1 0 my_idx2 1 f3 ### ### ### ### ### ### ###
SHOW INDEXES FROM db_datadict.t2;
ERROR 42000: SELECT command denied to user 'testuser1'@'localhost' for table 't2'
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
#########################################################################################
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_is.result b/mysql-test/suite/funcs_1/r/is_table_constraints_is.result
index 78724caa175..2a5fff26b88 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_is.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_is.result
@@ -7,11 +7,12 @@ SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'information_schema'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'information_schema'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
index 05df41570cf..e54de0671a2 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql.result
@@ -38,11 +38,12 @@ def mysql PRIMARY mysql time_zone_name PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
def mysql PRIMARY mysql user PRIMARY KEY
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
CONSTRAINT_CATALOG CONSTRAINT_SCHEMA CONSTRAINT_NAME TABLE_SCHEMA TABLE_NAME CONSTRAINT_TYPE
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
index fd13d67f07c..58a2373b66d 100644
--- a/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_table_constraints_mysql_embedded.result
@@ -38,7 +38,7 @@ def mysql PRIMARY mysql time_zone_name PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
def mysql PRIMARY mysql user PRIMARY KEY
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,db_datadict;
SELECT * FROM information_schema.table_constraints
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name,constraint_name;
@@ -74,6 +74,7 @@ def mysql PRIMARY mysql time_zone_name PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition PRIMARY KEY
def mysql PRIMARY mysql time_zone_transition_type PRIMARY KEY
def mysql PRIMARY mysql user PRIMARY KEY
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/r/is_table_privileges.result b/mysql-test/suite/funcs_1/r/is_table_privileges.result
index f7e443bbd35..153164ba2cc 100644
--- a/mysql-test/suite/funcs_1/r/is_table_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_table_privileges.result
@@ -73,7 +73,7 @@ CREATE USER 'testuser2'@'localhost';
GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION;
DROP USER 'testuser3'@'localhost';
CREATE USER 'testuser3'@'localhost';
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
CREATE TABLE tb3 (f1 TEXT)
ENGINE = <other_engine_type>;
GRANT SELECT ON db_datadict.tb3 TO 'testuser3'@'localhost';
@@ -87,7 +87,7 @@ Grants for testuser1@localhost
GRANT USAGE ON *.* TO 'testuser1'@'localhost'
GRANT SELECT, CREATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `db_datadict`.`tb1` TO 'testuser1'@'localhost'
-# Establish connection testuser2 (user=testuser3)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
@@ -108,7 +108,7 @@ SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
GRANT ALL PRIVILEGES ON `db_datadict`.`tb1` TO 'testuser2'@'localhost' WITH GRANT OPTION
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
@@ -118,7 +118,10 @@ SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
GRANT SELECT ON `db_datadict`.`tb3` TO 'testuser3'@'localhost'
-# Switch to connection default and close the other connections
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
diff --git a/mysql-test/suite/funcs_1/r/is_tables.result b/mysql-test/suite/funcs_1/r/is_tables.result
index 53fb95680e9..5ccbdd3d90c 100644
--- a/mysql-test/suite/funcs_1/r/is_tables.result
+++ b/mysql-test/suite/funcs_1/r/is_tables.result
@@ -117,7 +117,7 @@ CREATE TABLE db_datadict.tb1 (f1 INT, f2 INT, f3 INT)
ENGINE = <engine_type>;
GRANT SELECT ON db_datadict.tb1 TO 'testuser1'@'localhost';
GRANT ALL ON db_datadict.tb1 TO 'testuser2'@'localhost' WITH GRANT OPTION;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
CREATE TABLE tb2 (f1 DECIMAL)
ENGINE = <engine_type>;
CREATE TABLE tb3 (f1 VARCHAR(200))
@@ -139,7 +139,7 @@ tb1
tb2
tb3
v3
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
@@ -149,7 +149,7 @@ SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb1
tb3
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , db_datadict;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
@@ -159,7 +159,7 @@ SHOW TABLES FROM db_datadict;
Tables_in_db_datadict
tb3
v3
-# Switch to connection default (user=root)
+connection default;
SELECT * FROM information_schema.tables
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME TABLE_TYPE ENGINE VERSION ROW_FORMAT TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH MAX_DATA_LENGTH INDEX_LENGTH DATA_FREE AUTO_INCREMENT CREATE_TIME UPDATE_TIME CHECK_TIME TABLE_COLLATION CHECKSUM CREATE_OPTIONS TABLE_COMMENT
@@ -173,7 +173,9 @@ tb1
tb2
tb3
v3
-# Close connection testuser1, testuser2, testuser3
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/is_tables_innodb.result b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
index 204ee893fd8..23e6ad77309 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_innodb.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_innodb.result
@@ -94,7 +94,7 @@ t1
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -157,7 +157,8 @@ t1
t2
SHOW TABLES FROM test2;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2'
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
DROP DATABASE test2;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is.result b/mysql-test/suite/funcs_1/r/is_tables_is.result
index daa3ce83ba2..a0f2424c07c 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is.result
@@ -935,7 +935,7 @@ Separator -----------------------------------------------------
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -1868,6 +1868,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
index daa3ce83ba2..a0f2424c07c 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_is_embedded.result
@@ -935,7 +935,7 @@ Separator -----------------------------------------------------
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -1868,6 +1868,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment
Separator -----------------------------------------------------
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_memory.result b/mysql-test/suite/funcs_1/r/is_tables_memory.result
index acf6636cd38..2ee21898085 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_memory.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_memory.result
@@ -95,7 +95,7 @@ t1
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -158,7 +158,8 @@ t1
t2
SHOW TABLES FROM test2;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2'
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
DROP DATABASE test2;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam.result b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
index 5ef3fbaafab..5ccd8377cb1 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam.result
@@ -95,7 +95,7 @@ t1
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -158,7 +158,8 @@ t1
t2
SHOW TABLES FROM test2;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'test2'
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
DROP DATABASE test2;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
index 3ffa2662313..5a1b6df84cb 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_myisam_embedded.result
@@ -95,7 +95,7 @@ t1
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -182,7 +182,8 @@ t2
SHOW TABLES FROM test2;
Tables_in_test2
t1
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
DROP DATABASE test2;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql.result b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
index 430c7fe2580..c9c86b4e96e 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql.result
@@ -703,7 +703,7 @@ Separator -----------------------------------------------------
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -714,6 +714,7 @@ AS "user_comment",
FROM information_schema.tables
WHERE table_schema = 'mysql'
ORDER BY table_schema,table_name;
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
diff --git a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
index f1a6cc327b7..479312334a7 100644
--- a/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
+++ b/mysql-test/suite/funcs_1/r/is_tables_mysql_embedded.result
@@ -703,7 +703,7 @@ Separator -----------------------------------------------------
DROP USER testuser1@localhost;
CREATE USER testuser1@localhost;
GRANT SELECT ON test1.* TO testuser1@localhost;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1,localhost,testuser1,,test1;
SELECT *,
LEFT( table_comment,
IF(INSTR(table_comment,'InnoDB free') = 0,
@@ -1404,6 +1404,7 @@ CREATE_OPTIONS #CO#
TABLE_COMMENT #TC#
user_comment Users and global privileges
Separator -----------------------------------------------------
-# Switch to connection default and close connection testuser1
+connection default;
+disconnect testuser1;
DROP USER testuser1@localhost;
DROP DATABASE test1;
diff --git a/mysql-test/suite/funcs_1/r/is_triggers.result b/mysql-test/suite/funcs_1/r/is_triggers.result
index d6b5f3a42bf..e64086431e3 100644
--- a/mysql-test/suite/funcs_1/r/is_triggers.result
+++ b/mysql-test/suite/funcs_1/r/is_triggers.result
@@ -125,7 +125,7 @@ GRANT TRIGGER ON *.* TO 'testuser1'@'localhost';
GRANT TRIGGER ON *.* TO 'testuser3'@'localhost';
GRANT TRIGGER ON *.* TO 'testuser4'@'localhost';
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
CREATE TABLE db_datadict.t1 (f1 INT, f2 INT, f3 INT)
ENGINE = <engine_type>;
CREATE TRIGGER trg1 BEFORE INSERT
@@ -140,7 +140,7 @@ def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SHOW GRANTS FOR 'testuser2'@'localhost';
Grants for testuser2@localhost
GRANT USAGE ON *.* TO 'testuser2'@'localhost'
@@ -151,7 +151,7 @@ WHERE trigger_name = 'trg1';
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , test;
SHOW GRANTS FOR 'testuser3'@'localhost';
Grants for testuser3@localhost
GRANT TRIGGER ON *.* TO 'testuser3'@'localhost'
@@ -164,7 +164,7 @@ def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-# Establish connection testuser4 (user=testuser4)
+connect testuser4, localhost, testuser4, , test;
SHOW GRANTS FOR 'testuser4'@'localhost';
Grants for testuser4@localhost
GRANT TRIGGER ON *.* TO 'testuser4'@'localhost'
@@ -180,7 +180,11 @@ def db_datadict trg1 INSERT def db_datadict t1 0 NULL SET @test_before = 2, new.
SHOW TRIGGERS FROM db_datadict;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @test_before = 2, new.f1 = @test_before BEFORE NULL testuser1@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-# Switch to connection default and close connections testuser1 - testuser4
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
+disconnect testuser4;
SELECT * FROM information_schema.triggers
WHERE trigger_name = 'trg1';
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
diff --git a/mysql-test/suite/funcs_1/r/is_user_privileges.result b/mysql-test/suite/funcs_1/r/is_user_privileges.result
index dfbe50ad862..a300a1f73e7 100644
--- a/mysql-test/suite/funcs_1/r/is_user_privileges.result
+++ b/mysql-test/suite/funcs_1/r/is_user_privileges.result
@@ -387,7 +387,7 @@ password_expired N
is_role N
default_role
max_statement_time 0.000000
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , db_datadict;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -542,7 +542,7 @@ GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OP
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
# Now add SELECT on *.* to testuser1;
-# Switch to connection default
+connection default;
GRANT SELECT ON *.* TO 'testuser1'@'localhost';
#
# Here <SELECT NO> is shown correctly for testuser1;
@@ -867,7 +867,7 @@ password_expired N
is_role N
default_role
max_statement_time 0.000000
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -1020,7 +1020,7 @@ Grants for testuser1@localhost
GRANT SELECT ON *.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT, UPDATE ON `db_datadict`.* TO 'testuser1'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `mysql`.`user` TO 'testuser1'@'localhost'
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , db_datadict;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -1038,7 +1038,7 @@ ERROR 42000: SELECT command denied to user 'testuser2'@'localhost' for table 'us
SHOW GRANTS;
Grants for testuser2@localhost
GRANT INSERT, UPDATE ON *.* TO 'testuser2'@'localhost'
-# Establish connection testuser3 (user=testuser3)
+connect testuser3, localhost, testuser3, , test;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -1054,7 +1054,7 @@ Grants for testuser3@localhost
GRANT USAGE ON *.* TO 'testuser3'@'localhost'
# Revoke privileges from testuser1;
-# Switch to connection default
+connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1215,7 +1215,7 @@ password_expired N
is_role N
default_role
max_statement_time 0.000000
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -1248,7 +1248,7 @@ CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
ERROR 42000: CREATE command denied to user 'testuser1'@'localhost' for table 'tb_66'
# Add ALL on db_datadict.* (and select on mysql.user) to testuser1;
-# Switch to connection default
+connection default;
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT ON mysql.user TO 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
@@ -1410,7 +1410,7 @@ password_expired N
is_role N
default_role
max_statement_time 0.000000
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -1722,7 +1722,7 @@ CREATE TABLE tb_57 ( c1 TEXT )
ENGINE = <other_engine_type>;
# Revoke privileges from testuser1;
-# Switch to connection default
+connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
@@ -1883,7 +1883,7 @@ password_expired N
is_role N
default_role
max_statement_time 0.000000
-# Switch to connection testuser1
+connection testuser1;
SELECT * FROM information_schema.user_privileges
WHERE grantee LIKE '''testuser%'''
ORDER BY grantee, table_catalog, privilege_type;
@@ -1903,7 +1903,10 @@ USE db_datadict;
ERROR 42000: Access denied for user 'testuser1'@'localhost' to database 'db_datadict'
CREATE TABLE db_datadict.tb_59 ( c1 TEXT )
ENGINE = <other_engine_type>;
-# Switch to connection default and close connections testuser1,testuser2,testuser3
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect testuser3;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'testuser3'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/is_views.result b/mysql-test/suite/funcs_1/r/is_views.result
index 12a46aeacce..6c22fed6379 100644
--- a/mysql-test/suite/funcs_1/r/is_views.result
+++ b/mysql-test/suite/funcs_1/r/is_views.result
@@ -93,22 +93,25 @@ WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_glob select `db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def db_datadict v_granted_to_1 select `db_datadict`.`t1`.`f1` AS `f1`,`db_datadict`.`t1`.`f2` AS `f2`,`db_datadict`.`t1`.`f3` AS `f3` from `db_datadict`.`t1` NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
-# Establish connection testuser1 (user=testuser1)
+connect testuser1, localhost, testuser1, , test;
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
-# Establish connection testuser2 (user=testuser2)
+connect testuser2, localhost, testuser2, , test;
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
def db_datadict v_granted_glob NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
def db_datadict v_granted_to_1 NONE YES root@localhost DEFINER latin1 latin1_swedish_ci UNDEFINED
-# Establish connection test_no_views (user=test_no_views)
+connect test_no_views, localhost, test_no_views, , test;
SELECT * FROM information_schema.views
WHERE table_schema = 'db_datadict' ORDER BY table_name;
TABLE_CATALOG TABLE_SCHEMA TABLE_NAME VIEW_DEFINITION CHECK_OPTION IS_UPDATABLE DEFINER SECURITY_TYPE CHARACTER_SET_CLIENT COLLATION_CONNECTION ALGORITHM
-# Switch to connection default and close all other connections
+connection default;
+disconnect testuser1;
+disconnect testuser2;
+disconnect test_no_views;
DROP USER 'testuser1'@'localhost';
DROP USER 'testuser2'@'localhost';
DROP USER 'test_no_views'@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
index c38481bac50..a0a48842ef8 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_06.result
@@ -66,6 +66,7 @@ load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -80,6 +81,7 @@ grant all on db_storedproc_1.* to 'user_1'@'localhost';
revoke create routine on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
DROP PROCEDURE IF EXISTS sp1;
+connect user1a, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -88,10 +90,13 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+disconnect user1a;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
+connect user1b, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -99,6 +104,8 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+disconnect user1b;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -114,6 +121,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
+connect user2, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp3(v1 char(20))
@@ -124,6 +132,8 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+disconnect user2;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -146,6 +156,7 @@ CREATE PROCEDURE sp4(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+connect user3, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -167,6 +178,8 @@ SQL_DATA_ACCESS CONTAINS SQL
SECURITY_TYPE DEFINER
SQL_MODE NO_ENGINE_SUBSTITUTION
ROUTINE_COMMENT
+disconnect user3;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp4;
@@ -187,6 +200,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
grant SELECT on db_storedproc_1.* to 'user_2'@'localhost';
grant execute on db_storedproc_1.* to 'user_2'@'localhost';
flush privileges;
+connect user5_1, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp5_s_i () sql security definer
@@ -202,6 +216,8 @@ CREATE PROCEDURE sp5_ins () sql security definer
BEGIN
insert into db_storedproc_1.t3165 values ('inserted', 'from sp5_ins', 1000);
END//
+disconnect user5_1;
+connect user5_2, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -210,12 +226,14 @@ CALL sp5_ins();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+connection default;
root@localhost db_storedproc_1
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
grant insert on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -223,12 +241,14 @@ ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165
CALL sp5_ins();
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+connection default;
root@localhost db_storedproc_1
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
grant SELECT on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -242,10 +262,12 @@ inserted outside of SP NULL
inserted from sp5_ins 2000-10-00
inserted from sp5_s_i 2000-10-00
inserted from sp5_ins 2000-10-00
+connection default;
root@localhost db_storedproc_1
REVOKE INSERT on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -263,10 +285,12 @@ inserted outside of SP NULL
inserted from sp5_ins 2000-10-00
inserted from sp5_s_i 2000-10-00
inserted from sp5_ins 2000-10-00
+connection default;
root@localhost db_storedproc_1
REVOKE SELECT on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -275,6 +299,8 @@ CALL sp5_ins();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+disconnect user5_2;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp5_s_i;
@@ -299,6 +325,7 @@ GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc_1.* TO 'user_2'@'localhost';
GRANT EXECUTE ON db_storedproc_1.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_1, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp3166_s_i () SQL SECURITY INVOKER
@@ -314,6 +341,8 @@ CREATE PROCEDURE sp3166_ins () SQL SECURITY INVOKER
BEGIN
insert into db_storedproc_1.t3166 values ('inserted from sp3166_ins');
END//
+disconnect user6_1;
+connect user6_2, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -325,6 +354,7 @@ ERROR 42000: INSERT command denied to user 'user_2'@'localhost' for table 't3166
CALL sp3166_sel();
c1
inserted outside SP
+connection default;
root@localhost db_storedproc_1
CALL sp3166_sel();
@@ -332,6 +362,8 @@ c1
inserted outside SP
GRANT INSERT ON db_storedproc_1.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+disconnect user6_2;
+connect user6_3, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -343,6 +375,8 @@ c1
inserted outside SP
inserted from sp3166_s_i
inserted from sp3166_ins
+disconnect user6_3;
+connection default;
root@localhost db_storedproc_1
CALL sp3166_sel();
@@ -352,6 +386,7 @@ inserted from sp3166_s_i
inserted from sp3166_ins
REVOKE SELECT ON db_storedproc_1.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_4, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -359,6 +394,8 @@ ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166
CALL sp3166_ins();
CALL sp3166_sel();
ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166'
+disconnect user6_4;
+connection default;
CALL sp3166_s_i();
c1
inserted outside SP
@@ -369,6 +406,7 @@ inserted from sp3166_ins
root@localhost db_storedproc_1
REVOKE EXECUTE on db_storedproc_1.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_5, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -377,6 +415,8 @@ CALL sp3166_ins();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_ins'
CALL sp3166_sel();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_sel'
+disconnect user6_5;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp3166_s_i;
diff --git a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
index ca0aff9abbd..bf4fcefb9db 100644
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
@@ -82,6 +82,7 @@ create user 'user_2'@'localhost';
GRANT CREATE ROUTINE ON db_storedproc.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user2_1, localhost, user_1, , db_storedproc;
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
@@ -94,6 +95,8 @@ DECLARE res INT;
SET res = n * n;
RETURN res;
END//
+disconnect user2_1;
+connect user2_2, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
@@ -112,6 +115,8 @@ fn31105( 9 )
81
GRANT EXECUTE ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+disconnect user2_2;
+connect user2_3, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
@@ -120,6 +125,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+disconnect user2_3;
connection default;
USE db_storedproc;
@@ -132,12 +138,15 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+connect user2_4, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+disconnect user2_4;
+connection default;
USE db_storedproc;
root@localhost db_storedproc
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03.result b/mysql-test/suite/funcs_1/r/memory_trig_03.result
index 31de6d2759e..8fd3e034735 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03.result
@@ -86,9 +86,13 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.3.2:
-----------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -96,17 +100,20 @@ use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_2-yes';
+connection default;
select current_user;
current_user
root@localhost
@@ -125,9 +132,11 @@ trig 3.5.3.2_2-yes
Testcase 3.5.3.6:
-----------------
+connection no_privs;
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
@@ -135,8 +144,10 @@ f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
+connection yes_privs;
use priv_db;
drop trigger trg1_2;
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1 order by f1;
@@ -145,7 +156,10 @@ insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
+connection default;
drop trigger trg1_2;
+disconnect no_privs;
+disconnect yes_privs;
Testcase 3.5.3.7a:
------------------
@@ -160,6 +174,9 @@ grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection no_privs_424a;
select current_user;
current_user
test_noprivs@localhost
@@ -175,6 +192,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -184,6 +202,7 @@ insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
+connection yes_privs_424a;
use priv_db;
select current_user;
current_user
@@ -193,6 +212,7 @@ Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
@@ -202,6 +222,8 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
+disconnect no_privs_424a;
+disconnect yes_privs_424a;
Testcase 3.5.3.7b:
------------------
@@ -219,6 +241,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -226,6 +252,7 @@ GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEM
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1 order by f1;
f1
@@ -246,6 +273,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4b_1;
+connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -253,6 +281,7 @@ GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
@@ -274,6 +303,8 @@ trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4b_2;
+disconnect no_privs_424b;
+disconnect yes_privs_424b;
Testcase 3.5.3.7c
-----------------
@@ -291,6 +322,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -298,6 +333,7 @@ GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIE
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -310,6 +346,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4c_1;
+connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -317,6 +354,7 @@ GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1 order by f1;
f1
@@ -329,6 +367,8 @@ trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4c_2;
+disconnect no_privs_424c;
+disconnect yes_privs_424c;
Testcase 3.5.3.7d:
------------------
@@ -344,6 +384,10 @@ grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -351,6 +395,7 @@ GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -364,6 +409,7 @@ trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4d_1;
+connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -371,6 +417,7 @@ GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1 order by f1;
f1
@@ -384,6 +431,8 @@ trig 3.5.3.7-2b
trig 3.5.3.7-2c
trig 3.5.3.7-2d
drop trigger trg4d_2;
+disconnect no_privs_424d;
+disconnect yes_privs_424d;
Testcase 3.5.3.8a:
------------------
@@ -398,6 +447,10 @@ grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425a;
select current_user;
current_user
test_noprivs@localhost
@@ -407,6 +460,7 @@ Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
+connection default;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
@@ -417,6 +471,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1a
drop trigger trg5a_1;
+connection yes_privs_425a;
use priv_db;
select current_user;
current_user
@@ -426,6 +481,7 @@ Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
@@ -435,6 +491,8 @@ select @test_var;
@test_var
insert 3.5.3.8-2a
drop trigger trg5a_2;
+disconnect no_privs_425a;
+disconnect yes_privs_425a;
Testcase: 3.5.3.8b
------------------
@@ -453,6 +511,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -460,6 +522,7 @@ GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEM
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@@ -471,6 +534,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1b
drop trigger trg5b_1;
+connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -478,6 +542,7 @@ GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-2b';
insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@@ -488,6 +553,8 @@ select @test_var;
@test_var
update 3.5.3.8-2b
drop trigger trg5b_2;
+disconnect no_privs_425b;
+disconnect yes_privs_425b;
Testcase 3.5.3.8c:
------------------
@@ -506,6 +573,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -513,6 +584,7 @@ GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIE
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
@@ -520,6 +592,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1c
drop trigger trg5c_1;
+connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -527,12 +600,15 @@ GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-2c';
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
insert 3.5.3.8-2c
drop trigger trg5c_2;
+disconnect no_privs_425c;
+disconnect yes_privs_425c;
Testcase: 3.5.3.8d:
-------------------
@@ -550,6 +626,10 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -557,6 +637,7 @@ GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
@@ -564,6 +645,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1d
drop trigger trg5d_1;
+connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -571,6 +653,7 @@ GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-2d';
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@@ -594,12 +677,15 @@ Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection yes_353x;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1 before insert on t1 for each row
insert into t2 values (new.f1);
+connection default;
use priv_db;
insert into t1 (f1) values (4);
ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -612,10 +698,12 @@ f1
select f2 from t2 order by f2;
f2
4
+connection yes_353x;
use priv_db;
drop trigger trg1;
create trigger trg2 before insert on t1 for each row
update t2 set f2=new.f1-1;
+connection default;
use priv_db;
insert into t1 (f1) values (2);
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -629,10 +717,12 @@ f1
select f2 from t2 order by f2;
f2
1
+connection yes_353x;
use priv_db;
drop trigger trg2;
create trigger trg3 before insert on t1 for each row
select f2 into @aaa from t2 where f2=new.f1;
+connection default;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -650,10 +740,12 @@ f2
select @aaa;
@aaa
1
+connection yes_353x;
use priv_db;
drop trigger trg3;
create trigger trg4 before insert on t1 for each row
delete from t2;
+connection default;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table 't2'
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_03e.result b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
index cfa839b382c..768e1577177 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_03e.result
@@ -25,6 +25,7 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
--------------------------------------------
@@ -32,11 +33,13 @@ use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv_db;
insert into t1 (f1) values ('insert-yes');
select f1 from t1 order by f1;
f1
insert-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -48,12 +51,14 @@ GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
-----------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -63,6 +68,7 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for colum
select f1 from t1 order by f1;
f1
insert-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -73,6 +79,7 @@ select f1 from t1 order by f1;
f1
insert-yes
trig 1_2-yes
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -83,6 +90,7 @@ f1
insert-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -94,12 +102,14 @@ GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
no trigger privilege on db level for drop:
------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -117,10 +127,12 @@ trig 1_2-yes
trigger privilege at activation time:
-------------------------------------
+connection default;
select current_user;
current_user
root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -135,6 +147,7 @@ trig 1_2-yes
trigger privilege on db level for drop:
---------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -149,6 +162,7 @@ takes effect after use priv_db:
-------------------------------
use priv_db;
drop trigger trg1_2;
+connection default;
select current_user;
current_user
root@localhost
@@ -175,6 +189,7 @@ GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
use db with trigger privilege on db level and without...:
---------------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -192,6 +207,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
use priv_db;
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -217,6 +233,8 @@ trig 1_2-yes
trig 1_2-yes
trig 1_3-yes
trig 1_3-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -230,6 +248,8 @@ drop trigger trg1_4;
ERROR HY000: Trigger does not exist
use priv_db;
drop trigger trg1_4;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -252,9 +272,12 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on table level for create:
-----------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -270,6 +293,7 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -280,6 +304,7 @@ t1
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -288,6 +313,7 @@ insert into t1 (f1) values ('insert1-yes');
select f1 from t1 order by f1;
f1
insert1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -309,6 +335,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
trigger privilege on table level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -316,6 +343,7 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -325,6 +353,7 @@ f1
insert1-yes
insert2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -343,6 +372,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
no trigger privilege on table level for drop:
---------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -351,6 +381,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
no trigger privilege at activation time:
----------------------------------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -362,6 +393,7 @@ insert1-yes
insert2-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -369,6 +401,7 @@ grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
trigger privilege at activation time:
-------------------------------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -383,6 +416,7 @@ trig 1_2-yes
trigger privilege on table level for drop:
------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -391,6 +425,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
drop trigger trg1_2;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -403,6 +438,7 @@ insert7-yes
trig 1_2-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -435,6 +471,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
use table with trigger privilege and without...:
------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -452,6 +489,7 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -470,6 +508,8 @@ trig 1_2-yes
trig 1_2-yes
trig 1_2-yes
trig 1_3-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -479,6 +519,8 @@ drop trigger trg1_3;
drop trigger trg2_2;
ERROR HY000: Trigger does not exist
drop trigger trg1_4;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -510,6 +552,9 @@ grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -533,6 +578,7 @@ f1
trig 1_1-yes
trig 1_1-yes
drop trigger priv_db.trg1_5;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -543,6 +589,7 @@ f1
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -558,6 +605,8 @@ revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+disconnect yes_privs;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_yesprivs@localhost
@@ -568,6 +617,7 @@ select * from information_schema.triggers;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -580,12 +630,14 @@ use priv_db;
no trigger privilege on db level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -598,6 +650,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -609,6 +662,7 @@ GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
-----------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -626,6 +680,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger priv_db.trg1_9 before UPDATE on priv_db.t1
for each row
set new.f1 = 'trig 1_9-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -646,6 +701,7 @@ f1
insert-yes
drop trigger priv_db.trg1_9;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -666,6 +722,7 @@ grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -673,6 +730,7 @@ use no_priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -693,12 +751,16 @@ select f1 from t1 order by f1;
f1
insert-yes
insert-yes
+disconnect yes_privs;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_yesprivs@localhost
use no_priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+disconnect yes_privs;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -721,6 +783,8 @@ f1
insert-yes
insert-yes
trig 1_2-yes
+disconnect no_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -761,11 +825,14 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
trigger privilege on one db1 db level, not on db2
-------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -778,6 +845,7 @@ use priv2_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig1_1-yes';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -812,6 +880,7 @@ trig 2_1-yes
revoke trigger privilege on table level (not existing)
------------------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -823,6 +892,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -833,6 +903,7 @@ ERROR HY000: Trigger does not exist
use priv1_db;
drop trigger trg1_1;
drop trigger trg2_1;
+connection default;
select current_user;
current_user
root@localhost
@@ -841,6 +912,7 @@ revoke TRIGGER on priv1_db.* from test_yesprivs@localhost;
no trigger privilege on table level for create:
-----------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -848,6 +920,7 @@ use priv1_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -863,6 +936,7 @@ GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
trigger privilege on table level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -873,6 +947,7 @@ set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
set new.f1 = 'trig 2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -895,6 +970,7 @@ f1
insert1_yes
insert21-yes
insert22-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -905,6 +981,7 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -914,6 +991,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
use priv1_db;
create trigger trg2_1 before INSERT on t2 for each row
set new.f1 = 'trig 2_1-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -949,11 +1027,15 @@ trig 2_1-yes
trig 2_1-yes
trig 2_1-yes
trig 2_1-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
drop trigger trg1_2;
drop trigger trg2_1;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -974,6 +1056,8 @@ create User test_useprivs@localhost;
set password for test_useprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_useprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -988,6 +1072,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1001,6 +1086,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert2-no'')';
+connect use_privs,localhost,test_useprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_useprivs@localhost
@@ -1011,6 +1097,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1019,6 +1106,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1029,6 +1117,7 @@ f1
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert4-no'')';
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1039,6 +1128,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1047,6 +1137,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1057,6 +1148,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert6-no'')';
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1068,6 +1160,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert7-no'')';
+connection default;
select current_user;
current_user
root@localhost
@@ -1076,6 +1169,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1087,6 +1181,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1098,6 +1193,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1106,6 +1202,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1117,6 +1214,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1129,6 +1227,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1137,6 +1236,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1151,6 +1251,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
deallocate prepare ins1;
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1165,6 +1266,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
deallocate prepare ins1;
+connection default;
select current_user;
current_user
root@localhost
@@ -1173,13 +1275,17 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
drop trigger trg1_1;
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1196,6 +1302,8 @@ create table t1 (f1 char(20)) engine= memory;
create User test_yesprivs@localhost;
set password for test_yesprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -1210,6 +1318,7 @@ before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
grant select, insert, update
on priv_db.t1 to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1220,6 +1329,7 @@ select f1 from t1 order by f1;
f1
drop trigger trg1_0;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -1229,6 +1339,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1257,11 +1368,13 @@ select f1 from t1 order by f1;
f1
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
grant trigger on priv_db.* to test_yesprivs@localhost
with grant option;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1274,9 +1387,12 @@ create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1307,9 +1423,12 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
update only on column:
----------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1317,6 +1436,7 @@ grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t1
to test_yesprivs@localhost;
grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t2
to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1327,6 +1447,7 @@ create trigger trg1_1 before UPDATE on t1 for each row
set new.f1 = 'trig 1_1-yes';
create trigger trg2_1 before UPDATE on t2 for each row
set new.f1 = 'trig 2_1-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1347,6 +1468,7 @@ update t2 set f1 = 'update1_no'
select f1 from t2 order by f1;
f1
trig 2_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1360,12 +1482,14 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
insert into t1 (f1) values ('insert2-yes');
insert into t2 (f1) values ('insert2-yes');
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1391,6 +1515,7 @@ trig 2_1-yes
check if access only on one of three columns
--------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1398,6 +1523,7 @@ alter table priv_db.t1 add f2 char(20), add f3 int;
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
grant TRIGGER,SELECT on priv_db.t1 to test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1410,6 +1536,7 @@ insert2-yes insert2-yes 1
insert3-yes insert3-yes 2
trig 1_1-yes NULL NULL
trig 1_1-yes NULL NULL
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1424,11 +1551,13 @@ trig 1_1-yes NULL NULL
trig 1_1-yes NULL NULL
trig 1_1-yes update4-yes 10
trig 1_1-yes update4-yes 20
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
create trigger trg1_2 after UPDATE on t1 for each row
set @f2 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1467,10 +1596,12 @@ trig 2_1-yes
check if rejected without trigger privilege:
--------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1490,6 +1621,7 @@ trig 1_2-yes
check trigger, but not update privilege on column:
--------------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1501,6 +1633,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1508,6 +1641,7 @@ use priv_db;
drop trigger trg1_1;
create trigger trg1_3 before UPDATE on t1 for each row
set new.f1 = 'trig 1_3-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1530,6 +1664,7 @@ NULL
NULL
10
20
+connection default;
select current_user;
current_user
root@localhost
@@ -1541,6 +1676,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1558,6 +1694,9 @@ NULL
------------------------------------------------
grant TRIGGER(f1) on priv_db.t1 to test_yesprivs@localhost;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(f1) on priv_db.t1 to test_yesprivs@localhost' at line 1
+disconnect yes_privs;
+disconnect no_privs;
+connection default;
select current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_0407.result b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
index 7f3277f55e1..9b23271958a 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_0407.result
@@ -69,13 +69,18 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+connect con1_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con1_super,localhost,test_super,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.4:
---------------
+connection default;
use test;
Testcase 3.5.4.1:
-----------------
+connection con1_super;
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
@@ -83,28 +88,33 @@ grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
+connection con1_general;
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
+connection con1_super;
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where trigger_schema = 'db_drop'
order by trigger_name;
trigger_schema trigger_name event_object_table
+connection con1_general;
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
+connection con1_super;
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.2:
-----------------
+connection con1_super;
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
@@ -116,6 +126,7 @@ drop database if exists db_drop2;
Testcase 3.5.4.3:
-----------------
+connection con1_super;
create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
@@ -139,17 +150,20 @@ drop database if exists db_drop3;
Testcase 3.5.4.4:
-----------------
+connection con1_super;
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
+connection con1_general;
Use db_drop4;
Insert into t1 values ('Insert 3.5.4.4');
Select * from t1;
f1
Trigger 3.5.4.4
+connection con1_super;
Drop database db_drop4;
Show databases like 'db_drop4';
Database (db_drop4)
@@ -161,10 +175,12 @@ create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
+connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
f1
2nd Insert 3.5.4.4
+connection con1_super;
drop trigger trg4;
ERROR HY000: Trigger does not exist
drop database if exists db_drop4;
@@ -172,17 +188,20 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.5:
-----------------
+connection con1_super;
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
+connection con1_general;
Use db_drop5;
Insert into t1 values ('Insert 3.5.4.5');
Select * from t1;
f1
Trigger 3.5.4.5
+connection con1_super;
Drop table t1;
Show tables;
Tables_in_db_drop5
@@ -192,10 +211,12 @@ where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
+connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
f1
2nd Insert 3.5.4.5
+connection con1_super;
drop trigger trg5;
ERROR HY000: Trigger does not exist
drop database if exists db_drop5;
@@ -203,6 +224,7 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.5:
---------------
+connection default;
use test;
Testcase 3.5.5.1:
@@ -228,6 +250,7 @@ drop view vw3;
Testcase 3.5.5.4:
-----------------
+connection con1_super;
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
@@ -238,6 +261,7 @@ on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
ERROR HY000: Trigger in wrong schema
grant INSERT, SELECT on dbtest_two.t2 to test_general;
grant SELECT on dbtest_one.* to test_general;
+connection con1_general;
use dbtest_two;
Insert into t2 values ('1st Insert 3.5.5.4');
Warnings:
@@ -253,12 +277,14 @@ Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
+connection con1_super;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
DROP DATABASE if exists dbtest_one;
drop database if EXISTS dbtest_two;
Testcase 3.5.6:
---------------
+connection default;
use test;
Testcase 3.5.6.1 (see Testcase 3.5.1.1)
@@ -466,6 +492,7 @@ delete from tb3 where f121='Test 3.5.7.15/16';
Testcase 3.5.7.17 (see Testcase 3.5.1.1)
----------------------------------------
+connection default;
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
diff --git a/mysql-test/suite/funcs_1/r/memory_trig_08.result b/mysql-test/suite/funcs_1/r/memory_trig_08.result
index 4632cfe269c..11bc3b61054 100644
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result
@@ -69,6 +69,9 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+connect con2_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con2_super,localhost,test_super,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.8.1: (implied in previous tests)
---------------------------------------------
@@ -78,6 +81,7 @@ Testcase 3.5.8.2: (implied in previous tests)
Testcase 3.5.8.3/4:
-------------------
+connection con2_super;
create database db_test;
grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
grant LOCK TABLES on db_test.* to test_general;
@@ -124,6 +128,7 @@ delete from db_test.t1_d where d136= new.f136;
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
END//
+connection con2_general;
Use test;
set @test_var=0;
Insert into tb3 (f120, f122, f136, f144, f163)
@@ -153,11 +158,13 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
+connection con2_super;
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
+connection con2_general;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
@@ -176,11 +183,13 @@ I 00222 0000023456 1.050000000000000000000000000000
3.5.8.4 - single SQL - update
-----------------------------
+connection con2_super;
drop trigger trg2;
Create trigger trg3 BEFORE UPDATE on tb3 for each row
update db_test.t1_u
set u120=new.f120
where u136=new.f136;
+connection con2_general;
update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
where f122='Test 3.5.8.4-Single Insert';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
@@ -197,9 +206,11 @@ U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
+connection con2_super;
drop trigger trg3;
Create trigger trg4 AFTER UPDATE on tb3 for each row
delete from db_test.t1_d where d136= new.f136;
+connection con2_general;
update tb3 set f120='D', f136=444,
f122='Test 3.5.8.4-Single Delete'
where f122='Test 3.5.8.4-Single Update';
@@ -213,10 +224,12 @@ c 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - select
-------------------------------
+connection con2_super;
drop trigger trg4;
Create trigger trg5 AFTER UPDATE on tb3 for each row
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
+connection con2_general;
set @test_var=0;
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.4-Single Select'
@@ -227,6 +240,7 @@ S Test 3.5.8.4-Single Select 00111 0000023456 1.050000000000000000000000000000
select @test_var;
@test_var
999.990000000000000000000000000000
+connection default;
drop trigger trg1;
drop trigger trg5;
drop database if exists db_test;
@@ -519,6 +533,7 @@ Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+connection default;
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
index c38481bac50..a0a48842ef8 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_06.result
@@ -66,6 +66,7 @@ load data infile '<MYSQLTEST_VARDIR>/std_data/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -80,6 +81,7 @@ grant all on db_storedproc_1.* to 'user_1'@'localhost';
revoke create routine on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
DROP PROCEDURE IF EXISTS sp1;
+connect user1a, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -88,10 +90,13 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
+disconnect user1a;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
+connect user1b, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -99,6 +104,8 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+disconnect user1b;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -114,6 +121,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
DROP PROCEDURE IF EXISTS db_storedproc_1.sp3;
DROP FUNCTION IF EXISTS db_storedproc_1.fn1;
+connect user2, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp3(v1 char(20))
@@ -124,6 +132,8 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
+disconnect user2;
+connection default;
USE db_storedproc_1;
root@localhost db_storedproc_1
@@ -146,6 +156,7 @@ CREATE PROCEDURE sp4(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
+connect user3, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
USE db_storedproc_1;
@@ -167,6 +178,8 @@ SQL_DATA_ACCESS CONTAINS SQL
SECURITY_TYPE DEFINER
SQL_MODE NO_ENGINE_SUBSTITUTION
ROUTINE_COMMENT
+disconnect user3;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp4;
@@ -187,6 +200,7 @@ grant create routine on db_storedproc_1.* to 'user_1'@'localhost';
grant SELECT on db_storedproc_1.* to 'user_2'@'localhost';
grant execute on db_storedproc_1.* to 'user_2'@'localhost';
flush privileges;
+connect user5_1, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp5_s_i () sql security definer
@@ -202,6 +216,8 @@ CREATE PROCEDURE sp5_ins () sql security definer
BEGIN
insert into db_storedproc_1.t3165 values ('inserted', 'from sp5_ins', 1000);
END//
+disconnect user5_1;
+connect user5_2, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -210,12 +226,14 @@ CALL sp5_ins();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+connection default;
root@localhost db_storedproc_1
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
grant insert on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -223,12 +241,14 @@ ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165
CALL sp5_ins();
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+connection default;
root@localhost db_storedproc_1
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
grant SELECT on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -242,10 +262,12 @@ inserted outside of SP NULL
inserted from sp5_ins 2000-10-00
inserted from sp5_s_i 2000-10-00
inserted from sp5_ins 2000-10-00
+connection default;
root@localhost db_storedproc_1
REVOKE INSERT on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -263,10 +285,12 @@ inserted outside of SP NULL
inserted from sp5_ins 2000-10-00
inserted from sp5_s_i 2000-10-00
inserted from sp5_ins 2000-10-00
+connection default;
root@localhost db_storedproc_1
REVOKE SELECT on db_storedproc_1.* from 'user_1'@'localhost';
flush privileges;
+connection user5_2;
user_2@localhost db_storedproc_1
CALL sp5_s_i();
@@ -275,6 +299,8 @@ CALL sp5_ins();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't3165'
CALL sp5_sel();
ERROR 42000: SELECT command denied to user 'user_1'@'localhost' for table 't3165'
+disconnect user5_2;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp5_s_i;
@@ -299,6 +325,7 @@ GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc_1.* TO 'user_2'@'localhost';
GRANT EXECUTE ON db_storedproc_1.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_1, localhost, user_1, , db_storedproc_1;
user_1@localhost db_storedproc_1
CREATE PROCEDURE sp3166_s_i () SQL SECURITY INVOKER
@@ -314,6 +341,8 @@ CREATE PROCEDURE sp3166_ins () SQL SECURITY INVOKER
BEGIN
insert into db_storedproc_1.t3166 values ('inserted from sp3166_ins');
END//
+disconnect user6_1;
+connect user6_2, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -325,6 +354,7 @@ ERROR 42000: INSERT command denied to user 'user_2'@'localhost' for table 't3166
CALL sp3166_sel();
c1
inserted outside SP
+connection default;
root@localhost db_storedproc_1
CALL sp3166_sel();
@@ -332,6 +362,8 @@ c1
inserted outside SP
GRANT INSERT ON db_storedproc_1.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+disconnect user6_2;
+connect user6_3, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -343,6 +375,8 @@ c1
inserted outside SP
inserted from sp3166_s_i
inserted from sp3166_ins
+disconnect user6_3;
+connection default;
root@localhost db_storedproc_1
CALL sp3166_sel();
@@ -352,6 +386,7 @@ inserted from sp3166_s_i
inserted from sp3166_ins
REVOKE SELECT ON db_storedproc_1.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_4, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -359,6 +394,8 @@ ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166
CALL sp3166_ins();
CALL sp3166_sel();
ERROR 42000: SELECT command denied to user 'user_2'@'localhost' for table 't3166'
+disconnect user6_4;
+connection default;
CALL sp3166_s_i();
c1
inserted outside SP
@@ -369,6 +406,7 @@ inserted from sp3166_ins
root@localhost db_storedproc_1
REVOKE EXECUTE on db_storedproc_1.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user6_5, localhost, user_2, , db_storedproc_1;
user_2@localhost db_storedproc_1
CALL sp3166_s_i();
@@ -377,6 +415,8 @@ CALL sp3166_ins();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_ins'
CALL sp3166_sel();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc_1.sp3166_sel'
+disconnect user6_5;
+connection default;
root@localhost db_storedproc_1
DROP PROCEDURE sp3166_s_i;
diff --git a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
index ca0aff9abbd..bf4fcefb9db 100644
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
@@ -82,6 +82,7 @@ create user 'user_2'@'localhost';
GRANT CREATE ROUTINE ON db_storedproc.* TO 'user_1'@'localhost';
GRANT SELECT ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+connect user2_1, localhost, user_1, , db_storedproc;
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
@@ -94,6 +95,8 @@ DECLARE res INT;
SET res = n * n;
RETURN res;
END//
+disconnect user2_1;
+connect user2_2, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
@@ -112,6 +115,8 @@ fn31105( 9 )
81
GRANT EXECUTE ON db_storedproc.* TO 'user_2'@'localhost';
FLUSH PRIVILEGES;
+disconnect user2_2;
+connect user2_3, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
@@ -120,6 +125,7 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+disconnect user2_3;
connection default;
USE db_storedproc;
@@ -132,12 +138,15 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
+connect user2_4, localhost, user_2, , db_storedproc;
user_2@localhost db_storedproc
CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
+disconnect user2_4;
+connection default;
USE db_storedproc;
root@localhost db_storedproc
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03.result b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
index 31de6d2759e..8fd3e034735 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03.result
@@ -86,9 +86,13 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.3.2:
-----------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -96,17 +100,20 @@ use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_2-yes';
+connection default;
select current_user;
current_user
root@localhost
@@ -125,9 +132,11 @@ trig 3.5.3.2_2-yes
Testcase 3.5.3.6:
-----------------
+connection no_privs;
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1 order by f1;
@@ -135,8 +144,10 @@ f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
+connection yes_privs;
use priv_db;
drop trigger trg1_2;
+connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1 order by f1;
@@ -145,7 +156,10 @@ insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
+connection default;
drop trigger trg1_2;
+disconnect no_privs;
+disconnect yes_privs;
Testcase 3.5.3.7a:
------------------
@@ -160,6 +174,9 @@ grant TRIGGER, UPDATE on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect no_privs_424a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection no_privs_424a;
select current_user;
current_user
test_noprivs@localhost
@@ -175,6 +192,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1a');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -184,6 +202,7 @@ insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
+connection yes_privs_424a;
use priv_db;
select current_user;
current_user
@@ -193,6 +212,7 @@ Grants for test_yesprivs@localhost
GRANT UPDATE, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
@@ -202,6 +222,8 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
+disconnect no_privs_424a;
+disconnect yes_privs_424a;
Testcase 3.5.3.7b:
------------------
@@ -219,6 +241,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+connect no_privs_424b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424b;
show grants;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -226,6 +252,7 @@ GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEM
use priv_db;
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1 order by f1;
f1
@@ -246,6 +273,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4b_1;
+connection yes_privs_424b;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -253,6 +281,7 @@ GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1 order by f1;
f1
@@ -274,6 +303,8 @@ trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4b_2;
+disconnect no_privs_424b;
+disconnect yes_privs_424b;
Testcase 3.5.3.7c
-----------------
@@ -291,6 +322,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs_424c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424c;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -298,6 +333,7 @@ GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIE
use priv_db;
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1c');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -310,6 +346,7 @@ trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
drop trigger trg4c_1;
+connection yes_privs_424c;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -317,6 +354,7 @@ GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1 order by f1;
f1
@@ -329,6 +367,8 @@ trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4c_2;
+disconnect no_privs_424c;
+disconnect yes_privs_424c;
Testcase 3.5.3.7d:
------------------
@@ -344,6 +384,10 @@ grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
show grants for test_noprivs;
Grants for test_noprivs@%
GRANT TRIGGER ON *.* TO 'test_noprivs'@'%'
+connect no_privs_424d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_424d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_424d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -351,6 +395,7 @@ GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1d');
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
@@ -364,6 +409,7 @@ trig 3.5.3.7-2a
trig 3.5.3.7-2b
trig 3.5.3.7-2c
drop trigger trg4d_1;
+connection yes_privs_424d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -371,6 +417,7 @@ GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
+connection default;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1 order by f1;
f1
@@ -384,6 +431,8 @@ trig 3.5.3.7-2b
trig 3.5.3.7-2c
trig 3.5.3.7-2d
drop trigger trg4d_2;
+disconnect no_privs_424d;
+disconnect yes_privs_424d;
Testcase 3.5.3.8a:
------------------
@@ -398,6 +447,10 @@ grant TRIGGER, SELECT on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect no_privs_425a,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425a,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425a;
select current_user;
current_user
test_noprivs@localhost
@@ -407,6 +460,7 @@ Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, TRIGGER, CREATE TABLESPACE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
+connection default;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
@@ -417,6 +471,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1a
drop trigger trg5a_1;
+connection yes_privs_425a;
use priv_db;
select current_user;
current_user
@@ -426,6 +481,7 @@ Grants for test_yesprivs@localhost
GRANT SELECT, TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg5a_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
@@ -435,6 +491,8 @@ select @test_var;
@test_var
insert 3.5.3.8-2a
drop trigger trg5a_2;
+disconnect no_privs_425a;
+disconnect yes_privs_425a;
Testcase: 3.5.3.8b
------------------
@@ -453,6 +511,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
+connect no_privs_425b,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425b,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425b;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -460,6 +522,7 @@ GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEM
use priv_db;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@@ -471,6 +534,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1b
drop trigger trg5b_1;
+connection yes_privs_425b;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -478,6 +542,7 @@ GRANT SELECT ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5b_2 before UPDATE on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-2b';
insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@@ -488,6 +553,8 @@ select @test_var;
@test_var
update 3.5.3.8-2b
drop trigger trg5b_2;
+disconnect no_privs_425b;
+disconnect yes_privs_425b;
Testcase 3.5.3.8c:
------------------
@@ -506,6 +573,10 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect no_privs_425c,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425c,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425c;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -513,6 +584,7 @@ GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIE
use priv_db;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
@@ -520,6 +592,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1c
drop trigger trg5c_1;
+connection yes_privs_425c;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -527,12 +600,15 @@ GRANT SELECT ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-2c';
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
insert 3.5.3.8-2c
drop trigger trg5c_2;
+disconnect no_privs_425c;
+disconnect yes_privs_425c;
Testcase: 3.5.3.8d:
-------------------
@@ -550,6 +626,10 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+connect no_privs_425d,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect yes_privs_425d,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
+connection no_privs_425d;
show grants;
Grants for test_noprivs@localhost
GRANT TRIGGER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -557,6 +637,7 @@ GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
@@ -564,6 +645,7 @@ select @test_var;
@test_var
before trig 3.5.3.8-1d
drop trigger trg5d_1;
+connection yes_privs_425d;
show grants;
Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@@ -571,6 +653,7 @@ GRANT SELECT (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
+connection default;
set @test_var='before trig 3.5.3.8-2d';
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@@ -594,12 +677,15 @@ Grants for test_yesprivs@localhost
GRANT TRIGGER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connect yes_353x,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection yes_353x;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1 before insert on t1 for each row
insert into t2 values (new.f1);
+connection default;
use priv_db;
insert into t1 (f1) values (4);
ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -612,10 +698,12 @@ f1
select f2 from t2 order by f2;
f2
4
+connection yes_353x;
use priv_db;
drop trigger trg1;
create trigger trg2 before insert on t1 for each row
update t2 set f2=new.f1-1;
+connection default;
use priv_db;
insert into t1 (f1) values (2);
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -629,10 +717,12 @@ f1
select f2 from t2 order by f2;
f2
1
+connection yes_353x;
use priv_db;
drop trigger trg2;
create trigger trg3 before insert on t1 for each row
select f2 into @aaa from t2 where f2=new.f1;
+connection default;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table 't2'
@@ -650,10 +740,12 @@ f2
select @aaa;
@aaa
1
+connection yes_353x;
use priv_db;
drop trigger trg3;
create trigger trg4 before insert on t1 for each row
delete from t2;
+connection default;
use priv_db;
insert into t1 (f1) values (1);
ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table 't2'
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
index fd796dd4550..420bdf2dc2d 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_03e.result
@@ -25,6 +25,7 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT ON `priv_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on db level for create:
--------------------------------------------
@@ -32,11 +33,13 @@ use priv_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv_db;
insert into t1 (f1) values ('insert-yes');
select f1 from t1 order by f1;
f1
insert-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -48,12 +51,14 @@ GRANT SELECT, TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
-----------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -63,6 +68,7 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for colum
select f1 from t1 order by f1;
f1
insert-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -73,6 +79,7 @@ select f1 from t1 order by f1;
f1
insert-yes
trig 1_2-yes
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -83,6 +90,7 @@ f1
insert-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -94,12 +102,14 @@ GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
no trigger privilege on db level for drop:
------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
drop trigger trg1_2;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -117,10 +127,12 @@ trig 1_2-yes
trigger privilege at activation time:
-------------------------------------
+connection default;
select current_user;
current_user
root@localhost
grant TRIGGER on priv_db.* to test_yesprivs@localhost;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -135,6 +147,7 @@ trig 1_2-yes
trigger privilege on db level for drop:
---------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -149,6 +162,7 @@ takes effect after use priv_db:
-------------------------------
use priv_db;
drop trigger trg1_2;
+connection default;
select current_user;
current_user
root@localhost
@@ -175,6 +189,7 @@ GRANT SELECT, UPDATE ON `no_priv_db`.* TO 'test_yesprivs'@'localhost'
use db with trigger privilege on db level and without...:
---------------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -192,6 +207,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
use priv_db;
create trigger trg1_4 before UPDATE on t1 for each row
set new.f1 = 'trig 1_4-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -217,6 +233,8 @@ trig 1_2-yes
trig 1_2-yes
trig 1_3-yes
trig 1_3-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -230,6 +248,8 @@ drop trigger trg1_4;
ERROR HY000: Trigger does not exist
use priv_db;
drop trigger trg1_4;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -252,9 +272,12 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
create User test_noprivs@localhost;
set password for test_noprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_noprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
no trigger privilege on table level for create:
-----------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -270,6 +293,7 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -280,6 +304,7 @@ t1
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -288,6 +313,7 @@ insert into t1 (f1) values ('insert1-yes');
select f1 from t1 order by f1;
f1
insert1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -309,6 +335,7 @@ GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'loca
trigger privilege on table level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -316,6 +343,7 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -325,6 +353,7 @@ f1
insert1-yes
insert2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -343,6 +372,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
no trigger privilege on table level for drop:
---------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -351,6 +381,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
no trigger privilege at activation time:
----------------------------------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -362,6 +393,7 @@ insert1-yes
insert2-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -369,6 +401,7 @@ grant TRIGGER on priv_db.t1 to test_yesprivs@localhost;
trigger privilege at activation time:
-------------------------------------
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -383,6 +416,7 @@ trig 1_2-yes
trigger privilege on table level for drop:
------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -391,6 +425,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
drop trigger trg1_2;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -403,6 +438,7 @@ insert7-yes
trig 1_2-yes
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -435,6 +471,7 @@ GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t2` TO 'test_noprivs'@'localhost'
use table with trigger privilege and without...:
------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -452,6 +489,7 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1_3 INSERT t1 set new.f1 = 'trig 1_3-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg1_4 UPDATE t1 set new.f1 = 'trig 1_4-yes' BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION test_yesprivs@localhost latin1 latin1_swedish_ci latin1_swedish_ci
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -470,6 +508,8 @@ trig 1_2-yes
trig 1_2-yes
trig 1_2-yes
trig 1_3-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -479,6 +519,8 @@ drop trigger trg1_3;
drop trigger trg2_2;
ERROR HY000: Trigger does not exist
drop trigger trg1_4;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -510,6 +552,9 @@ grant SELECT,INSERT on *.* to test_noprivs@localhost;
show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -533,6 +578,7 @@ f1
trig 1_1-yes
trig 1_1-yes
drop trigger priv_db.trg1_5;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -543,6 +589,7 @@ f1
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -558,6 +605,8 @@ revoke TRIGGER on *.* from test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER, EVENT, CREATE TABLESPACE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+disconnect yes_privs;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_yesprivs@localhost
@@ -568,6 +617,7 @@ select * from information_schema.triggers;
TRIGGER_CATALOG TRIGGER_SCHEMA TRIGGER_NAME EVENT_MANIPULATION EVENT_OBJECT_CATALOG EVENT_OBJECT_SCHEMA EVENT_OBJECT_TABLE ACTION_ORDER ACTION_CONDITION ACTION_STATEMENT ACTION_ORIENTATION ACTION_TIMING ACTION_REFERENCE_OLD_TABLE ACTION_REFERENCE_NEW_TABLE ACTION_REFERENCE_OLD_ROW ACTION_REFERENCE_NEW_ROW CREATED SQL_MODE DEFINER CHARACTER_SET_CLIENT COLLATION_CONNECTION DATABASE_COLLATION
drop trigger trg1_1;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -580,12 +630,14 @@ use priv_db;
no trigger privilege on db level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -598,6 +650,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -609,6 +662,7 @@ GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
trigger privilege on db level for create:
-----------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -626,6 +680,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
create trigger priv_db.trg1_9 before UPDATE on priv_db.t1
for each row
set new.f1 = 'trig 1_9-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -646,6 +701,7 @@ f1
insert-yes
drop trigger priv_db.trg1_9;
ERROR 42000: TRIGGER command denied to user 'test_noprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -666,6 +722,7 @@ grant TRIGGER on *.* to test_yesprivs@localhost;
show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT ALL PRIVILEGES ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -673,6 +730,7 @@ use no_priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -693,12 +751,16 @@ select f1 from t1 order by f1;
f1
insert-yes
insert-yes
+disconnect yes_privs;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_yesprivs@localhost
use no_priv_db;
create trigger trg1_2 before INSERT on t1 for each row
set new.f1 = 'trig 1_2-yes';
+disconnect yes_privs;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -721,6 +783,8 @@ f1
insert-yes
insert-yes
trig 1_2-yes
+disconnect no_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -761,11 +825,14 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv1_db`.* TO 'test_noprivs'@'localhost'
GRANT SELECT, INSERT ON `priv2_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
use priv1_db;
trigger privilege on one db1 db level, not on db2
-------------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -778,6 +845,7 @@ use priv2_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig1_1-yes';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -812,6 +880,7 @@ trig 2_1-yes
revoke trigger privilege on table level (not existing)
------------------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -823,6 +892,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -833,6 +903,7 @@ ERROR HY000: Trigger does not exist
use priv1_db;
drop trigger trg1_1;
drop trigger trg2_1;
+connection default;
select current_user;
current_user
root@localhost
@@ -841,6 +912,7 @@ revoke TRIGGER on priv1_db.* from test_yesprivs@localhost;
no trigger privilege on table level for create:
-----------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -848,6 +920,7 @@ use priv1_db;
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 1_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -863,6 +936,7 @@ GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
trigger privilege on table level for create:
--------------------------------------------
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -873,6 +947,7 @@ set new.f1 = 'trig 1_2-yes';
create trigger trg2_1 before INSERT on t2 for each row
set new.f1 = 'trig 2_1-no';
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't2'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -895,6 +970,7 @@ f1
insert1_yes
insert21-yes
insert22-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -905,6 +981,7 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
GRANT ALL PRIVILEGES ON `priv1_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT, UPDATE ON `priv2_db`.* TO 'test_yesprivs'@'localhost'
GRANT TRIGGER ON `priv1_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -914,6 +991,7 @@ ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for tabl
use priv1_db;
create trigger trg2_1 before INSERT on t2 for each row
set new.f1 = 'trig 2_1-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -949,11 +1027,15 @@ trig 2_1-yes
trig 2_1-yes
trig 2_1-yes
trig 2_1-yes
+disconnect no_privs;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
drop trigger trg1_2;
drop trigger trg2_1;
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -974,6 +1056,8 @@ create User test_useprivs@localhost;
set password for test_useprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
revoke ALL PRIVILEGES, GRANT OPTION FROM test_useprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -988,6 +1072,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1001,6 +1086,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert2-no'')';
+connect use_privs,localhost,test_useprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
select current_user;
current_user
test_useprivs@localhost
@@ -1011,6 +1097,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1019,6 +1106,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1029,6 +1117,7 @@ f1
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert4-no'')';
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1039,6 +1128,7 @@ select f1 from t1 order by f1;
f1
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1047,6 +1137,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1057,6 +1148,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert6-no'')';
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1068,6 +1160,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
prepare ins1 from 'insert into t1 (f1) values (''insert7-no'')';
+connection default;
select current_user;
current_user
root@localhost
@@ -1076,6 +1169,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1087,6 +1181,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1098,6 +1193,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1106,6 +1202,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1117,6 +1214,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1129,6 +1227,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1137,6 +1236,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1151,6 +1251,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
deallocate prepare ins1;
+connection use_privs;
select current_user;
current_user
test_useprivs@localhost
@@ -1165,6 +1266,7 @@ trig 1_1-yes
trig 1_1-yes
trig 1_1-yes
deallocate prepare ins1;
+connection default;
select current_user;
current_user
root@localhost
@@ -1173,13 +1275,17 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost' WITH GRANT OPTION
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
drop trigger trg1_1;
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1196,6 +1302,8 @@ create table t1 (f1 char(20)) engine= myisam;
create User test_yesprivs@localhost;
set password for test_yesprivs@localhost = password('PWD');
revoke ALL PRIVILEGES, GRANT OPTION FROM test_yesprivs@localhost;
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
select current_user;
current_user
root@localhost
@@ -1210,6 +1318,7 @@ before INSERT on t1 for each row
set new.f1 = 'trig 1_0-yes';
grant select, insert, update
on priv_db.t1 to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1220,6 +1329,7 @@ select f1 from t1 order by f1;
f1
drop trigger trg1_0;
ERROR 42000: TRIGGER command denied to user 'test_yesprivs'@'localhost' for table 't1'
+connection default;
select current_user;
current_user
root@localhost
@@ -1229,6 +1339,7 @@ show grants for test_yesprivs@localhost;
Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, UPDATE, TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1257,11 +1368,13 @@ select f1 from t1 order by f1;
f1
trig 1_2-yes
trig 1_2-yes
+connection default;
select current_user;
current_user
root@localhost
grant trigger on priv_db.* to test_yesprivs@localhost
with grant option;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1274,9 +1387,12 @@ create definer=not_ex_user@localhost trigger trg1_3
after UPDATE on t1 for each row
set @var1 = 'trig 1_3-yes';
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+connection default;
select current_user;
current_user
root@localhost
+disconnect yes_privs;
+connection default;
select current_user;
current_user
root@localhost
@@ -1307,9 +1423,12 @@ show grants for test_noprivs@localhost;
Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, UPDATE ON `priv_db`.* TO 'test_noprivs'@'localhost'
+connect yes_privs,localhost,test_yesprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect no_privs,localhost,test_noprivs,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
update only on column:
----------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1317,6 +1436,7 @@ grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t1
to test_yesprivs@localhost;
grant SELECT(f1),INSERT,UPDATE(f1) on priv_db.t2
to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1327,6 +1447,7 @@ create trigger trg1_1 before UPDATE on t1 for each row
set new.f1 = 'trig 1_1-yes';
create trigger trg2_1 before UPDATE on t2 for each row
set new.f1 = 'trig 2_1-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1347,6 +1468,7 @@ update t2 set f1 = 'update1_no'
select f1 from t2 order by f1;
f1
trig 2_1-yes
+connection default;
select current_user;
current_user
root@localhost
@@ -1360,12 +1482,14 @@ GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C4973
GRANT TRIGGER ON `priv_db`.* TO 'test_yesprivs'@'localhost'
GRANT SELECT (f1), INSERT ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT (f1), INSERT, UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
use priv_db;
insert into t1 (f1) values ('insert2-yes');
insert into t2 (f1) values ('insert2-yes');
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1391,6 +1515,7 @@ trig 2_1-yes
check if access only on one of three columns
--------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1398,6 +1523,7 @@ alter table priv_db.t1 add f2 char(20), add f3 int;
revoke TRIGGER on priv_db.* from test_yesprivs@localhost;
grant TRIGGER,SELECT on priv_db.t1 to test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1410,6 +1536,7 @@ insert2-yes insert2-yes 1
insert3-yes insert3-yes 2
trig 1_1-yes NULL NULL
trig 1_1-yes NULL NULL
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1424,11 +1551,13 @@ trig 1_1-yes NULL NULL
trig 1_1-yes NULL NULL
trig 1_1-yes update4-yes 10
trig 1_1-yes update4-yes 20
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
create trigger trg1_2 after UPDATE on t1 for each row
set @f2 = 'trig 1_2-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1467,10 +1596,12 @@ trig 2_1-yes
check if rejected without trigger privilege:
--------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
revoke TRIGGER on priv_db.t1 from test_yesprivs@localhost;
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1490,6 +1621,7 @@ trig 1_2-yes
check trigger, but not update privilege on column:
--------------------------------------------------
+connection default;
select current_user;
current_user
root@localhost
@@ -1501,6 +1633,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2), TRIGGER ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection yes_privs;
select current_user;
current_user
test_yesprivs@localhost
@@ -1508,6 +1641,7 @@ use priv_db;
drop trigger trg1_1;
create trigger trg1_3 before UPDATE on t1 for each row
set new.f1 = 'trig 1_3-yes';
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1530,6 +1664,7 @@ NULL
NULL
10
20
+connection default;
select current_user;
current_user
root@localhost
@@ -1541,6 +1676,7 @@ Grants for test_yesprivs@localhost
GRANT USAGE ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT, UPDATE ON `priv_db`.`t2` TO 'test_yesprivs'@'localhost'
GRANT SELECT, SELECT (f1), INSERT, UPDATE (f3, f2, f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
+connection no_privs;
select current_user;
current_user
test_noprivs@localhost
@@ -1558,6 +1694,9 @@ NULL
------------------------------------------------
grant TRIGGER(f1) on priv_db.t1 to test_yesprivs@localhost;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(f1) on priv_db.t1 to test_yesprivs@localhost' at line 1
+disconnect yes_privs;
+disconnect no_privs;
+connection default;
select current_user;
current_user
root@localhost
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
index 7f3277f55e1..9b23271958a 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_0407.result
@@ -69,13 +69,18 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+connect con1_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con1_super,localhost,test_super,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.4:
---------------
+connection default;
use test;
Testcase 3.5.4.1:
-----------------
+connection con1_super;
create database db_drop;
Use db_drop;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
@@ -83,28 +88,33 @@ grant INSERT, SELECT on db_drop.t1 to test_general;
Use db_drop;
Create trigger trg1 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.1';
+connection con1_general;
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
+connection con1_super;
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers
where trigger_schema = 'db_drop'
order by trigger_name;
trigger_schema trigger_name event_object_table
+connection con1_general;
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1 order by f1;
f1
Insert no trigger 3.5.4.1
Trigger 3.5.4.1
+connection con1_super;
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.2:
-----------------
+connection con1_super;
create database db_drop2;
Use db_drop2;
drop table if exists t1_432 ;
@@ -116,6 +126,7 @@ drop database if exists db_drop2;
Testcase 3.5.4.3:
-----------------
+connection con1_super;
create database db_drop3;
Use db_drop3;
drop table if exists t1_433 ;
@@ -139,17 +150,20 @@ drop database if exists db_drop3;
Testcase 3.5.4.4:
-----------------
+connection con1_super;
create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
Create trigger trg4 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.4';
+connection con1_general;
Use db_drop4;
Insert into t1 values ('Insert 3.5.4.4');
Select * from t1;
f1
Trigger 3.5.4.4
+connection con1_super;
Drop database db_drop4;
Show databases like 'db_drop4';
Database (db_drop4)
@@ -161,10 +175,12 @@ create database db_drop4;
Use db_drop4;
create table t1 (f1 char(30)) engine = <engine_to_be_used>;
grant INSERT, SELECT on db_drop4.t1 to test_general;
+connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.4');
Select * from t1;
f1
2nd Insert 3.5.4.4
+connection con1_super;
drop trigger trg4;
ERROR HY000: Trigger does not exist
drop database if exists db_drop4;
@@ -172,17 +188,20 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.4.5:
-----------------
+connection con1_super;
create database db_drop5;
Use db_drop5;
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
Create trigger trg5 BEFORE INSERT on t1
for each row set new.f1='Trigger 3.5.4.5';
+connection con1_general;
Use db_drop5;
Insert into t1 values ('Insert 3.5.4.5');
Select * from t1;
f1
Trigger 3.5.4.5
+connection con1_super;
Drop table t1;
Show tables;
Tables_in_db_drop5
@@ -192,10 +211,12 @@ where information_schema.triggers.trigger_name='trg5';
trigger_schema trigger_name event_object_table
create table t1 (f1 char(50)) engine = <engine_to_be_used>;
grant INSERT, SELECT on t1 to test_general;
+connection con1_general;
Insert into t1 values ('2nd Insert 3.5.4.5');
Select * from t1;
f1
2nd Insert 3.5.4.5
+connection con1_super;
drop trigger trg5;
ERROR HY000: Trigger does not exist
drop database if exists db_drop5;
@@ -203,6 +224,7 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
Testcase 3.5.5:
---------------
+connection default;
use test;
Testcase 3.5.5.1:
@@ -228,6 +250,7 @@ drop view vw3;
Testcase 3.5.5.4:
-----------------
+connection con1_super;
create database dbtest_one;
create database dbtest_two;
use dbtest_two;
@@ -238,6 +261,7 @@ on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
ERROR HY000: Trigger in wrong schema
grant INSERT, SELECT on dbtest_two.t2 to test_general;
grant SELECT on dbtest_one.* to test_general;
+connection con1_general;
use dbtest_two;
Insert into t2 values ('1st Insert 3.5.5.4');
Warnings:
@@ -253,12 +277,14 @@ Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.
+connection con1_super;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
DROP DATABASE if exists dbtest_one;
drop database if EXISTS dbtest_two;
Testcase 3.5.6:
---------------
+connection default;
use test;
Testcase 3.5.6.1 (see Testcase 3.5.1.1)
@@ -466,6 +492,7 @@ delete from tb3 where f121='Test 3.5.7.15/16';
Testcase 3.5.7.17 (see Testcase 3.5.1.1)
----------------------------------------
+connection default;
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
diff --git a/mysql-test/suite/funcs_1/r/myisam_trig_08.result b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
index 4632cfe269c..11bc3b61054 100644
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
@@ -69,6 +69,9 @@ revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
create User test_super@localhost;
set password for test_super@localhost = password('PWD');
grant ALL on *.* to test_super@localhost with grant OPTION;
+connect con2_general,localhost,test_general,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con2_super,localhost,test_super,PWD,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
Testcase 3.5.8.1: (implied in previous tests)
---------------------------------------------
@@ -78,6 +81,7 @@ Testcase 3.5.8.2: (implied in previous tests)
Testcase 3.5.8.3/4:
-------------------
+connection con2_super;
create database db_test;
grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
grant LOCK TABLES on db_test.* to test_general;
@@ -124,6 +128,7 @@ delete from db_test.t1_d where d136= new.f136;
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
END//
+connection con2_general;
Use test;
set @test_var=0;
Insert into tb3 (f120, f122, f136, f144, f163)
@@ -153,11 +158,13 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
+connection con2_super;
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
+connection con2_general;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
@@ -176,11 +183,13 @@ I 00222 0000023456 1.050000000000000000000000000000
3.5.8.4 - single SQL - update
-----------------------------
+connection con2_super;
drop trigger trg2;
Create trigger trg3 BEFORE UPDATE on tb3 for each row
update db_test.t1_u
set u120=new.f120
where u136=new.f136;
+connection con2_general;
update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
where f122='Test 3.5.8.4-Single Insert';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
@@ -197,9 +206,11 @@ U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
+connection con2_super;
drop trigger trg3;
Create trigger trg4 AFTER UPDATE on tb3 for each row
delete from db_test.t1_d where d136= new.f136;
+connection con2_general;
update tb3 set f120='D', f136=444,
f122='Test 3.5.8.4-Single Delete'
where f122='Test 3.5.8.4-Single Update';
@@ -213,10 +224,12 @@ c 00333 0000099999 999.990000000000000000000000000000
3.5.8.3/4 - single SQL - select
-------------------------------
+connection con2_super;
drop trigger trg4;
Create trigger trg5 AFTER UPDATE on tb3 for each row
select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
where u136= new.f136;
+connection con2_general;
set @test_var=0;
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.4-Single Select'
@@ -227,6 +240,7 @@ S Test 3.5.8.4-Single Select 00111 0000023456 1.050000000000000000000000000000
select @test_var;
@test_var
999.990000000000000000000000000000
+connection default;
drop trigger trg1;
drop trigger trg5;
drop database if exists db_test;
@@ -519,6 +533,7 @@ Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
+connection default;
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
index ee7468ff5ba..b937f94d0f3 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result
@@ -14,11 +14,13 @@ SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
SET PASSWORD FOR ddicttestuser2@'localhost' = PASSWORD('ddictpass');
####################################################################################
1.2 Establish connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+connect con100,localhost,ddicttestuser1,ddictpass,information_schema;
####################################################################################
####################################################################################
2 connection default(user=root with default privileges):
SHOW/SELECT shows all processes/threads.
####################################################################################
+connection default;
SHOW CREATE TABLE processlist;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
@@ -95,6 +97,7 @@ ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
####################################################################################
3 Switch to connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+connection con100;
SHOW/SELECT shows only the processes (1) of the user.
####################################################################################
SHOW CREATE TABLE processlist;
@@ -171,6 +174,7 @@ ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'in
4 Grant PROCESS privilege to ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
####################################################################################
4.1 Existing connection con100 (ddicttestuser1)
@@ -178,6 +182,7 @@ The user ddicttestuser1 has the PROCESS privilege, but the connection was
established before PROCESS was granted.
SHOW/SELECT shows only the processes (1) of the user.
####################################################################################
+connection con100;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
@@ -191,6 +196,7 @@ ID ddicttestuser1 HOST_NAME information_schema Query TIME Filling schema table S
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
####################################################################################
+connect con101,localhost,ddicttestuser1,ddictpass,information_schema;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
@@ -208,6 +214,7 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
####################################################################################
+connection default;
create user ''@'localhost';
GRANT PROCESS ON *.* TO ''@'localhost';
####################################################################################
@@ -215,6 +222,7 @@ GRANT PROCESS ON *.* TO ''@'localhost';
anonymous user with PROCESS privilege
SHOW/SELECT shows all processes/threads.
####################################################################################
+connect anonymous1,localhost,"''",,information_schema;
SHOW GRANTS;
Grants for @localhost
GRANT PROCESS ON *.* TO ''@'localhost'
@@ -234,9 +242,11 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost';
####################################################################################
6.1 New connection con102 (ddicttestuser1 has no more PROCESS privilege)
+connect con102,localhost,ddicttestuser1,ddictpass,information_schema;
Again (compared to state before GRANT PROCESS) only the processes of
ddicttestuser1 are visible.
####################################################################################
@@ -257,9 +267,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
####################################################################################
+connection default;
REVOKE PROCESS ON *.* FROM ''@'localhost';
####################################################################################
7.1 New connection (anonymous2,localhost,'',,information_schema)
+connect anonymous2,localhost,"''",,information_schema;
The anonymous user has no more the PROCESS privilege
Again only the processes of the anonymous user are visible.
####################################################################################
@@ -274,9 +286,11 @@ ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost';
####################################################################################
8.1 New connection con103 (ddicttestuser1 with SUPER privilege)
+connect con103,localhost,ddicttestuser1,ddictpass,information_schema;
Only the processes of ddicttestuser1 user are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
@@ -298,9 +312,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE SUPER ON *.* FROM 'ddicttestuser1'@'localhost';
####################################################################################
9.1 New connection con104 (ddicttestuser1 without SUPER privilege)
+connect con104,localhost,ddicttestuser1,ddictpass,information_schema;
ddicttestuser1 has no more the SUPER privilege.
Only the processes of ddicttestuser1 are visible.
####################################################################################
@@ -325,9 +341,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
####################################################################################
+connection default;
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
####################################################################################
10.1 New connection con105 (ddicttestuser1 with SUPER privilege and GRANT OPTION)
+connect con105,localhost,ddicttestuser1,ddictpass,information_schema;
Try to grant PROCESS privilege to user ddicttestuser2 without having it.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
@@ -339,9 +357,11 @@ ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password
10.2 Grant SUPER and PROCESS privilege with grant option to user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
GRANT SUPER,PROCESS ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
####################################################################################
10.3 New connection con106 (ddicttestuser1 with SUPER,PROCESS WITH GRANT OPTION)
+connect con106,localhost,ddicttestuser1,ddictpass,information_schema;
Grant PROCESS privilege to user ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
@@ -350,6 +370,7 @@ GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWO
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
####################################################################################
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
+connect con200,localhost,ddicttestuser2,ddictpass,information_schema;
ddicttestuser2 has now the PROCESS privilege and sees all connections
####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
@@ -385,9 +406,11 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
####################################################################################
+connection con106;
REVOKE PROCESS ON *.* FROM 'ddicttestuser2'@'localhost';
####################################################################################
11.1 New connection con201 (ddicttestuser2)
+connect con201,localhost,ddicttestuser2,ddictpass,information_schema;
ddicttestuser2 has no more the PROCESS privilege and can only see own connects
####################################################################################
SHOW GRANTS;
@@ -405,9 +428,11 @@ ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE SUPER,PROCESS,GRANT OPTION ON *.* FROM 'ddicttestuser1'@'localhost';
####################################################################################
11.3 New connection con107 (ddicttestuser1)
+connect con107,localhost,ddicttestuser1,ddictpass,information_schema;
ddicttestuser1 has no more the PROCESS privilege and can only see own connects
He is also unable to GRANT the PROCESS privilege to ddicttestuser2
####################################################################################
@@ -440,9 +465,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE SELECT ON *.* FROM 'ddicttestuser1'@'localhost';
####################################################################################
12.1 New connection con108 (ddicttestuser1)
+connect con108,localhost,ddicttestuser1,ddictpass,information_schema;
ddicttestuser1 has neither PROCESS nor SELECT privilege
Manual says: Each MySQL user has the right to access these tables, but can see
only the rows ...
@@ -477,12 +504,27 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
####################################################################################
+connection default;
REVOKE SELECT ON information_schema.* FROM 'ddicttestuser3'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
####################################################################################
connection default (user=root)
Cleanup: close connections, DROP USER etc.
####################################################################################
+connection default;
+disconnect con100;
+disconnect con101;
+disconnect con102;
+disconnect con103;
+disconnect con104;
+disconnect con105;
+disconnect con106;
+disconnect con107;
+disconnect con108;
+disconnect con200;
+disconnect con201;
+disconnect anonymous1;
+disconnect anonymous2;
DROP USER ddicttestuser1@'localhost';
DROP USER ddicttestuser2@'localhost';
REVOKE USAGE ON *.* FROM ''@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
index c3c6780a09c..e312b1c60ef 100644
--- a/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_priv_ps.result
@@ -14,11 +14,13 @@ SET PASSWORD FOR ddicttestuser1@'localhost' = PASSWORD('ddictpass');
SET PASSWORD FOR ddicttestuser2@'localhost' = PASSWORD('ddictpass');
####################################################################################
1.2 Establish connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+connect con100,localhost,ddicttestuser1,ddictpass,information_schema;
####################################################################################
####################################################################################
2 connection default(user=root with default privileges):
SHOW/SELECT shows all processes/threads.
####################################################################################
+connection default;
SHOW CREATE TABLE processlist;
Table Create Table
PROCESSLIST CREATE TEMPORARY TABLE `PROCESSLIST` (
@@ -95,6 +97,7 @@ ALTER DATABASE information_schema UPGRADE DATA DIRECTORY NAME;
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
####################################################################################
3 Switch to connection con100 (user=ddicttestuser1 with no PROCESS privilege):
+connection con100;
SHOW/SELECT shows only the processes (1) of the user.
####################################################################################
SHOW CREATE TABLE processlist;
@@ -171,6 +174,7 @@ ERROR 42000: Access denied for user 'ddicttestuser1'@'localhost' to database 'in
4 Grant PROCESS privilege to ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
GRANT PROCESS ON *.* TO ddicttestuser1@'localhost' IDENTIFIED BY 'ddictpass';
####################################################################################
4.1 Existing connection con100 (ddicttestuser1)
@@ -178,6 +182,7 @@ The user ddicttestuser1 has the PROCESS privilege, but the connection was
established before PROCESS was granted.
SHOW/SELECT shows only the processes (1) of the user.
####################################################################################
+connection con100;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
@@ -191,6 +196,7 @@ ID ddicttestuser1 HOST_NAME information_schema Execute TIME Filling schema table
4.2 New connection con101 (ddicttestuser1 with PROCESS privilege)
SHOW/SELECT shows all processes/threads.
####################################################################################
+connect con101,localhost,ddicttestuser1,ddictpass,information_schema;
SHOW GRANTS;
Grants for ddicttestuser1@localhost
GRANT PROCESS ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWORD '*22DA61451703738F203CDB9DB041ACBA1F4760B1'
@@ -208,6 +214,7 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R
5 Grant PROCESS privilege to anonymous user.
connection default (user=root)
####################################################################################
+connection default;
create user ''@'localhost';
GRANT PROCESS ON *.* TO ''@'localhost';
####################################################################################
@@ -215,6 +222,7 @@ GRANT PROCESS ON *.* TO ''@'localhost';
anonymous user with PROCESS privilege
SHOW/SELECT shows all processes/threads.
####################################################################################
+connect anonymous1,localhost,"''",,information_schema;
SHOW GRANTS;
Grants for @localhost
GRANT PROCESS ON *.* TO ''@'localhost'
@@ -234,9 +242,11 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R
6 Revoke PROCESS privilege from ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE PROCESS ON *.* FROM ddicttestuser1@'localhost';
####################################################################################
6.1 New connection con102 (ddicttestuser1 has no more PROCESS privilege)
+connect con102,localhost,ddicttestuser1,ddictpass,information_schema;
Again (compared to state before GRANT PROCESS) only the processes of
ddicttestuser1 are visible.
####################################################################################
@@ -257,9 +267,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
7 Revoke PROCESS privilege from anonymous user
connection default (user=root)
####################################################################################
+connection default;
REVOKE PROCESS ON *.* FROM ''@'localhost';
####################################################################################
7.1 New connection (anonymous2,localhost,'',,information_schema)
+connect anonymous2,localhost,"''",,information_schema;
The anonymous user has no more the PROCESS privilege
Again only the processes of the anonymous user are visible.
####################################################################################
@@ -274,9 +286,11 @@ ID HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY ROWS
8 Grant SUPER (does not imply PROCESS) privilege to ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost';
####################################################################################
8.1 New connection con103 (ddicttestuser1 with SUPER privilege)
+connect con103,localhost,ddicttestuser1,ddictpass,information_schema;
Only the processes of ddicttestuser1 user are visible.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
@@ -298,9 +312,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
9 Revoke SUPER privilege from user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE SUPER ON *.* FROM 'ddicttestuser1'@'localhost';
####################################################################################
9.1 New connection con104 (ddicttestuser1 without SUPER privilege)
+connect con104,localhost,ddicttestuser1,ddictpass,information_schema;
ddicttestuser1 has no more the SUPER privilege.
Only the processes of ddicttestuser1 are visible.
####################################################################################
@@ -325,9 +341,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
10 Grant SUPER privilege with grant option to user ddicttestuser1.
connection default (user=root)
####################################################################################
+connection default;
GRANT SUPER ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
####################################################################################
10.1 New connection con105 (ddicttestuser1 with SUPER privilege and GRANT OPTION)
+connect con105,localhost,ddicttestuser1,ddictpass,information_schema;
Try to grant PROCESS privilege to user ddicttestuser2 without having it.
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
@@ -339,9 +357,11 @@ ERROR 28000: Access denied for user 'ddicttestuser1'@'localhost' (using password
10.2 Grant SUPER and PROCESS privilege with grant option to user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
GRANT SUPER,PROCESS ON *.* TO 'ddicttestuser1'@'localhost' WITH GRANT OPTION;
####################################################################################
10.3 New connection con106 (ddicttestuser1 with SUPER,PROCESS WITH GRANT OPTION)
+connect con106,localhost,ddicttestuser1,ddictpass,information_schema;
Grant PROCESS privilege to user ddicttestuser2
####################################################################################
SHOW GRANTS FOR 'ddicttestuser1'@'localhost';
@@ -350,6 +370,7 @@ GRANT PROCESS, SUPER ON *.* TO 'ddicttestuser1'@'localhost' IDENTIFIED BY PASSWO
GRANT PROCESS ON *.* TO 'ddicttestuser2'@'localhost';
####################################################################################
10.4 New connection con200 (ddicttestuser2 with PROCESS privilege)
+connect con200,localhost,ddicttestuser2,ddictpass,information_schema;
ddicttestuser2 has now the PROCESS privilege and sees all connections
####################################################################################
SHOW GRANTS FOR 'ddicttestuser2'@'localhost';
@@ -385,9 +406,11 @@ ID root HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.000 MEMORY R
11 User ddicttestuser1 revokes PROCESS privilege from user ddicttestuser2
connection ddicttestuser1;
####################################################################################
+connection con106;
REVOKE PROCESS ON *.* FROM 'ddicttestuser2'@'localhost';
####################################################################################
11.1 New connection con201 (ddicttestuser2)
+connect con201,localhost,ddicttestuser2,ddictpass,information_schema;
ddicttestuser2 has no more the PROCESS privilege and can only see own connects
####################################################################################
SHOW GRANTS;
@@ -405,9 +428,11 @@ ID ddicttestuser2 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
11.2 Revoke SUPER,PROCESS,GRANT OPTION privilege from user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE SUPER,PROCESS,GRANT OPTION ON *.* FROM 'ddicttestuser1'@'localhost';
####################################################################################
11.3 New connection con107 (ddicttestuser1)
+connect con107,localhost,ddicttestuser1,ddictpass,information_schema;
ddicttestuser1 has no more the PROCESS privilege and can only see own connects
He is also unable to GRANT the PROCESS privilege to ddicttestuser2
####################################################################################
@@ -440,9 +465,11 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
12 Revoke the SELECT privilege from user ddicttestuser1
connection default (user=root)
####################################################################################
+connection default;
REVOKE SELECT ON *.* FROM 'ddicttestuser1'@'localhost';
####################################################################################
12.1 New connection con108 (ddicttestuser1)
+connect con108,localhost,ddicttestuser1,ddictpass,information_schema;
ddicttestuser1 has neither PROCESS nor SELECT privilege
Manual says: Each MySQL user has the right to access these tables, but can see
only the rows ...
@@ -477,12 +504,27 @@ ID ddicttestuser1 HOST_NAME information_schema Sleep TIME NULL TIME_MS 0 0 0.00
12.2 Revoke only the SELECT privilege on the information_schema from ddicttestuser1.
connection default (user=root)
####################################################################################
+connection default;
REVOKE SELECT ON information_schema.* FROM 'ddicttestuser3'@'localhost';
ERROR 42000: Access denied for user 'root'@'localhost' to database 'information_schema'
####################################################################################
connection default (user=root)
Cleanup: close connections, DROP USER etc.
####################################################################################
+connection default;
+disconnect con100;
+disconnect con101;
+disconnect con102;
+disconnect con103;
+disconnect con104;
+disconnect con105;
+disconnect con106;
+disconnect con107;
+disconnect con108;
+disconnect con200;
+disconnect con201;
+disconnect anonymous1;
+disconnect anonymous2;
DROP USER ddicttestuser1@'localhost';
DROP USER ddicttestuser2@'localhost';
REVOKE USAGE ON *.* FROM ''@'localhost';
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
index acf81d090d1..170ba0c2efb 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_no_prot.result
@@ -74,10 +74,8 @@ Has TIME a reasonable value?
# Ensure that the information about an inactive connection is correct.
#--------------------------------------------------------------------------
-# ----- establish connection con1 (user = test_user) -----
-
-# ----- switch to connection default (user = root) -----
-
+connect con1,localhost,test_user,ddictpass,information_schema;
+connection default;
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -112,8 +110,7 @@ Expect 1
# because he has not the PROCESS privilege.
#----------------------------------------------------------------------------
-# ----- switch to connection con1 (user = test_user) -----
-
+connection con1;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
@@ -123,14 +120,11 @@ Id User Host db Command Time State Info Progress
# Ensure that the user test_user sees all connections with his username.
#----------------------------------------------------------------------------
------ establish connection con2 (user = test_user) ------
-
-# ----- switch to connection default (user = root) -----
-
+connect con2,localhost,test_user,ddictpass,information_schema;
+connection default;
# Poll till all connections of 'test_user' are in a state with COMMAND = 'Sleep'
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
<ID> test_user <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
@@ -139,22 +133,19 @@ SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
-# ----- switch to connection default (user = root) -----
-
+connection default;
SELECT ID INTO @test_user_con2_id FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID <> @test_user_con1_id
AND USER = 'test_user' AND DB = 'information_schema';
# Ensure we get correct information about a connection during work
#----------------------------------------------------------------------------
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Send a long enough running statement to the server, but do not
# wait till the result comes back.
SELECT sleep(10), 17;
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -179,14 +170,12 @@ Has STATE the expected value?
SELECT @info = 'SELECT sleep(10), 17' AS "Has INFO the expected value?";
Has INFO the expected value?
1
-# ----- switch to connection con2 (user = testuser) -----
-
+connection con2;
# Pull("reap") the result set from the statement executed with "send".
sleep(10) 17
0 17
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till all connections of 'test_user' are in a state with COMMAND = 'Sleep'
# Ensure that we see that a connection "hangs" when colliding with a
@@ -194,14 +183,12 @@ sleep(10) 17
#----------------------------------------------------------------------------
LOCK TABLE test.t1 WRITE;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Send a statement to the server, but do not wait till the result
# comes back. We will pull this later.
SELECT COUNT(*) FROM test.t1;
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -210,8 +197,7 @@ ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
<ID> root <HOST_NAME> information_schema Query <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Pull("reap") the result set from the statement executed with "send".
COUNT(*)
@@ -219,17 +205,14 @@ COUNT(*)
# Ensure that SHOW/SELECT processlist can handle extreme long commands
#----------------------------------------------------------------------------
-# ----- switch to connection default (user = root) -----
-
+connection default;
LOCK TABLE test.t1 WRITE;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Send a long (~20 KB code) statement to the server, but do not wait
# till the result comes back. We will pull this later.
SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1;
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
# Expect result:
@@ -254,15 +237,13 @@ Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL 0.000
<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representativ 0.000
UNLOCK TABLES;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Pull("reap") the result set from the monster statement executed with "send".
count(*) Long string
0 BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END
-# ----- switch to connection default (user = root) -----
-
------ disconnect con1 and con2 -----
-
+connection default;
+disconnect con1;
+disconnect con2;
DROP USER test_user@'localhost';
DROP TABLE test.t1;
diff --git a/mysql-test/suite/funcs_1/r/processlist_val_ps.result b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
index 8e5ef80fcf7..5914c8e7844 100644
--- a/mysql-test/suite/funcs_1/r/processlist_val_ps.result
+++ b/mysql-test/suite/funcs_1/r/processlist_val_ps.result
@@ -74,10 +74,8 @@ Has TIME a reasonable value?
# Ensure that the information about an inactive connection is correct.
#--------------------------------------------------------------------------
-# ----- establish connection con1 (user = test_user) -----
-
-# ----- switch to connection default (user = root) -----
-
+connect con1,localhost,test_user,ddictpass,information_schema;
+connection default;
# Poll till the connection con1 is in state COMMAND = 'Sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -112,8 +110,7 @@ Expect 1
# because he has not the PROCESS privilege.
#----------------------------------------------------------------------------
-# ----- switch to connection con1 (user = test_user) -----
-
+connection con1;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
@@ -123,14 +120,11 @@ Id User Host db Command Time State Info Progress
# Ensure that the user test_user sees all connections with his username.
#----------------------------------------------------------------------------
------ establish connection con2 (user = test_user) ------
-
-# ----- switch to connection default (user = root) -----
-
+connect con2,localhost,test_user,ddictpass,information_schema;
+connection default;
# Poll till all connections of 'test_user' are in a state with COMMAND = 'Sleep'
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_USED EXAMINED_ROWS QUERY_ID INFO_BINARY TID
<ID> test_user <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
@@ -139,22 +133,19 @@ SHOW FULL PROCESSLIST;
Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL 0.000
<ID> test_user <HOST_NAME> information_schema Query <TIME> init SHOW FULL PROCESSLIST 0.000
-# ----- switch to connection default (user = root) -----
-
+connection default;
SELECT ID INTO @test_user_con2_id FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE ID <> @test_user_con1_id
AND USER = 'test_user' AND DB = 'information_schema';
# Ensure we get correct information about a connection during work
#----------------------------------------------------------------------------
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Send a long enough running statement to the server, but do not
# wait till the result comes back.
SELECT sleep(10), 17;
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till connection con2 is in state 'User sleep'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -179,14 +170,12 @@ Has STATE the expected value?
SELECT @info = 'SELECT sleep(10), 17' AS "Has INFO the expected value?";
Has INFO the expected value?
1
-# ----- switch to connection con2 (user = testuser) -----
-
+connection con2;
# Pull("reap") the result set from the statement executed with "send".
sleep(10) 17
0 17
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till all connections of 'test_user' are in a state with COMMAND = 'Sleep'
# Ensure that we see that a connection "hangs" when colliding with a
@@ -194,14 +183,12 @@ sleep(10) 17
#----------------------------------------------------------------------------
LOCK TABLE test.t1 WRITE;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Send a statement to the server, but do not wait till the result
# comes back. We will pull this later.
SELECT COUNT(*) FROM test.t1;
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST;
@@ -210,8 +197,7 @@ ID USER HOST DB COMMAND TIME STATE INFO TIME_MS STAGE MAX_STAGE PROGRESS MEMORY_
<ID> test_user <HOST_NAME> information_schema Sleep <TIME> NULL <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> NULL <TID>
<ID> root <HOST_NAME> information_schema Execute <TIME> Filling schema table SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TIME_MS> 0 0 0.000 <MEMORY> <ROWS> <QUERY_ID> SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST <TID>
UNLOCK TABLES;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Pull("reap") the result set from the statement executed with "send".
COUNT(*)
@@ -219,17 +205,14 @@ COUNT(*)
# Ensure that SHOW/SELECT processlist can handle extreme long commands
#----------------------------------------------------------------------------
-# ----- switch to connection default (user = root) -----
-
+connection default;
LOCK TABLE test.t1 WRITE;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Send a long (~20 KB code) statement to the server, but do not wait
# till the result comes back. We will pull this later.
SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END' AS "Long string" FROM test.t1;
-# ----- switch to connection default (user = root) -----
-
+connection default;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
# Expect result:
@@ -254,15 +237,13 @@ Id User Host db Command Time State Info Progress
<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> NULL 0.000
<ID> test_user <HOST_NAME> information_schema <COMMAND> <TIME> <STATE> SELECT count(*),'BEGIN-This is the representative of a very long statement.This is the representativ 0.000
UNLOCK TABLES;
-# ----- switch to connection con2 (user = test_user) -----
-
+connection con2;
# Pull("reap") the result set from the monster statement executed with "send".
count(*) Long string
0 BEGIN-This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.This is the representative of a very long statement.-END
-# ----- switch to connection default (user = root) -----
-
------ disconnect con1 and con2 -----
-
+connection default;
+disconnect con1;
+disconnect con2;
DROP USER test_user@'localhost';
DROP TABLE test.t1;
diff --git a/mysql-test/suite/funcs_1/r/storedproc.result b/mysql-test/suite/funcs_1/r/storedproc.result
index 655a5d3ff96..b995fa730c0 100644
--- a/mysql-test/suite/funcs_1/r/storedproc.result
+++ b/mysql-test/suite/funcs_1/r/storedproc.result
@@ -1832,9 +1832,11 @@ CREATE PROCEDURE sp11() insert into mysql.t1 values('a');
SELECT security_type from mysql.proc where specific_name='sp11';
security_type
DEFINER
+connect u_1, localhost, user_1, , db_storedproc;
user_1@localhost db_storedproc
CALL sp11();
+connection default;
USE db_storedproc;
root@localhost db_storedproc
@@ -1842,12 +1844,15 @@ alter procedure sp11 sql security invoker;
SELECT security_type from mysql.proc where specific_name='sp11';
security_type
INVOKER
+connection u_1;
user_1@localhost db_storedproc
USE db_storedproc;
CALL sp11();
ERROR 42000: INSERT command denied to user 'user_1'@'localhost' for table 't1'
commit work;
+disconnect u_1;
+connection default;
root@localhost db_storedproc
alter procedure sp11 sql security DEFINER;
diff --git a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
index 8382bcc1e55..930322e203a 100644
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
@@ -88,7 +88,6 @@ CALL sp31102();
SELECT fn31105( 9 );
# now 'add' EXECUTE to INVOKER
---echo connection default;
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
@@ -107,7 +106,6 @@ SELECT fn31105( 9 );
disconnect user2_3;
# now 'remove' SELECT from INVOKER
---echo connection default;
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
diff --git a/mysql-test/suite/funcs_1/t/charset_collation.test b/mysql-test/suite/funcs_1/t/charset_collation.test
index 186eb1f5b85..44199c60251 100644
--- a/mysql-test/suite/funcs_1/t/charset_collation.test
+++ b/mysql-test/suite/funcs_1/t/charset_collation.test
@@ -18,7 +18,6 @@
DROP USER dbdict_test@localhost;
CREATE USER dbdict_test@localhost;
---echo # Establish connection con (user=dbdict_test)
connect (con,localhost,dbdict_test,,);
################################################################################
#
@@ -100,8 +99,6 @@ ORDER BY collation_name, character_set_name;
# Cleanup
---echo # Switch to connection default + disconnect con
connection default;
disconnect con;
DROP USER dbdict_test@localhost;
-
diff --git a/mysql-test/suite/funcs_1/t/is_basics_mixed.test b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
index 21efafb5afa..c0b03a84478 100644
--- a/mysql-test/suite/funcs_1/t/is_basics_mixed.test
+++ b/mysql-test/suite/funcs_1/t/is_basics_mixed.test
@@ -43,7 +43,6 @@ SHOW DATABASES LIKE 'information_schema';
#
# Note: The "for query purposes only" is checked in other tests.
# High privileged user (root)
---echo # Switch to connection default
connection default;
USE test;
SELECT DATABASE();
@@ -54,14 +53,12 @@ SELECT DATABASE();
DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
# Low privileged user
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
SELECT DATABASE();
USE information_schema;
SELECT DATABASE();
#
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
@@ -89,7 +86,6 @@ CREATE DATABASE information_schema;
#
# 1. High privileged user (root)
---echo # Switch to connection default (user=root)
connection default;
--source suite/funcs_1/datadict/basics_mixed1.inc
@@ -99,12 +95,10 @@ DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
GRANT ALL ON *.* TO testuser1@localhost;
SHOW GRANTS FOR testuser1@localhost;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
--source suite/funcs_1/datadict/basics_mixed1.inc
---echo # Switch to connection default (user=root) and close connection testuser1
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
@@ -270,7 +264,6 @@ GRANT CREATE VIEW ON information_schema.* TO 'u_6_401018'@'localhost';
# Check 1: Show that a "simple" user (<> root) has the permission to SELECT
# on some INFORMATION_SCHEMA table.
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
SELECT table_schema,table_name FROM information_schema.tables
@@ -298,7 +291,6 @@ SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
GRANT SELECT ON db_datadict.v2 to testuser2@localhost;
#
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
@@ -307,7 +299,6 @@ SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE
FROM information_schema.tables WHERE table_schema = 'db_datadict';
# Cleanup
---echo # Switch to connection default and close connections testuser1 and testuser2
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -445,13 +436,11 @@ DROP USER 'testuser1'@'localhost';
CREATE USER 'testuser1'@'localhost';
GRANT ALL ON test.* TO 'testuser1'@'localhost';
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
--source suite/funcs_1/datadict/basics_mixed3.inc
# Cleanup
---echo # Switch to connection default and close connections testuser1 and testuser2
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/t/is_column_privileges.test b/mysql-test/suite/funcs_1/t/is_column_privileges.test
index cb8c50c01b7..7c0d7c7c063 100644
--- a/mysql-test/suite/funcs_1/t/is_column_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_column_privileges.test
@@ -131,17 +131,14 @@ WITH GRANT OPTION;
eval $select;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $select;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
eval $select;
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , db_datadict);
@@ -158,12 +155,10 @@ GRANT SELECT(f1, f3) ON db_datadict.t1 TO 'testuser2'@'localhost';
--echo # FIXME: Is it intended that *my* grants to others are *NOT* shown here?
eval $select;
---echo # Switch to connection testuser2 (user=testuser2)
connection testuser2;
eval $select;
# Cleanup
---echo # Switch to connection default and close connections testuser1,testuser2,testuser3
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -214,71 +209,59 @@ let $my_show = SHOW GRANTS FOR 'testuser1'@'localhost';
eval $my_select;
eval $my_show;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
eval $my_select;
eval $my_show;
---echo # Switch to connection default
connection default;
GRANT SELECT (f1,f3) ON db_datadict.my_table TO 'testuser1'@'localhost';
eval $my_select;
eval $my_show;
---echo # Switch to connection testuser1
connection testuser1;
eval $my_select;
eval $my_show;
---echo # Switch to connection default
connection default;
ALTER TABLE db_datadict.my_table DROP COLUMN f3;
GRANT UPDATE (f1) ON db_datadict.my_table TO 'testuser1'@'localhost';
eval $my_select;
eval $my_show;
---echo # Switch to connection testuser1
connection testuser1;
eval $my_select;
eval $my_show;
--error ER_BAD_FIELD_ERROR
SELECT f1, f3 FROM db_datadict.my_table;
---echo # Switch to connection default
connection default;
ALTER TABLE db_datadict.my_table CHANGE COLUMN f1 my_col BIGINT;
eval $my_select;
eval $my_show;
---echo # Switch to connection testuser1
connection testuser1;
eval $my_select;
eval $my_show;
---echo # Switch to connection default
connection default;
DROP TABLE db_datadict.my_table;
eval $my_select;
eval $my_show;
---echo # Switch to connection testuser1
connection testuser1;
eval $my_select;
eval $my_show;
---echo # Switch to connection default
connection default;
REVOKE ALL ON db_datadict.my_table FROM 'testuser1'@'localhost';
eval $my_select;
eval $my_show;
---echo # Switch to connection testuser1
connection testuser1;
eval $my_select;
eval $my_show;
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
index 33269fe929c..200ee66e2a1 100644
--- a/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
+++ b/mysql-test/suite/funcs_1/t/is_column_privileges_is_mysql_test.test
@@ -45,7 +45,6 @@ eval $my_show1;
eval $my_show2;
eval $my_show3;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select;
@@ -54,7 +53,6 @@ eval $my_show2;
eval $my_show3;
# Cleanup
---echo # Switch to connection default and close connection testuser1
connection default;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
diff --git a/mysql-test/suite/funcs_1/t/is_columns.test b/mysql-test/suite/funcs_1/t/is_columns.test
index c5fe18fef20..5fb72713742 100644
--- a/mysql-test/suite/funcs_1/t/is_columns.test
+++ b/mysql-test/suite/funcs_1/t/is_columns.test
@@ -148,7 +148,6 @@ eval $my_show1;
eval $my_show2;
eval $my_show3;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--source suite/funcs_1/datadict/datadict_bug_12777.inc
@@ -158,7 +157,6 @@ eval $my_show1;
eval $my_show2;
eval $my_show3;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
--source suite/funcs_1/datadict/datadict_bug_12777.inc
@@ -169,7 +167,6 @@ eval $my_show2;
--error ER_TABLEACCESS_DENIED_ERROR
eval $my_show3;
---echo # Switch to connection default and close connections testuser1, testuser2
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/t/is_schema_privileges.test b/mysql-test/suite/funcs_1/t/is_schema_privileges.test
index 1f408d71b39..fdf09a6f94b 100644
--- a/mysql-test/suite/funcs_1/t/is_schema_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_schema_privileges.test
@@ -115,7 +115,6 @@ ORDER BY grantee,table_schema,privilege_type;
let $show_testuser1 = SHOW GRANTS FOR 'testuser1'@'localhost';
let $show_testuser2 = SHOW GRANTS FOR 'testuser2'@'localhost';
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
GRANT SELECT ON db_datadict_4.* TO 'testuser2'@'localhost';
@@ -132,7 +131,6 @@ eval $show_testuser1;
--error ER_DBACCESS_DENIED_ERROR
eval $show_testuser2;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , test);
--echo # Root granted SELECT db_datadict_1 to me -> visible
@@ -145,7 +143,6 @@ eval $my_select;
eval $show_testuser1;
eval $show_testuser2;
---echo # Switch to connection default and close connections testuser1 and testuser2
connection default;
disconnect testuser1;
disconnect testuser2;
@@ -197,73 +194,55 @@ ORDER BY grantee,table_schema,privilege_type;
############ Check grant SCHEMA
eval $my_select;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
eval $my_select;
---echo # Switch to connection default
connection default;
GRANT UPDATE ON db_datadict.* TO 'testuser1'@'localhost';
eval $my_select;
---echo # Switch to connection testuser1
eval $my_select;
############ Check RENAME SCHEMA
# Implement this if RENAME SCHEMA is again available.
# Note(mleich): I expect that RENAME has no impact on the result sets, because
# the schema_name is not migrated.
-# --echo # Switch to connection default
# connection default;
# RENAME SCHEMA db_datadict TO db_datadictx;
# eval $my_select;
-# --echo # Switch to connection testuser1
# eval $my_select;
# RENAME SCHEMA db_datadictx TO db_datadict;
############ Check extend PRIVILEGES (affects PRIVILEGE_TYPE) on SCHEMA
---echo # Switch to connection default
connection default;
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost';
eval $my_select;
---echo # Switch to connection testuser1
eval $my_select;
############ Check extend PRIVILEGES (affects IS_GRANTABLE) on SCHEMA
--echo # Switch to connection default
connection default;
GRANT SELECT ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
eval $my_select;
---echo # Switch to connection testuser1
eval $my_select;
############ Check DROP SCHEMA
# No impact, because there is no "maintenance" of privileges.
---echo # Switch to connection default
connection default;
DROP SCHEMA db_datadict;
eval $my_select;
---echo # Switch to connection testuser1
eval $my_select;
############ Check REVOKE PRIVILEGE
---echo # Switch to connection default
connection default;
REVOKE UPDATE ON db_datadict.* FROM 'testuser1'@'localhost';
eval $my_select;
---echo # Switch to connection testuser1
eval $my_select;
############ Check RENAME USER
---echo # Switch to connection default
connection default;
RENAME USER 'testuser1'@'localhost' TO 'the_user'@'localhost';
eval $my_select;
---echo # Switch to connection testuser1
eval $my_select;
---echo # Close connection testuser1
disconnect testuser1;
---echo # Establish connection the_user (user=the_user)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (the_user, localhost, the_user, , test);
eval $my_select;
---echo # Close connection the_user
disconnect the_user;
############ Check DROP USER
---echo # Switch to connection default
connection default;
eval $my_select;
DROP USER 'the_user'@'localhost';
diff --git a/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
index 3f60f71fe9a..f1e0d571057 100644
--- a/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
+++ b/mysql-test/suite/funcs_1/t/is_schema_privileges_is_mysql_test.test
@@ -45,7 +45,6 @@ eval $my_show1;
eval $my_show2;
eval $my_show3;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select;
@@ -54,8 +53,6 @@ eval $my_show2;
eval $my_show3;
# Cleanup
---echo # Switch to connection default and close connection testuser1
connection default;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
-
diff --git a/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test b/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
index 9bfbf0cf335..6b515bc596a 100644
--- a/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
+++ b/mysql-test/suite/funcs_1/t/is_schemata_is_mysql_test.test
@@ -45,7 +45,6 @@ eval $my_show1;
eval $my_show2;
eval $my_show3;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
eval $my_select;
@@ -54,8 +53,6 @@ eval $my_show2;
eval $my_show3;
# Cleanup
---echo # Switch to connection default and close connection testuser1
connection default;
DROP USER 'testuser1'@'localhost';
DROP DATABASE db_datadict;
-
diff --git a/mysql-test/suite/funcs_1/t/is_statistics.test b/mysql-test/suite/funcs_1/t/is_statistics.test
index 458892a6d91..3cdc5568960 100644
--- a/mysql-test/suite/funcs_1/t/is_statistics.test
+++ b/mysql-test/suite/funcs_1/t/is_statistics.test
@@ -139,7 +139,6 @@ eval $my_select;
eval $my_show1;
eval $my_show2;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , test);
# nothing visible for testuser1
@@ -148,7 +147,6 @@ eval $my_show1;
--error ER_DBACCESS_DENIED_ERROR
eval $my_show2;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , test);
# nothing visible for testuser2
@@ -157,7 +155,6 @@ eval $my_select;
eval $my_show1;
eval $my_show2;
---echo # Switch to connection default
connection default;
GRANT SELECT ON db_datadict.t1 TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT(f1,f5) ON db_datadict_2.t3 TO 'testuser1'@'localhost';
@@ -165,33 +162,28 @@ eval $my_select;
eval $my_show1;
eval $my_show2;
---echo # Switch to connection testuser1
connection testuser1;
eval $my_select;
eval $my_show1;
--error ER_DBACCESS_DENIED_ERROR
eval $my_show2;
---echo # Switch to connection testuser2
connection testuser2;
eval $my_select;
--error ER_DBACCESS_DENIED_ERROR
eval $my_show1;
eval $my_show2;
---echo # Switch to connection default
connection default;
REVOKE SELECT,GRANT OPTION ON db_datadict.t1 FROM 'testuser1'@'localhost';
eval $my_show1;
---echo # Switch to connection testuser1
# nothing visible for testuser1
connection testuser1;
eval $my_select;
eval $my_show1;
# Cleanup
---echo # Switch to connection default and close connections testuser1, testuser2
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/t/is_table_constraints.test b/mysql-test/suite/funcs_1/t/is_table_constraints.test
index 79766fc1dff..d1659517e79 100644
--- a/mysql-test/suite/funcs_1/t/is_table_constraints.test
+++ b/mysql-test/suite/funcs_1/t/is_table_constraints.test
@@ -132,7 +132,6 @@ eval $my_show1;
--replace_column 6 ### 7 ### 8 ### 9 ### 10 ### 11 ### 12 ###
eval $my_show2;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
SHOW GRANTS FOR 'testuser1'@'localhost';
@@ -143,7 +142,6 @@ eval $my_show1;
eval $my_show2;
# Cleanup
---echo # Switch to connection default and close connection testuser1
connection default;
disconnect testuser1;
DROP USER 'testuser1'@'localhost';
diff --git a/mysql-test/suite/funcs_1/t/is_table_privileges.test b/mysql-test/suite/funcs_1/t/is_table_privileges.test
index 5ea0dd7c6a7..df28f2caaef 100644
--- a/mysql-test/suite/funcs_1/t/is_table_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_table_privileges.test
@@ -115,7 +115,6 @@ let $my_select = SELECT * FROM information_schema.table_privileges
WHERE table_name LIKE 'tb%'
ORDER BY grantee,table_schema,table_name,privilege_type;
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--replace_result $other_engine_type <other_engine_type>
@@ -126,21 +125,18 @@ GRANT SELECT ON db_datadict.tb3 TO 'testuser3'@'localhost';
eval $my_select;
SHOW GRANTS FOR 'testuser1'@'localhost';
---echo # Establish connection testuser2 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
# we see only table privileges for this user, and not any other privileges
eval $my_select;
SHOW GRANTS FOR 'testuser2'@'localhost';
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , db_datadict);
# we see only table privileges for this user, and not any other privileges
eval $my_select;
SHOW GRANTS FOR 'testuser3'@'localhost';
---echo # Switch to connection default and close the other connections
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/funcs_1/t/is_user_privileges.test b/mysql-test/suite/funcs_1/t/is_user_privileges.test
index 0f0e398d75b..a61e9187d15 100644
--- a/mysql-test/suite/funcs_1/t/is_user_privileges.test
+++ b/mysql-test/suite/funcs_1/t/is_user_privileges.test
@@ -117,7 +117,6 @@ eval $my_select1;
eval $my_select2;
--horizontal_results
---echo # Establish connection testuser1 (user=testuser1)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser1, localhost, testuser1, , db_datadict);
--vertical_results
@@ -129,7 +128,6 @@ eval $my_show;
--echo
--echo # Now add SELECT on *.* to testuser1;
---echo # Switch to connection default
connection default;
GRANT SELECT ON *.* TO 'testuser1'@'localhost';
--echo #
@@ -147,7 +145,6 @@ eval $my_select1;
eval $my_select2;
--horizontal_results
---echo # Switch to connection testuser1
# check that this appears
connection testuser1;
--vertical_results
@@ -156,7 +153,6 @@ eval $my_select2;
--horizontal_results
eval $my_show;
---echo # Establish connection testuser2 (user=testuser2)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser2, localhost, testuser2, , db_datadict);
--vertical_results
@@ -166,7 +162,6 @@ eval $my_select2;
--horizontal_results
eval $my_show;
---echo # Establish connection testuser3 (user=testuser3)
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (testuser3, localhost, testuser3, , test);
--vertical_results
@@ -178,7 +173,6 @@ eval $my_show;
--echo
--echo # Revoke privileges from testuser1;
---echo # Switch to connection default
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
--vertical_results
@@ -186,7 +180,6 @@ eval $my_select1;
eval $my_select2;
--horizontal_results
---echo # Switch to connection testuser1
# check for changes
connection testuser1;
--vertical_results
@@ -211,7 +204,6 @@ CREATE TABLE db_datadict.tb_66 ( c1 TEXT );
--echo
--echo # Add ALL on db_datadict.* (and select on mysql.user) to testuser1;
---echo # Switch to connection default
connection default;
GRANT ALL ON db_datadict.* TO 'testuser1'@'localhost' WITH GRANT OPTION;
GRANT SELECT ON mysql.user TO 'testuser1'@'localhost';
@@ -220,7 +212,6 @@ eval $my_select1;
eval $my_select2;
--horizontal_results
---echo # Switch to connection testuser1
connection testuser1;
--vertical_results
eval $my_select1;
@@ -246,7 +237,6 @@ ENGINE = $other_engine_type;
--echo
--echo # Revoke privileges from testuser1;
---echo # Switch to connection default
connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testuser1'@'localhost';
--vertical_results
@@ -254,7 +244,6 @@ eval $my_select1;
eval $my_select2;
--horizontal_results
---echo # Switch to connection testuser1
# check for changes
connection testuser1;
--vertical_results
@@ -278,7 +267,6 @@ CREATE TABLE db_datadict.tb_59 ( c1 TEXT )
ENGINE = $other_engine_type;
# Cleanup
---echo # Switch to connection default and close connections testuser1,testuser2,testuser3
connection default;
disconnect testuser1;
disconnect testuser2;
diff --git a/mysql-test/suite/handler/aria.result b/mysql-test/suite/handler/aria.result
index e0b98bd36a0..43720eaa4bb 100644
--- a/mysql-test/suite/handler/aria.result
+++ b/mysql-test/suite/handler/aria.result
@@ -538,17 +538,19 @@ handler t1 open;
handler t1 read first;
c1
1
+connect con2,localhost,root,,;
+connection con2;
send the below to another connection, do not wait for the result
optimize table t1;
-proceed with the normal connection
+connection default;
handler t1 read next;
c1
1
handler t1 close;
-read the result from the other connection
+connection con2;
Table Op Msg_type Msg_text
test.t1 optimize status OK
-proceed with the normal connection
+connection default;
drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY using btree (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
@@ -569,26 +571,28 @@ insert into t1 values (14397);
flush tables with read lock;
drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
-send the below to another connection, do not wait for the result
+connection con2;
drop table t1;
-proceed with the normal connection
+connection default;
select * from t1;
c1
14397
unlock tables;
+connection con2;
read the result from the other connection
-proceed with the normal connection
+connection default;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
create table t1 (a int not null) ENGINE=csv;
---> client 2
+connection con2;
handler t1 open;
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
---> client 1
+connection default;
drop table t1;
+disconnect con2;
create table t1 (a int);
handler t1 open as t1_alias;
handler t1_alias read a next;
@@ -968,15 +972,17 @@ handler t1 close;
# Explore the effect of HANDLER locks on concurrent DDL
#
handler t1 open;
-# Establishing auxiliary connections con1, con2, con3
-# --> connection con1;
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connect con3, localhost, root,,;
+connection con1;
# Sending:
drop table t1 ;
# We can't use connection 'default' as wait_condition will
# autoclose handlers.
-# --> connection con2
+connection con2;
# Waitng for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
handler t1 read a prev;
a b
5 NULL
@@ -984,9 +990,9 @@ handler t1 read a prev;
a b
4 NULL
handler t1 close;
-# --> connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Explore the effect of HANDLER locks in parallel with SELECT
#
@@ -1008,12 +1014,12 @@ handler t1 read a prev;
a
4
handler t1 close;
-# --> connection con1;
+connection con1;
# Sending:
drop table t1 ;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
# We can still use the table, it's part of the transaction
select * from t1;
a
@@ -1038,10 +1044,10 @@ handler t1 read a prev;
a
3
handler t1 close;
-# --> connection con1
+connection con1;
# Now drop can proceed
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Demonstrate that HANDLER locks and transaction locks
# reside in the same context.
@@ -1058,12 +1064,12 @@ a
3
4
5
-# --> connection con2
+connection con2;
# Sending:
rename table t0 to t3, t1 to t0, t3 to t1;
-# --> connection con1
+connection con1;
# Waiting for 'rename table ...' to get blocked...
-# --> connection default
+connection default;
# We back-off on hitting deadlock condition.
handler t0 open;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
@@ -1077,9 +1083,9 @@ a
handler t1 open;
commit;
handler t1 close;
-# --> connection con2
+connection con2;
# Reaping 'rename table ...'...
-# --> connection default
+connection default;
handler t1 open;
handler t1 read a prev;
a
@@ -1095,22 +1101,22 @@ drop table t0;
#
create table t2 (a int, key a (a));
handler t1 open;
-# --> connection con1
+connection con1;
lock tables t2 read;
-# --> connection con2
+connection con2;
# Sending 'drop table t2'...
drop table t2;
-# --> connection con1
+connection con1;
# Waiting for 'drop table t2' to get blocked...
-# --> connection default
+connection default;
# Sending 'select * from t2'
select * from t2;
-# --> connection con1
+connection con1;
# Waiting for 'select * from t2' to get blocked...
unlock tables;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
-# --> connection default
+connection default;
# Reaping 'select * from t2'
ERROR 42S02: Table 'test.t2' doesn't exist
handler t1 close;
@@ -1134,29 +1140,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1166,9 +1172,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
drop table t3;
#
@@ -1193,29 +1199,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1225,9 +1231,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
#
# Show that rollback to the savepoint taken in the beginning
@@ -1254,25 +1260,25 @@ handler t3 read a first;
a
1
rollback to savepoint sv;
-# --> connection con1
+connection con1;
drop table t1, t2;
# Sending:
drop table t3;
# Let DROP TABLE statement sync in.
-# --> connection con2
+connection con2;
# Waiting for 'drop table t3' to get blocked...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t3 read a next;
a
2
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t3 close;
-# connection con1
+connection con1;
# Reaping 'drop table t3'...
-# --> connection default
+connection default;
commit;
#
# If we have to wait on an exclusive locks while having
@@ -1281,27 +1287,27 @@ commit;
create table t1 (a int, key a(a));
create table t2 like t1;
handler t1 open;
-# --> connection con1
+connection con1;
lock table t1 write, t2 write;
-# --> connection default
+connection default;
drop table t2;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t2' to get blocked...
-# --> connection con1
+connection con1;
drop table t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
unlock tables;
-# --> connection default
+connection default;
# Demonstrate that there is no deadlock with FLUSH TABLE,
# even though it is waiting for the other table to go away
create table t2 like t1;
# Sending:
flush table t2;
-# --> connection con2
+connection con2;
drop table t1;
-# --> connection con1
+connection con1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'flush table t2'...
drop table t2;
#
@@ -1310,20 +1316,20 @@ drop table t2;
#
create table t1 (a int, key using btree (a));
insert into t1 values (1), (2);
-# --> connection default
+connection default;
begin;
select * from t1;
a
1
2
handler t1 open;
-# --> connection con1
+connection con1;
# Sending:
lock tables t1 write;
-# --> connection con2
+connection con2;
# Check that 'lock tables t1 write' waits until transaction which
# has read from the table commits.
-# --> connection default
+connection default;
# The below 'handler t1 read ...' should not be blocked as
# 'lock tables t1 write' has not succeeded yet.
handler t1 read a next;
@@ -1331,24 +1337,28 @@ a
1
# Unblock 'lock tables t1 write'.
commit;
-# --> connection con1
+connection con1;
# Reap 'lock tables t1 write'.
-# --> connection default
+connection default;
# Sending:
handler t1 read a next;
-# --> connection con1
+connection con1;
# Waiting for 'handler t1 read a next' to get blocked...
# The below 'drop table t1' should be able to proceed without
# waiting as it will force HANDLER to be closed.
drop table t1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'handler t1 read a next'...
ERROR 42S02: Table 'test.t1' doesn't exist
handler t1 close;
-# --> connection con1
-# --> connection con2
-# --> connection con3
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
#
# A temporary table test.
# Check that we don't loose positions of HANDLER opened
@@ -1475,8 +1485,8 @@ drop table t2, t3;
# Check that when we clone a ticket for HANDLER we downrade
# the lock.
#
-# Establish an auxiliary connection con1.
-# -> connection default
+connect con1,localhost,root,,;
+connection default;
create table t1 (a int, b int, key using btree (a));
insert into t1 (a, b) values (1, 1), (2, 1), (3, 2), (4, 2), (5, 5);
begin;
@@ -1490,19 +1500,20 @@ handler t1 read a last;
a b
7 7
commit;
-# -> connection con1
+connection con1;
# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE.
lock table t1 write;
unlock tables;
-# -> connection default
+connection default;
handler t1 read a prev;
a b
6 6
handler t1 close;
# Cleanup.
drop table t1;
-# -> connection con1
-# -> connection default
+connection con1;
+disconnect con1;
+connection default;
#
# A test for Bug#50555 "handler commands crash server in
# my_hash_first()".
@@ -1631,26 +1642,28 @@ drop tables t1, t2;
# bool MDL_context::try_acquire_lock(MDL_request*)
#
DROP TABLE IF EXISTS t1;
-# Connection default
+connect con51355, localhost, root;
+connection default;
CREATE TABLE t1(id INT, KEY id(id));
HANDLER t1 OPEN;
-# Connection con51355
+connection con51355;
# Sending:
DROP TABLE t1;
-# Connection default
+connection default;
# This I_S query will cause the handler table to be closed and
# the metadata lock to be released. This will allow DROP TABLE
# to proceed. Waiting for the table to be removed.
-# Connection con51355
+connection con51355;
# Reaping: DROP TABLE t1
-# Connection default
+connection default;
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 CLOSE;
-# Connection con51355
-# Connection default
+connection con51355;
+disconnect con51355;
+connection default;
#
# Bug#54401 assert in Diagnostics_area::set_eof_status , HANDLER
#
diff --git a/mysql-test/suite/handler/disconnect_4480.result b/mysql-test/suite/handler/disconnect_4480.result
index d0a67c72c05..3e21a9ac1a7 100644
--- a/mysql-test/suite/handler/disconnect_4480.result
+++ b/mysql-test/suite/handler/disconnect_4480.result
@@ -1,5 +1,7 @@
+connect con1,localhost,root,,;
create temporary table t1 as select 1;
handler t1 open;
handler t1 read next;
1
1
+disconnect con1;
diff --git a/mysql-test/suite/handler/handler.inc b/mysql-test/suite/handler/handler.inc
index c71dc53e5ac..b1e881f1bd8 100644
--- a/mysql-test/suite/handler/handler.inc
+++ b/mysql-test/suite/handler/handler.inc
@@ -365,26 +365,18 @@ drop table t5;
#
create table t1 (c1 int);
insert into t1 values (1);
-# client 1
handler t1 open;
handler t1 read first;
-# client 2
connect (con2,localhost,root,,);
connection con2;
--echo send the below to another connection, do not wait for the result
send optimize table t1;
--sleep 1
-# client 1
---echo proceed with the normal connection
connection default;
handler t1 read next;
handler t1 close;
-# client 2
---echo read the result from the other connection
connection con2;
reap;
-# client 1
---echo proceed with the normal connection
connection default;
drop table t1;
@@ -411,34 +403,27 @@ flush tables with read lock;
--error 1223
drop table t1;
#
-# client 2
# We need a second connection to try the drop.
# The drop waits for the global read lock to go away.
# Without the addendum fix it locked LOCK_open before entering the wait loop.
connection con2;
---echo send the below to another connection, do not wait for the result
send drop table t1;
--sleep 1
#
-# client 1
# Now we need something that wants LOCK_open. A simple table access which
# opens the table does the trick.
---echo proceed with the normal connection
connection default;
# This would hang on LOCK_open without the 5.0 addendum fix.
select * from t1;
# Release the read lock. This should make the DROP go through.
unlock tables;
#
-# client 2
# Read the result of the drop command.
connection con2;
--echo read the result from the other connection
reap;
#
-# client 1
# Now back to normal operation. The table should not exist any more.
---echo proceed with the normal connection
connection default;
--error 1146
select * from t1;
@@ -449,11 +434,9 @@ drop table if exists t1;
# Bug#25856 - HANDLER table OPEN in one connection lock DROP TABLE in another one
#
create table t1 (a int not null) ENGINE=csv;
---echo --> client 2
connection con2;
--error 1031
handler t1 open;
---echo --> client 1
connection default;
drop table t1;
disconnect con2;
@@ -777,33 +760,27 @@ handler t1 close;
--echo # Explore the effect of HANDLER locks on concurrent DDL
--echo #
handler t1 open;
---echo # Establishing auxiliary connections con1, con2, con3
connect(con1, localhost, root,,);
connect(con2, localhost, root,,);
connect(con3, localhost, root,,);
---echo # --> connection con1;
connection con1;
--echo # Sending:
--send drop table t1
--echo # We can't use connection 'default' as wait_condition will
--echo # autoclose handlers.
---echo # --> connection con2
connection con2;
--echo # Waitng for 'drop table t1' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for table metadata lock' and
info='drop table t1';
--source include/wait_condition.inc
---echo # --> connection default
connection default;
handler t1 read a prev;
handler t1 read a prev;
handler t1 close;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop table t1'...
--reap
---echo # --> connection default
connection default;
--echo #
--echo # Explore the effect of HANDLER locks in parallel with SELECT
@@ -816,18 +793,15 @@ handler t1 open;
handler t1 read a prev;
handler t1 read a prev;
handler t1 close;
---echo # --> connection con1;
connection con1;
--echo # Sending:
--send drop table t1
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop table t1' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for table metadata lock' and
info='drop table t1';
--source include/wait_condition.inc
---echo # --> connection default
connection default;
--echo # We can still use the table, it's part of the transaction
select * from t1;
@@ -841,12 +815,10 @@ handler t1 read a prev;
handler t1 read a prev;
handler t1 read a prev;
handler t1 close;
---echo # --> connection con1
connection con1;
--echo # Now drop can proceed
--echo # Reaping 'drop table t1'...
--reap
---echo # --> connection default
connection default;
--echo #
--echo # Demonstrate that HANDLER locks and transaction locks
@@ -858,18 +830,15 @@ create table t0 (a int, key a using btree (a));
insert into t0 (a) values (1), (2), (3), (4), (5);
begin;
select * from t1;
---echo # --> connection con2
connection con2;
--echo # Sending:
send rename table t0 to t3, t1 to t0, t3 to t1;
---echo # --> connection con1
connection con1;
--echo # Waiting for 'rename table ...' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for table metadata lock' and
info='rename table t0 to t3, t1 to t0, t3 to t1';
--source include/wait_condition.inc
---echo # --> connection default
connection default;
--echo # We back-off on hitting deadlock condition.
--error ER_LOCK_DEADLOCK
@@ -878,11 +847,9 @@ select * from t0;
handler t1 open;
commit;
handler t1 close;
---echo # --> connection con2
connection con2;
--echo # Reaping 'rename table ...'...
--reap
---echo # --> connection default
connection default;
handler t1 open;
handler t1 read a prev;
@@ -897,36 +864,29 @@ drop table t0;
--echo #
create table t2 (a int, key a (a));
handler t1 open;
---echo # --> connection con1
connection con1;
lock tables t2 read;
---echo # --> connection con2
connection con2;
--echo # Sending 'drop table t2'...
--send drop table t2
---echo # --> connection con1
connection con1;
--echo # Waiting for 'drop table t2' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for table metadata lock' and
info='drop table t2';
--source include/wait_condition.inc
---echo # --> connection default
connection default;
--echo # Sending 'select * from t2'
send select * from t2;
---echo # --> connection con1
connection con1;
--echo # Waiting for 'select * from t2' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for table metadata lock' and
info='select * from t2';
unlock tables;
---echo # --> connection con2
connection con2;
--echo # Reaping 'drop table t2'...
--reap
---echo # --> connection default
connection default;
--echo # Reaping 'select * from t2'
--error ER_NO_SUCH_TABLE
@@ -947,21 +907,17 @@ handler t1 open;
handler t1 read a first;
handler t1 read a next;
select * from t2;
---echo # --> connection con1
connection con1;
--echo # Sending:
--send drop table t1
---echo # --> connection con2
connection con2;
--echo # Sending:
--send drop table t2
---echo # --> connection default
connection default;
--echo # Let DROP TABLE statements sync in. We must use
--echo # a separate connection for that, because otherwise SELECT
--echo # will auto-close the HANDLERs, becaues there are pending
--echo # exclusive locks against them.
---echo # --> connection con3
connection con3;
--echo # Waiting for 'drop table t1' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -975,27 +931,22 @@ let $wait_condition=select count(*)=1 from information_schema.processlist
--source include/wait_condition.inc
--echo # Demonstrate that t2 lock was released and t2 was dropped
--echo # after ROLLBACK TO SAVEPOINT
---echo # --> connection default
connection default;
rollback to savepoint sv;
---echo # --> connection con2
connection con2;
--echo # Reaping 'drop table t2'...
--reap
--echo # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
--echo # lock.
---echo # --> connection default
connection default;
handler t1 read a next;
handler t1 read a next;
--echo # Demonstrate that the drop will go through as soon as we close the
--echo # HANDLER
handler t1 close;
---echo # connection con1
connection con1;
--echo # Reaping 'drop table t1'...
--reap
---echo # --> connection default
connection default;
commit;
drop table t3;
@@ -1016,21 +967,17 @@ handler t1 open;
handler t1 read a first;
handler t1 read a next;
select * from t2;
---echo # --> connection con1
connection con1;
--echo # Sending:
--send drop table t1
---echo # --> connection con2
connection con2;
--echo # Sending:
--send drop table t2
---echo # --> connection default
connection default;
--echo # Let DROP TABLE statements sync in. We must use
--echo # a separate connection for that, because otherwise SELECT
--echo # will auto-close the HANDLERs, becaues there are pending
--echo # exclusive locks against them.
---echo # --> connection con3
connection con3;
--echo # Waiting for 'drop table t1' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -1044,27 +991,22 @@ let $wait_condition=select count(*)=1 from information_schema.processlist
--source include/wait_condition.inc
--echo # Demonstrate that t2 lock was released and t2 was dropped
--echo # after ROLLBACK TO SAVEPOINT
---echo # --> connection default
connection default;
rollback to savepoint sv;
---echo # --> connection con2
connection con2;
--echo # Reaping 'drop table t2'...
--reap
--echo # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
--echo # lock.
---echo # --> connection default
connection default;
handler t1 read a next;
handler t1 read a next;
--echo # Demonstrate that the drop will go through as soon as we close the
--echo # HANDLER
handler t1 close;
---echo # connection con1
connection con1;
--echo # Reaping 'drop table t1'...
--reap
---echo # --> connection default
connection default;
commit;
--echo #
@@ -1087,13 +1029,11 @@ handler t1 close;
handler t3 open;
handler t3 read a first;
rollback to savepoint sv;
---echo # --> connection con1
connection con1;
drop table t1, t2;
--echo # Sending:
--send drop table t3
--echo # Let DROP TABLE statement sync in.
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop table t3' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -1102,17 +1042,14 @@ let $wait_condition=select count(*)=1 from information_schema.processlist
--source include/wait_condition.inc
--echo # Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
--echo # lock.
---echo # --> connection default
connection default;
handler t3 read a next;
--echo # Demonstrate that the drop will go through as soon as we close the
--echo # HANDLER
handler t3 close;
---echo # connection con1
connection con1;
--echo # Reaping 'drop table t3'...
--reap
---echo # --> connection default
connection default;
commit;
@@ -1123,25 +1060,20 @@ commit;
create table t1 (a int, key a(a));
create table t2 like t1;
handler t1 open;
---echo # --> connection con1
connection con1;
lock table t1 write, t2 write;
---echo # --> connection default
connection default;
send drop table t2;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop table t2' to get blocked...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for table metadata lock' and
info='drop table t2';
--source include/wait_condition.inc
---echo # --> connection con1
connection con1;
--error ER_LOCK_DEADLOCK
drop table t1;
unlock tables;
---echo # --> connection default
connection default;
reap;
@@ -1150,13 +1082,10 @@ reap;
create table t2 like t1;
--echo # Sending:
--send flush table t2
---echo # --> connection con2
connection con2;
drop table t1;
---echo # --> connection con1
connection con1;
unlock tables;
---echo # --> connection default
connection default;
--echo # Reaping 'flush table t2'...
--reap
@@ -1169,18 +1098,15 @@ drop table t2;
create table t1 (a int, key using btree (a));
insert into t1 values (1), (2);
---echo # --> connection default
connection default;
begin;
select * from t1;
handler t1 open;
---echo # --> connection con1
connection con1;
--echo # Sending:
--send lock tables t1 write
---echo # --> connection con2
connection con2;
--echo # Check that 'lock tables t1 write' waits until transaction which
--echo # has read from the table commits.
@@ -1190,7 +1116,6 @@ let $wait_condition=
info = "lock tables t1 write";
--source include/wait_condition.inc
---echo # --> connection default
connection default;
--echo # The below 'handler t1 read ...' should not be blocked as
--echo # 'lock tables t1 write' has not succeeded yet.
@@ -1199,17 +1124,14 @@ handler t1 read a next;
--echo # Unblock 'lock tables t1 write'.
commit;
---echo # --> connection con1
connection con1;
--echo # Reap 'lock tables t1 write'.
--reap
---echo # --> connection default
connection default;
--echo # Sending:
--send handler t1 read a next
---echo # --> connection con1
connection con1;
--echo # Waiting for 'handler t1 read a next' to get blocked...
let $wait_condition=
@@ -1223,22 +1145,18 @@ let $wait_condition=
drop table t1;
unlock tables;
---echo # --> connection default
connection default;
--echo # Reaping 'handler t1 read a next'...
--error ER_NO_SUCH_TABLE
--reap
handler t1 close;
---echo # --> connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # --> connection con2
connection con2;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # --> connection con3
connection con3;
disconnect con3;
--source include/wait_until_disconnected.inc
@@ -1335,9 +1253,7 @@ drop table t2, t3;
--echo # Check that when we clone a ticket for HANDLER we downrade
--echo # the lock.
--echo #
---echo # Establish an auxiliary connection con1.
connect (con1,localhost,root,,);
---echo # -> connection default
connection default;
create table t1 (a int, b int, key using btree (a));
insert into t1 (a, b) values (1, 1), (2, 1), (3, 2), (4, 2), (5, 5);
@@ -1348,22 +1264,18 @@ handler t1 read a last;
insert into t1 (a, b) values (7, 7);
handler t1 read a last;
commit;
---echo # -> connection con1
connection con1;
--echo # Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE.
lock table t1 write;
unlock tables;
---echo # -> connection default
connection default;
handler t1 read a prev;
handler t1 close;
--echo # Cleanup.
drop table t1;
---echo # -> connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # -> connection default
connection default;
--echo #
@@ -1503,17 +1415,14 @@ DROP TABLE IF EXISTS t1;
connect(con51355, localhost, root);
---echo # Connection default
connection default;
CREATE TABLE t1(id INT, KEY id(id));
HANDLER t1 OPEN;
---echo # Connection con51355
connection con51355;
--echo # Sending:
--send DROP TABLE t1
---echo # Connection default
connection default;
--echo # This I_S query will cause the handler table to be closed and
--echo # the metadata lock to be released. This will allow DROP TABLE
@@ -1522,12 +1431,10 @@ let $wait_condition=
SELECT COUNT(*) = 0 FROM information_schema.tables WHERE table_name = "t1";
--source include/wait_condition.inc
---echo # Connection con51355
connection con51355;
--echo # Reaping: DROP TABLE t1
--reap
---echo # Connection default
connection default;
--error ER_NO_SUCH_TABLE
HANDLER t1 READ id NEXT;
@@ -1536,11 +1443,9 @@ HANDLER t1 READ id NEXT;
HANDLER t1 READ id NEXT;
HANDLER t1 CLOSE;
---echo # Connection con51355
connection con51355;
disconnect con51355;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
diff --git a/mysql-test/suite/handler/heap.result b/mysql-test/suite/handler/heap.result
index 527986edb5c..e558911e2e1 100644
--- a/mysql-test/suite/handler/heap.result
+++ b/mysql-test/suite/handler/heap.result
@@ -538,17 +538,19 @@ handler t1 open;
handler t1 read first;
c1
1
+connect con2,localhost,root,,;
+connection con2;
send the below to another connection, do not wait for the result
optimize table t1;
-proceed with the normal connection
+connection default;
handler t1 read next;
c1
1
handler t1 close;
-read the result from the other connection
+connection con2;
Table Op Msg_type Msg_text
test.t1 optimize note The storage engine for the table doesn't support optimize
-proceed with the normal connection
+connection default;
drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY using btree (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
@@ -569,26 +571,28 @@ insert into t1 values (14397);
flush tables with read lock;
drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
-send the below to another connection, do not wait for the result
+connection con2;
drop table t1;
-proceed with the normal connection
+connection default;
select * from t1;
c1
14397
unlock tables;
+connection con2;
read the result from the other connection
-proceed with the normal connection
+connection default;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
create table t1 (a int not null) ENGINE=csv;
---> client 2
+connection con2;
handler t1 open;
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
---> client 1
+connection default;
drop table t1;
+disconnect con2;
create table t1 (a int);
handler t1 open as t1_alias;
handler t1_alias read a next;
@@ -968,15 +972,17 @@ handler t1 close;
# Explore the effect of HANDLER locks on concurrent DDL
#
handler t1 open;
-# Establishing auxiliary connections con1, con2, con3
-# --> connection con1;
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connect con3, localhost, root,,;
+connection con1;
# Sending:
drop table t1 ;
# We can't use connection 'default' as wait_condition will
# autoclose handlers.
-# --> connection con2
+connection con2;
# Waitng for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
handler t1 read a prev;
a b
5 NULL
@@ -984,9 +990,9 @@ handler t1 read a prev;
a b
4 NULL
handler t1 close;
-# --> connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Explore the effect of HANDLER locks in parallel with SELECT
#
@@ -1008,12 +1014,12 @@ handler t1 read a prev;
a
4
handler t1 close;
-# --> connection con1;
+connection con1;
# Sending:
drop table t1 ;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
# We can still use the table, it's part of the transaction
select * from t1;
a
@@ -1038,10 +1044,10 @@ handler t1 read a prev;
a
3
handler t1 close;
-# --> connection con1
+connection con1;
# Now drop can proceed
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Demonstrate that HANDLER locks and transaction locks
# reside in the same context.
@@ -1058,12 +1064,12 @@ a
3
4
5
-# --> connection con2
+connection con2;
# Sending:
rename table t0 to t3, t1 to t0, t3 to t1;
-# --> connection con1
+connection con1;
# Waiting for 'rename table ...' to get blocked...
-# --> connection default
+connection default;
# We back-off on hitting deadlock condition.
handler t0 open;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
@@ -1077,9 +1083,9 @@ a
handler t1 open;
commit;
handler t1 close;
-# --> connection con2
+connection con2;
# Reaping 'rename table ...'...
-# --> connection default
+connection default;
handler t1 open;
handler t1 read a prev;
a
@@ -1095,22 +1101,22 @@ drop table t0;
#
create table t2 (a int, key a (a));
handler t1 open;
-# --> connection con1
+connection con1;
lock tables t2 read;
-# --> connection con2
+connection con2;
# Sending 'drop table t2'...
drop table t2;
-# --> connection con1
+connection con1;
# Waiting for 'drop table t2' to get blocked...
-# --> connection default
+connection default;
# Sending 'select * from t2'
select * from t2;
-# --> connection con1
+connection con1;
# Waiting for 'select * from t2' to get blocked...
unlock tables;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
-# --> connection default
+connection default;
# Reaping 'select * from t2'
ERROR 42S02: Table 'test.t2' doesn't exist
handler t1 close;
@@ -1134,29 +1140,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1166,9 +1172,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
drop table t3;
#
@@ -1193,29 +1199,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1225,9 +1231,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
#
# Show that rollback to the savepoint taken in the beginning
@@ -1254,25 +1260,25 @@ handler t3 read a first;
a
1
rollback to savepoint sv;
-# --> connection con1
+connection con1;
drop table t1, t2;
# Sending:
drop table t3;
# Let DROP TABLE statement sync in.
-# --> connection con2
+connection con2;
# Waiting for 'drop table t3' to get blocked...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t3 read a next;
a
2
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t3 close;
-# connection con1
+connection con1;
# Reaping 'drop table t3'...
-# --> connection default
+connection default;
commit;
#
# If we have to wait on an exclusive locks while having
@@ -1281,27 +1287,27 @@ commit;
create table t1 (a int, key a(a));
create table t2 like t1;
handler t1 open;
-# --> connection con1
+connection con1;
lock table t1 write, t2 write;
-# --> connection default
+connection default;
drop table t2;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t2' to get blocked...
-# --> connection con1
+connection con1;
drop table t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
unlock tables;
-# --> connection default
+connection default;
# Demonstrate that there is no deadlock with FLUSH TABLE,
# even though it is waiting for the other table to go away
create table t2 like t1;
# Sending:
flush table t2;
-# --> connection con2
+connection con2;
drop table t1;
-# --> connection con1
+connection con1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'flush table t2'...
drop table t2;
#
@@ -1310,20 +1316,20 @@ drop table t2;
#
create table t1 (a int, key using btree (a));
insert into t1 values (1), (2);
-# --> connection default
+connection default;
begin;
select * from t1;
a
1
2
handler t1 open;
-# --> connection con1
+connection con1;
# Sending:
lock tables t1 write;
-# --> connection con2
+connection con2;
# Check that 'lock tables t1 write' waits until transaction which
# has read from the table commits.
-# --> connection default
+connection default;
# The below 'handler t1 read ...' should not be blocked as
# 'lock tables t1 write' has not succeeded yet.
handler t1 read a next;
@@ -1331,24 +1337,28 @@ a
1
# Unblock 'lock tables t1 write'.
commit;
-# --> connection con1
+connection con1;
# Reap 'lock tables t1 write'.
-# --> connection default
+connection default;
# Sending:
handler t1 read a next;
-# --> connection con1
+connection con1;
# Waiting for 'handler t1 read a next' to get blocked...
# The below 'drop table t1' should be able to proceed without
# waiting as it will force HANDLER to be closed.
drop table t1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'handler t1 read a next'...
ERROR 42S02: Table 'test.t1' doesn't exist
handler t1 close;
-# --> connection con1
-# --> connection con2
-# --> connection con3
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
#
# A temporary table test.
# Check that we don't loose positions of HANDLER opened
@@ -1475,8 +1485,8 @@ drop table t2, t3;
# Check that when we clone a ticket for HANDLER we downrade
# the lock.
#
-# Establish an auxiliary connection con1.
-# -> connection default
+connect con1,localhost,root,,;
+connection default;
create table t1 (a int, b int, key using btree (a));
insert into t1 (a, b) values (1, 1), (2, 1), (3, 2), (4, 2), (5, 5);
begin;
@@ -1490,19 +1500,20 @@ handler t1 read a last;
a b
7 7
commit;
-# -> connection con1
+connection con1;
# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE.
lock table t1 write;
unlock tables;
-# -> connection default
+connection default;
handler t1 read a prev;
a b
6 6
handler t1 close;
# Cleanup.
drop table t1;
-# -> connection con1
-# -> connection default
+connection con1;
+disconnect con1;
+connection default;
#
# A test for Bug#50555 "handler commands crash server in
# my_hash_first()".
@@ -1631,26 +1642,28 @@ drop tables t1, t2;
# bool MDL_context::try_acquire_lock(MDL_request*)
#
DROP TABLE IF EXISTS t1;
-# Connection default
+connect con51355, localhost, root;
+connection default;
CREATE TABLE t1(id INT, KEY id(id));
HANDLER t1 OPEN;
-# Connection con51355
+connection con51355;
# Sending:
DROP TABLE t1;
-# Connection default
+connection default;
# This I_S query will cause the handler table to be closed and
# the metadata lock to be released. This will allow DROP TABLE
# to proceed. Waiting for the table to be removed.
-# Connection con51355
+connection con51355;
# Reaping: DROP TABLE t1
-# Connection default
+connection default;
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 CLOSE;
-# Connection con51355
-# Connection default
+connection con51355;
+disconnect con51355;
+connection default;
#
# Bug#54401 assert in Diagnostics_area::set_eof_status , HANDLER
#
@@ -1697,6 +1710,8 @@ INSERT INTO t1 VALUES(1);
HANDLER t1 READ a NEXT;
HANDLER t1 CLOSE;
DROP TABLE t1;
+connect con1,localhost,root,,;
+connection default;
CREATE TABLE t1(a INT, b INT, KEY(a), KEY b using btree (b), KEY ab using btree(a, b)) engine=memory;
INSERT INTO t1 VALUES (2, 20), (2,20), (1, 10), (4, 40), (3, 30), (5,50), (6,50);
HANDLER t1 OPEN;
@@ -1762,26 +1777,35 @@ ERROR HY000: Record has changed since last read in table 't1'
HANDLER t1 READ b FIRST;
a b
1 10
+connection con1;
insert into t1 values (7,50);
+connection default;
HANDLER t1 READ b NEXT;
ERROR HY000: Record has changed since last read in table 't1'
HANDLER t1 READ FIRST;
a b
2 20
+connection con1;
insert into t1 values (8,50);
+connection default;
HANDLER t1 READ NEXT;
a b
2 20
+connection con1;
delete from t1 where a=3;
+connection default;
HANDLER t1 READ NEXT LIMIT 2;
a b
1 10
4 40
+connection con1;
delete from t1;
+connection default;
HANDLER t1 READ NEXT LIMIT 2;
ERROR HY000: Record has changed since last read in table 't1'
HANDLER t1 CLOSE;
DROP TABLE t1;
+disconnect con1;
create table t1 (f1 integer not null, key (f1)) engine=Memory;
insert into t1 values (1);
HANDLER t1 OPEN;
diff --git a/mysql-test/suite/handler/innodb.result b/mysql-test/suite/handler/innodb.result
index 78660b0ef9c..fc1089ee445 100644
--- a/mysql-test/suite/handler/innodb.result
+++ b/mysql-test/suite/handler/innodb.result
@@ -538,18 +538,20 @@ handler t1 open;
handler t1 read first;
c1
1
+connect con2,localhost,root,,;
+connection con2;
send the below to another connection, do not wait for the result
optimize table t1;
-proceed with the normal connection
+connection default;
handler t1 read next;
c1
1
handler t1 close;
-read the result from the other connection
+connection con2;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
-proceed with the normal connection
+connection default;
drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY using btree (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
@@ -570,26 +572,28 @@ insert into t1 values (14397);
flush tables with read lock;
drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
-send the below to another connection, do not wait for the result
+connection con2;
drop table t1;
-proceed with the normal connection
+connection default;
select * from t1;
c1
14397
unlock tables;
+connection con2;
read the result from the other connection
-proceed with the normal connection
+connection default;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
create table t1 (a int not null) ENGINE=csv;
---> client 2
+connection con2;
handler t1 open;
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
---> client 1
+connection default;
drop table t1;
+disconnect con2;
create table t1 (a int);
handler t1 open as t1_alias;
handler t1_alias read a next;
@@ -972,15 +976,17 @@ handler t1 close;
# Explore the effect of HANDLER locks on concurrent DDL
#
handler t1 open;
-# Establishing auxiliary connections con1, con2, con3
-# --> connection con1;
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connect con3, localhost, root,,;
+connection con1;
# Sending:
drop table t1 ;
# We can't use connection 'default' as wait_condition will
# autoclose handlers.
-# --> connection con2
+connection con2;
# Waitng for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
handler t1 read a prev;
a b
5 NULL
@@ -988,9 +994,9 @@ handler t1 read a prev;
a b
4 NULL
handler t1 close;
-# --> connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Explore the effect of HANDLER locks in parallel with SELECT
#
@@ -1012,12 +1018,12 @@ handler t1 read a prev;
a
4
handler t1 close;
-# --> connection con1;
+connection con1;
# Sending:
drop table t1 ;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
# We can still use the table, it's part of the transaction
select * from t1;
a
@@ -1042,10 +1048,10 @@ handler t1 read a prev;
a
3
handler t1 close;
-# --> connection con1
+connection con1;
# Now drop can proceed
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Demonstrate that HANDLER locks and transaction locks
# reside in the same context.
@@ -1062,12 +1068,12 @@ a
3
4
5
-# --> connection con2
+connection con2;
# Sending:
rename table t0 to t3, t1 to t0, t3 to t1;
-# --> connection con1
+connection con1;
# Waiting for 'rename table ...' to get blocked...
-# --> connection default
+connection default;
# We back-off on hitting deadlock condition.
handler t0 open;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
@@ -1081,9 +1087,9 @@ a
handler t1 open;
commit;
handler t1 close;
-# --> connection con2
+connection con2;
# Reaping 'rename table ...'...
-# --> connection default
+connection default;
handler t1 open;
handler t1 read a prev;
a
@@ -1099,22 +1105,22 @@ drop table t0;
#
create table t2 (a int, key a (a));
handler t1 open;
-# --> connection con1
+connection con1;
lock tables t2 read;
-# --> connection con2
+connection con2;
# Sending 'drop table t2'...
drop table t2;
-# --> connection con1
+connection con1;
# Waiting for 'drop table t2' to get blocked...
-# --> connection default
+connection default;
# Sending 'select * from t2'
select * from t2;
-# --> connection con1
+connection con1;
# Waiting for 'select * from t2' to get blocked...
unlock tables;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
-# --> connection default
+connection default;
# Reaping 'select * from t2'
ERROR 42S02: Table 'test.t2' doesn't exist
handler t1 close;
@@ -1138,29 +1144,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1170,9 +1176,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
drop table t3;
#
@@ -1197,29 +1203,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1229,9 +1235,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
#
# Show that rollback to the savepoint taken in the beginning
@@ -1258,25 +1264,25 @@ handler t3 read a first;
a
1
rollback to savepoint sv;
-# --> connection con1
+connection con1;
drop table t1, t2;
# Sending:
drop table t3;
# Let DROP TABLE statement sync in.
-# --> connection con2
+connection con2;
# Waiting for 'drop table t3' to get blocked...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t3 read a next;
a
2
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t3 close;
-# connection con1
+connection con1;
# Reaping 'drop table t3'...
-# --> connection default
+connection default;
commit;
#
# If we have to wait on an exclusive locks while having
@@ -1285,27 +1291,27 @@ commit;
create table t1 (a int, key a(a));
create table t2 like t1;
handler t1 open;
-# --> connection con1
+connection con1;
lock table t1 write, t2 write;
-# --> connection default
+connection default;
drop table t2;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t2' to get blocked...
-# --> connection con1
+connection con1;
drop table t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
unlock tables;
-# --> connection default
+connection default;
# Demonstrate that there is no deadlock with FLUSH TABLE,
# even though it is waiting for the other table to go away
create table t2 like t1;
# Sending:
flush table t2;
-# --> connection con2
+connection con2;
drop table t1;
-# --> connection con1
+connection con1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'flush table t2'...
drop table t2;
#
@@ -1314,20 +1320,20 @@ drop table t2;
#
create table t1 (a int, key using btree (a));
insert into t1 values (1), (2);
-# --> connection default
+connection default;
begin;
select * from t1;
a
1
2
handler t1 open;
-# --> connection con1
+connection con1;
# Sending:
lock tables t1 write;
-# --> connection con2
+connection con2;
# Check that 'lock tables t1 write' waits until transaction which
# has read from the table commits.
-# --> connection default
+connection default;
# The below 'handler t1 read ...' should not be blocked as
# 'lock tables t1 write' has not succeeded yet.
handler t1 read a next;
@@ -1335,24 +1341,28 @@ a
1
# Unblock 'lock tables t1 write'.
commit;
-# --> connection con1
+connection con1;
# Reap 'lock tables t1 write'.
-# --> connection default
+connection default;
# Sending:
handler t1 read a next;
-# --> connection con1
+connection con1;
# Waiting for 'handler t1 read a next' to get blocked...
# The below 'drop table t1' should be able to proceed without
# waiting as it will force HANDLER to be closed.
drop table t1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'handler t1 read a next'...
ERROR 42S02: Table 'test.t1' doesn't exist
handler t1 close;
-# --> connection con1
-# --> connection con2
-# --> connection con3
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
#
# A temporary table test.
# Check that we don't loose positions of HANDLER opened
@@ -1479,8 +1489,8 @@ drop table t2, t3;
# Check that when we clone a ticket for HANDLER we downrade
# the lock.
#
-# Establish an auxiliary connection con1.
-# -> connection default
+connect con1,localhost,root,,;
+connection default;
create table t1 (a int, b int, key using btree (a));
insert into t1 (a, b) values (1, 1), (2, 1), (3, 2), (4, 2), (5, 5);
begin;
@@ -1494,19 +1504,20 @@ handler t1 read a last;
a b
7 7
commit;
-# -> connection con1
+connection con1;
# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE.
lock table t1 write;
unlock tables;
-# -> connection default
+connection default;
handler t1 read a prev;
a b
6 6
handler t1 close;
# Cleanup.
drop table t1;
-# -> connection con1
-# -> connection default
+connection con1;
+disconnect con1;
+connection default;
#
# A test for Bug#50555 "handler commands crash server in
# my_hash_first()".
@@ -1635,26 +1646,28 @@ drop tables t1, t2;
# bool MDL_context::try_acquire_lock(MDL_request*)
#
DROP TABLE IF EXISTS t1;
-# Connection default
+connect con51355, localhost, root;
+connection default;
CREATE TABLE t1(id INT, KEY id(id));
HANDLER t1 OPEN;
-# Connection con51355
+connection con51355;
# Sending:
DROP TABLE t1;
-# Connection default
+connection default;
# This I_S query will cause the handler table to be closed and
# the metadata lock to be released. This will allow DROP TABLE
# to proceed. Waiting for the table to be removed.
-# Connection con51355
+connection con51355;
# Reaping: DROP TABLE t1
-# Connection default
+connection default;
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 CLOSE;
-# Connection con51355
-# Connection default
+connection con51355;
+disconnect con51355;
+connection default;
#
# Bug#54401 assert in Diagnostics_area::set_eof_status , HANDLER
#
diff --git a/mysql-test/suite/handler/interface.result b/mysql-test/suite/handler/interface.result
index 89dec29f412..4d5a385df0f 100644
--- a/mysql-test/suite/handler/interface.result
+++ b/mysql-test/suite/handler/interface.result
@@ -168,15 +168,16 @@ create table t1 (c1 int);
create table t2 (c1 int);
insert into t1 values (1);
insert into t2 values (2);
-connection: default
handler t1 open;
handler t1 read first;
c1
1
-connection: flush
+connect flush,localhost,root,,;
+connection flush;
flush tables;
-connection: waiter
-connection: default
+connect waiter,localhost,root,,;
+connection waiter;
+connection default;
handler t2 open;
handler t2 read first;
c1
@@ -186,17 +187,20 @@ c1
1
handler t1 close;
handler t2 close;
+connection flush;
+connection default;
drop table t1,t2;
+disconnect flush;
drop table if exists t1, t0;
create table t1 (c1 int);
-connection: default
handler t1 open;
handler t1 read first;
c1
-connection: flush
+connect flush,localhost,root,,;
+connection flush;
rename table t1 to t0;
-connection: waiter
-connection: default
+connection waiter;
+connection default;
#
# RENAME placed two pending locks and waits.
# When HANDLER t0 OPEN does open_tables(), it calls
@@ -211,12 +215,18 @@ connection: default
#
handler t0 open;
handler t0 close;
-connection: flush
+connection flush;
handler t1 read next;
ERROR 42S02: Unknown table 't1' in HANDLER
handler t1 close;
ERROR 42S02: Unknown table 't1' in HANDLER
+connection default;
drop table t0;
+connection flush;
+disconnect flush;
+connection waiter;
+disconnect waiter;
+connection default;
create table t1 (a int);
handler t1 open as t1_alias;
drop table t1;
@@ -260,25 +270,36 @@ unlock tables;
drop table t1;
handler t1 read a next;
ERROR 42S02: Unknown table 't1' in HANDLER
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection default;
drop table if exists t1;
# First test case which is supposed trigger the execution
# path on which problem was discovered.
create table t1 (a int not null);
insert into t1 values (1);
handler t1 open;
+connection con1;
lock table t1 write;
alter table t1 engine=csv;
+connection con2;
+connection default;
handler t1 read a next;
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
handler t1 close;
+connection con1;
unlock tables;
drop table t1;
# Now test case which was reported originally but which no longer
# triggers execution path which has caused the problem.
+connection default;
create table t1 (a int not null);
insert into t1 values (1);
handler t1 open;
+connection con1;
alter table t1 engine=csv;
+connection con2;
+connection default;
# Since S metadata lock was already acquired at HANDLER OPEN time
# and TL_READ lock requested by HANDLER READ is compatible with
# ALTER's TL_WRITE_ALLOW_READ the below statement should succeed
@@ -287,7 +308,12 @@ handler t1 read next;
a
1
handler t1 close;
+connection con1;
drop table t1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
USE information_schema;
HANDLER COLUMNS OPEN;
ERROR HY000: Incorrect usage of HANDLER OPEN and information_schema
diff --git a/mysql-test/suite/handler/interface.test b/mysql-test/suite/handler/interface.test
index 2ef617c3ce7..a82412799eb 100644
--- a/mysql-test/suite/handler/interface.test
+++ b/mysql-test/suite/handler/interface.test
@@ -175,22 +175,18 @@ create table t1 (c1 int);
create table t2 (c1 int);
insert into t1 values (1);
insert into t2 values (2);
---echo connection: default
handler t1 open;
handler t1 read first;
connect (flush,localhost,root,,);
connection flush;
---echo connection: flush
send flush tables;
connect (waiter,localhost,root,,);
connection waiter;
---echo connection: waiter
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table flush";
--source include/wait_condition.inc
connection default;
---echo connection: default
handler t2 open;
handler t2 read first;
handler t1 read next;
@@ -210,22 +206,18 @@ disconnect flush;
drop table if exists t1, t0;
--enable_warnings
create table t1 (c1 int);
---echo connection: default
handler t1 open;
handler t1 read first;
connect (flush,localhost,root,,);
connection flush;
---echo connection: flush
send rename table t1 to t0;
connection waiter;
---echo connection: waiter
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for table metadata lock" and
info = "rename table t1 to t0";
--source include/wait_condition.inc
connection default;
---echo connection: default
--echo #
--echo # RENAME placed two pending locks and waits.
--echo # When HANDLER t0 OPEN does open_tables(), it calls
@@ -242,7 +234,6 @@ connection default;
handler t0 open;
--error 0, ER_UNKNOWN_TABLE
handler t0 close;
---echo connection: flush
connection flush;
reap;
--error ER_UNKNOWN_TABLE
@@ -389,4 +380,3 @@ execute stmt;
--error ER_UNKNOWN_TABLE
handler v read next;
drop view v;
-
diff --git a/mysql-test/suite/handler/myisam.result b/mysql-test/suite/handler/myisam.result
index 9081722d866..84cd8bbd5d2 100644
--- a/mysql-test/suite/handler/myisam.result
+++ b/mysql-test/suite/handler/myisam.result
@@ -538,17 +538,19 @@ handler t1 open;
handler t1 read first;
c1
1
+connect con2,localhost,root,,;
+connection con2;
send the below to another connection, do not wait for the result
optimize table t1;
-proceed with the normal connection
+connection default;
handler t1 read next;
c1
1
handler t1 close;
-read the result from the other connection
+connection con2;
Table Op Msg_type Msg_text
test.t1 optimize status OK
-proceed with the normal connection
+connection default;
drop table t1;
CREATE TABLE t1 ( no1 smallint(5) NOT NULL default '0', no2 int(10) NOT NULL default '0', PRIMARY KEY using btree (no1,no2));
INSERT INTO t1 VALUES (1,274),(1,275),(2,6),(2,8),(4,1),(4,2);
@@ -569,26 +571,28 @@ insert into t1 values (14397);
flush tables with read lock;
drop table t1;
ERROR HY000: Can't execute the query because you have a conflicting read lock
-send the below to another connection, do not wait for the result
+connection con2;
drop table t1;
-proceed with the normal connection
+connection default;
select * from t1;
c1
14397
unlock tables;
+connection con2;
read the result from the other connection
-proceed with the normal connection
+connection default;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
create table t1 (a int not null) ENGINE=csv;
---> client 2
+connection con2;
handler t1 open;
ERROR HY000: Storage engine CSV of the table `test`.`t1` doesn't have this option
---> client 1
+connection default;
drop table t1;
+disconnect con2;
create table t1 (a int);
handler t1 open as t1_alias;
handler t1_alias read a next;
@@ -968,15 +972,17 @@ handler t1 close;
# Explore the effect of HANDLER locks on concurrent DDL
#
handler t1 open;
-# Establishing auxiliary connections con1, con2, con3
-# --> connection con1;
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connect con3, localhost, root,,;
+connection con1;
# Sending:
drop table t1 ;
# We can't use connection 'default' as wait_condition will
# autoclose handlers.
-# --> connection con2
+connection con2;
# Waitng for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
handler t1 read a prev;
a b
5 NULL
@@ -984,9 +990,9 @@ handler t1 read a prev;
a b
4 NULL
handler t1 close;
-# --> connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Explore the effect of HANDLER locks in parallel with SELECT
#
@@ -1008,12 +1014,12 @@ handler t1 read a prev;
a
4
handler t1 close;
-# --> connection con1;
+connection con1;
# Sending:
drop table t1 ;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t1' to get blocked...
-# --> connection default
+connection default;
# We can still use the table, it's part of the transaction
select * from t1;
a
@@ -1038,10 +1044,10 @@ handler t1 read a prev;
a
3
handler t1 close;
-# --> connection con1
+connection con1;
# Now drop can proceed
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
#
# Demonstrate that HANDLER locks and transaction locks
# reside in the same context.
@@ -1058,12 +1064,12 @@ a
3
4
5
-# --> connection con2
+connection con2;
# Sending:
rename table t0 to t3, t1 to t0, t3 to t1;
-# --> connection con1
+connection con1;
# Waiting for 'rename table ...' to get blocked...
-# --> connection default
+connection default;
# We back-off on hitting deadlock condition.
handler t0 open;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
@@ -1077,9 +1083,9 @@ a
handler t1 open;
commit;
handler t1 close;
-# --> connection con2
+connection con2;
# Reaping 'rename table ...'...
-# --> connection default
+connection default;
handler t1 open;
handler t1 read a prev;
a
@@ -1095,22 +1101,22 @@ drop table t0;
#
create table t2 (a int, key a (a));
handler t1 open;
-# --> connection con1
+connection con1;
lock tables t2 read;
-# --> connection con2
+connection con2;
# Sending 'drop table t2'...
drop table t2;
-# --> connection con1
+connection con1;
# Waiting for 'drop table t2' to get blocked...
-# --> connection default
+connection default;
# Sending 'select * from t2'
select * from t2;
-# --> connection con1
+connection con1;
# Waiting for 'select * from t2' to get blocked...
unlock tables;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
-# --> connection default
+connection default;
# Reaping 'select * from t2'
ERROR 42S02: Table 'test.t2' doesn't exist
handler t1 close;
@@ -1134,29 +1140,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1166,9 +1172,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
drop table t3;
#
@@ -1193,29 +1199,29 @@ a
2
select * from t2;
a
-# --> connection con1
+connection con1;
# Sending:
drop table t1;
-# --> connection con2
+connection con2;
# Sending:
drop table t2;
-# --> connection default
+connection default;
# Let DROP TABLE statements sync in. We must use
# a separate connection for that, because otherwise SELECT
# will auto-close the HANDLERs, becaues there are pending
# exclusive locks against them.
-# --> connection con3
+connection con3;
# Waiting for 'drop table t1' to get blocked...
# Waiting for 'drop table t2' to get blocked...
# Demonstrate that t2 lock was released and t2 was dropped
# after ROLLBACK TO SAVEPOINT
-# --> connection default
+connection default;
rollback to savepoint sv;
-# --> connection con2
+connection con2;
# Reaping 'drop table t2'...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t1 read a next;
a
3
@@ -1225,9 +1231,9 @@ a
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t1 close;
-# connection con1
+connection con1;
# Reaping 'drop table t1'...
-# --> connection default
+connection default;
commit;
#
# Show that rollback to the savepoint taken in the beginning
@@ -1254,25 +1260,25 @@ handler t3 read a first;
a
1
rollback to savepoint sv;
-# --> connection con1
+connection con1;
drop table t1, t2;
# Sending:
drop table t3;
# Let DROP TABLE statement sync in.
-# --> connection con2
+connection con2;
# Waiting for 'drop table t3' to get blocked...
# Demonstrate that ROLLBACK TO SAVEPOINT didn't release the handler
# lock.
-# --> connection default
+connection default;
handler t3 read a next;
a
2
# Demonstrate that the drop will go through as soon as we close the
# HANDLER
handler t3 close;
-# connection con1
+connection con1;
# Reaping 'drop table t3'...
-# --> connection default
+connection default;
commit;
#
# If we have to wait on an exclusive locks while having
@@ -1281,27 +1287,27 @@ commit;
create table t1 (a int, key a(a));
create table t2 like t1;
handler t1 open;
-# --> connection con1
+connection con1;
lock table t1 write, t2 write;
-# --> connection default
+connection default;
drop table t2;
-# --> connection con2
+connection con2;
# Waiting for 'drop table t2' to get blocked...
-# --> connection con1
+connection con1;
drop table t1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
unlock tables;
-# --> connection default
+connection default;
# Demonstrate that there is no deadlock with FLUSH TABLE,
# even though it is waiting for the other table to go away
create table t2 like t1;
# Sending:
flush table t2;
-# --> connection con2
+connection con2;
drop table t1;
-# --> connection con1
+connection con1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'flush table t2'...
drop table t2;
#
@@ -1310,20 +1316,20 @@ drop table t2;
#
create table t1 (a int, key using btree (a));
insert into t1 values (1), (2);
-# --> connection default
+connection default;
begin;
select * from t1;
a
1
2
handler t1 open;
-# --> connection con1
+connection con1;
# Sending:
lock tables t1 write;
-# --> connection con2
+connection con2;
# Check that 'lock tables t1 write' waits until transaction which
# has read from the table commits.
-# --> connection default
+connection default;
# The below 'handler t1 read ...' should not be blocked as
# 'lock tables t1 write' has not succeeded yet.
handler t1 read a next;
@@ -1331,24 +1337,28 @@ a
1
# Unblock 'lock tables t1 write'.
commit;
-# --> connection con1
+connection con1;
# Reap 'lock tables t1 write'.
-# --> connection default
+connection default;
# Sending:
handler t1 read a next;
-# --> connection con1
+connection con1;
# Waiting for 'handler t1 read a next' to get blocked...
# The below 'drop table t1' should be able to proceed without
# waiting as it will force HANDLER to be closed.
drop table t1;
unlock tables;
-# --> connection default
+connection default;
# Reaping 'handler t1 read a next'...
ERROR 42S02: Table 'test.t1' doesn't exist
handler t1 close;
-# --> connection con1
-# --> connection con2
-# --> connection con3
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
#
# A temporary table test.
# Check that we don't loose positions of HANDLER opened
@@ -1475,8 +1485,8 @@ drop table t2, t3;
# Check that when we clone a ticket for HANDLER we downrade
# the lock.
#
-# Establish an auxiliary connection con1.
-# -> connection default
+connect con1,localhost,root,,;
+connection default;
create table t1 (a int, b int, key using btree (a));
insert into t1 (a, b) values (1, 1), (2, 1), (3, 2), (4, 2), (5, 5);
begin;
@@ -1490,19 +1500,20 @@ handler t1 read a last;
a b
7 7
commit;
-# -> connection con1
+connection con1;
# Demonstrate that the HANDLER doesn't hold MDL_SHARED_WRITE.
lock table t1 write;
unlock tables;
-# -> connection default
+connection default;
handler t1 read a prev;
a b
6 6
handler t1 close;
# Cleanup.
drop table t1;
-# -> connection con1
-# -> connection default
+connection con1;
+disconnect con1;
+connection default;
#
# A test for Bug#50555 "handler commands crash server in
# my_hash_first()".
@@ -1631,26 +1642,28 @@ drop tables t1, t2;
# bool MDL_context::try_acquire_lock(MDL_request*)
#
DROP TABLE IF EXISTS t1;
-# Connection default
+connect con51355, localhost, root;
+connection default;
CREATE TABLE t1(id INT, KEY id(id));
HANDLER t1 OPEN;
-# Connection con51355
+connection con51355;
# Sending:
DROP TABLE t1;
-# Connection default
+connection default;
# This I_S query will cause the handler table to be closed and
# the metadata lock to be released. This will allow DROP TABLE
# to proceed. Waiting for the table to be removed.
-# Connection con51355
+connection con51355;
# Reaping: DROP TABLE t1
-# Connection default
+connection default;
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 READ id NEXT;
ERROR 42S02: Table 'test.t1' doesn't exist
HANDLER t1 CLOSE;
-# Connection con51355
-# Connection default
+connection con51355;
+disconnect con51355;
+connection default;
#
# Bug#54401 assert in Diagnostics_area::set_eof_status , HANDLER
#
diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result
index def975af6dd..25a0a072c24 100644
--- a/mysql-test/suite/innodb/r/auto_increment_dup.result
+++ b/mysql-test/suite/innodb/r/auto_increment_dup.result
@@ -4,15 +4,13 @@ id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
k INT,
c CHAR(1),
UNIQUE KEY(k)) ENGINE=InnoDB;
-#
-# Connection 1
-#
+connect con1, localhost, root;
+connect con2, localhost, root;
+connection con1;
SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
affected rows: 0
INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1';
-#
-# Connection 2
-#
+connection con2;
SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2';
affected rows: 0
SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
@@ -20,6 +18,7 @@ affected rows: 0
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
affected rows: 3
info: Records: 3 Duplicates: 0 Warnings: 0
+connection con1;
affected rows: 4
info: Records: 3 Duplicates: 1 Warnings: 0
SET DEBUG_SYNC='RESET';
@@ -30,4 +29,7 @@ id k c
2 3 NULL
5 4 NULL
6 5 NULL
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/binlog_consistent.result b/mysql-test/suite/innodb/r/binlog_consistent.result
index 1e095c6596e..0562a92ef68 100644
--- a/mysql-test/suite/innodb/r/binlog_consistent.result
+++ b/mysql-test/suite/innodb/r/binlog_consistent.result
@@ -1,5 +1,9 @@
RESET MASTER;
-# Connection default
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connect con4,localhost,root,,;
+connection default;
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
SHOW MASTER STATUS;
File Position Binlog_Do_DB Binlog_Ignore_DB
@@ -10,28 +14,28 @@ Binlog_snapshot_file master-bin.000001
Binlog_snapshot_position <pos>
BEGIN;
INSERT INTO t1 VALUES (0, "");
-# Connection con1
+connection con1;
BEGIN;
INSERT INTO t1 VALUES (1, "");
-# Connection con2
+connection con2;
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam;
BEGIN;
INSERT INTO t1 VALUES (2, "first");
INSERT INTO t2 VALUES (2);
INSERT INTO t1 VALUES (2, "second");
-# Connection default
+connection default;
COMMIT;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
-# Connection con3
+connection con3;
BEGIN;
INSERT INTO t1 VALUES (3, "");
INSERT INTO t2 VALUES (3);
-# Connection con4
+connection con4;
BEGIN;
INSERT INTO t1 VALUES (4, "");
COMMIT;
-# Connection default
+connection default;
SELECT * FROM t1 ORDER BY a,b;
a b
0
@@ -46,14 +50,14 @@ SELECT * FROM t2 ORDER BY a;
a
2
3
-# Connection con1
+connection con1;
COMMIT;
-# Connection con2
+connection con2;
COMMIT;
-# Connection con3
+connection con3;
COMMIT;
FLUSH LOGS;
-# Connection default
+connection default;
SELECT * FROM t1 ORDER BY a,b;
a b
0
diff --git a/mysql-test/suite/innodb/r/group_commit.result b/mysql-test/suite/innodb/r/group_commit.result
index 5321715df36..e2fb89767d4 100644
--- a/mysql-test/suite/innodb/r/group_commit.result
+++ b/mysql-test/suite/innodb/r/group_commit.result
@@ -3,35 +3,51 @@ SELECT variable_value INTO @commits FROM information_schema.global_status
WHERE variable_name = 'binlog_commits';
SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits';
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connect con4,localhost,root,,;
+connect con5,localhost,root,,;
+connect con6,localhost,root,,;
+connection con1;
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued";
INSERT INTO t1 VALUES ("con1");
+connection con2;
set DEBUG_SYNC= "now WAIT_FOR group1_running";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2";
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running";
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed";
SET DEBUG_SYNC= "commit_after_group_run_commit_ordered SIGNAL group2_visible WAIT_FOR group2_checked";
INSERT INTO t1 VALUES ("con2");
+connection con3;
SET DEBUG_SYNC= "now WAIT_FOR group2_con2";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con3";
INSERT INTO t1 VALUES ("con3");
+connection con4;
SET DEBUG_SYNC= "now WAIT_FOR group2_con3";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con4";
INSERT INTO t1 VALUES ("con4");
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR group2_con4";
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SELECT * FROM t1 ORDER BY a;
a
SET DEBUG_SYNC= "now SIGNAL group2_queued";
+connection con1;
+connection default;
SELECT * FROM t1 ORDER BY a;
a
con1
+connection con5;
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5";
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued";
set DEBUG_SYNC= "now WAIT_FOR group2_running";
INSERT INTO t1 VALUES ("con5");
+connection con6;
SET DEBUG_SYNC= "now WAIT_FOR con5_leader";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con6_queued";
INSERT INTO t1 VALUES ("con6");
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR group3_con5";
SELECT * FROM t1 ORDER BY a;
a
@@ -45,6 +61,12 @@ con2
con3
con4
SET DEBUG_SYNC= "now SIGNAL group2_checked";
+connection con2;
+connection con3;
+connection con4;
+connection con5;
+connection con6;
+connection default;
SELECT * FROM t1 ORDER BY a;
a
con1
diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
index 8a0eed2bf3c..616790c8b37 100644
--- a/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
+++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos.result
@@ -1,15 +1,22 @@
SET GLOBAL innodb_flush_log_at_trx_commit=3;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES (0);
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connection con1;
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR con3_queued";
SET DEBUG_SYNC= "commit_loop_entry_commit_ordered SIGNAL con1_loop WAIT_FOR con1_loop_cont EXECUTE 3";
INSERT INTO t1 VALUES (1);
+connection con2;
SET DEBUG_SYNC= "now WAIT_FOR con1_waiting";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con2_queued";
INSERT INTO t1 VALUES (2);
+connection con3;
SET DEBUG_SYNC= "now WAIT_FOR con2_queued";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con3_queued";
INSERT INTO t1 VALUES (3);
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_loop";
SET DEBUG_SYNC= "now SIGNAL con1_loop_cont";
SET DEBUG_SYNC= "now WAIT_FOR con1_loop";
@@ -20,11 +27,16 @@ a
0
1
2
+connection con2;
+connection default;
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
+connection con1;
Got one of the listed errors
+connection con3;
Got one of the listed errors
+connection default;
SELECT * FROM t1 ORDER BY a;
a
0
diff --git a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
index d85b6681360..f338761aea8 100644
--- a/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_binlog_pos_no_optimize_thread.result
@@ -1,17 +1,24 @@
SET GLOBAL innodb_flush_log_at_trx_commit=3;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=innodb;
INSERT INTO t1 VALUES (0);
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connection con1;
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con1_waiting WAIT_FOR con3_queued";
SET DEBUG_SYNC= "commit_loop_entry_commit_ordered SIGNAL con1_loop WAIT_FOR con1_loop_cont";
INSERT INTO t1 VALUES (1);
+connection con2;
SET DEBUG_SYNC= "now WAIT_FOR con1_waiting";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con2_queued";
SET DEBUG_SYNC= "commit_loop_entry_commit_ordered SIGNAL con1_loop WAIT_FOR con1_loop_cont";
INSERT INTO t1 VALUES (2);
+connection con3;
SET DEBUG_SYNC= "now WAIT_FOR con2_queued";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con3_queued";
SET DEBUG_SYNC= "commit_loop_entry_commit_ordered SIGNAL con1_loop WAIT_FOR con1_loop_cont";
INSERT INTO t1 VALUES (3);
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR con1_loop";
SET DEBUG_SYNC= "now SIGNAL con1_loop_cont";
SET DEBUG_SYNC= "now WAIT_FOR con1_loop";
@@ -22,10 +29,15 @@ a
0
1
2
+connection con1;
+connection con2;
+connection default;
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
+connection con3;
Got one of the listed errors
+connection default;
SELECT * FROM t1 ORDER BY a;
a
0
diff --git a/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result b/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result
index dd152fd3c9c..41e9f6a9d08 100644
--- a/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result
+++ b/mysql-test/suite/innodb/r/group_commit_no_optimize_thread.result
@@ -3,35 +3,51 @@ SELECT variable_value INTO @commits FROM information_schema.global_status
WHERE variable_name = 'binlog_commits';
SELECT variable_value INTO @group_commits FROM information_schema.global_status
WHERE variable_name = 'binlog_group_commits';
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
+connect con4,localhost,root,,;
+connect con5,localhost,root,,;
+connect con6,localhost,root,,;
+connection con1;
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group1_running WAIT_FOR group2_queued";
INSERT INTO t1 VALUES ("con1");
+connection con2;
set DEBUG_SYNC= "now WAIT_FOR group1_running";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con2";
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group2_running";
SET DEBUG_SYNC= "commit_after_release_LOCK_log WAIT_FOR group3_committed";
INSERT INTO t1 VALUES ("con2");
+connection con3;
SET DEBUG_SYNC= "now WAIT_FOR group2_con2";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con3";
INSERT INTO t1 VALUES ("con3");
+connection con4;
SET DEBUG_SYNC= "now WAIT_FOR group2_con3";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL group2_con4";
SET DEBUG_SYNC= "commit_after_group_run_commit_ordered SIGNAL group2_visible WAIT_FOR group2_checked";
INSERT INTO t1 VALUES ("con4");
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR group2_con4";
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
SELECT * FROM t1 ORDER BY a;
a
SET DEBUG_SYNC= "now SIGNAL group2_queued";
+connection con1;
+connection default;
SELECT * FROM t1 ORDER BY a;
a
con1
+connection con5;
SET DEBUG_SYNC= "commit_before_get_LOCK_after_binlog_sync SIGNAL group3_con5";
SET DEBUG_SYNC= "commit_after_get_LOCK_log SIGNAL con5_leader WAIT_FOR con6_queued";
set DEBUG_SYNC= "now WAIT_FOR group2_running";
INSERT INTO t1 VALUES ("con5");
+connection con6;
SET DEBUG_SYNC= "now WAIT_FOR con5_leader";
SET DEBUG_SYNC= "commit_after_prepare_ordered SIGNAL con6_queued";
INSERT INTO t1 VALUES ("con6");
+connection default;
SET DEBUG_SYNC= "now WAIT_FOR group3_con5";
SELECT * FROM t1 ORDER BY a;
a
@@ -45,6 +61,12 @@ con2
con3
con4
SET DEBUG_SYNC= "now SIGNAL group2_checked";
+connection con2;
+connection con3;
+connection con4;
+connection con5;
+connection con6;
+connection default;
SELECT * FROM t1 ORDER BY a;
a
con1
diff --git a/mysql-test/suite/innodb/r/innodb-autoinc-61209.result b/mysql-test/suite/innodb/r/innodb-autoinc-61209.result
index 9dd654702e2..f01008a80ae 100644
--- a/mysql-test/suite/innodb/r/innodb-autoinc-61209.result
+++ b/mysql-test/suite/innodb/r/innodb-autoinc-61209.result
@@ -1,28 +1,22 @@
DROP TABLE IF EXISTS bug_61209;
CREATE TABLE bug_61209 (a INT auto_increment, PRIMARY KEY(a)) ENGINE=InnoDB;
INSERT INTO bug_61209 VALUES (), (), (), ();
-
-# Connect con1
-
-# Connect con2
-
-# Connection con1
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
SET SESSION auto_increment_increment=3;
SET SESSION auto_increment_offset=2;
SELECT GET_LOCK('a', 9);
GET_LOCK('a', 9)
1
-
-# Connection con2
+connection con2;
SET SESSION auto_increment_increment=3;
SET SESSION auto_increment_offset=2;
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10));
-
-# Connection con1 reap
+connection con1;
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL);
SELECT RELEASE_LOCK('a');
RELEASE_LOCK('a')
1
-
-# Connection con2 reap
+connection con2;
DROP TABLE bug_61209;
diff --git a/mysql-test/suite/innodb/r/innodb-blob.result b/mysql-test/suite/innodb/r/innodb-blob.result
index a90f83945e0..ec5a4a8b0ac 100644
--- a/mysql-test/suite/innodb/r/innodb-blob.result
+++ b/mysql-test/suite/innodb/r/innodb-blob.result
@@ -8,17 +8,22 @@ UPDATE t1 SET a=a+2;
ROLLBACK;
BEGIN;
UPDATE t1 SET b=CONCAT(b,'foo');
+connect con1,localhost,root,,;
SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT a, RIGHT(b,20) FROM t1;
+connect con2,localhost,root,,;
SET DEBUG_SYNC='now SIGNAL go1';
+connection con1;
a RIGHT(b,20)
1 aaaaaaaaaaaaaaaaaaaa
2 bbbbbbbbbbbbbbbbbbbb
+connection default;
SET DEBUG_DBUG='+d,row_ins_extern_checkpoint';
SET DEBUG_SYNC='before_row_ins_extern_latch SIGNAL rec_not_blob WAIT_FOR crash';
ROLLBACK;
BEGIN;
INSERT INTO t1 VALUES (3,REPEAT('c',50000));
+connection con1;
SET DEBUG_SYNC='now WAIT_FOR rec_not_blob';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT @@tx_isolation;
@@ -36,6 +41,9 @@ a
SET DEBUG_DBUG='+d,crash_commit_before';
INSERT INTO t2 VALUES (42);
ERROR HY000: Lost connection to MySQL server during query
+disconnect con1;
+disconnect con2;
+connection default;
ERROR HY000: Lost connection to MySQL server during query
CHECK TABLE t1;
Table Op Msg_type Msg_text
@@ -45,26 +53,34 @@ INSERT INTO t3 VALUES
(2,REPEAT('g',7000),REPEAT('h',100));
SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR go';
UPDATE t3 SET c=REPEAT('f',3000) WHERE a=1;
+connect con1,localhost,root,,;
SET DEBUG_SYNC='now WAIT_FOR have_latch';
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT @@tx_isolation;
@@tx_isolation
READ-UNCOMMITTED
SELECT a, RIGHT(b,20), RIGHT(c,20) FROM t3;
+connect con2,localhost,root,,;
SET DEBUG_SYNC='now SIGNAL go';
+connection con1;
a RIGHT(b,20) RIGHT(c,20)
1 dddddddddddddddddddd ffffffffffffffffffff
2 gggggggggggggggggggg hhhhhhhhhhhhhhhhhhhh
+disconnect con1;
+connection default;
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
test.t1 check status OK
test.t2 check status OK
test.t3 check status OK
+connection con2;
BEGIN;
INSERT INTO t2 VALUES (347);
+connection default;
SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
SET DEBUG_SYNC='before_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2;
+connection con2;
SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: before_row_upd_extern';
@@ -73,6 +89,8 @@ UPDATE t3 SET c=REPEAT('i',3000) WHERE a=2
SET DEBUG_DBUG='+d,crash_commit_before';
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
+disconnect con2;
+connection default;
ERROR HY000: Lost connection to MySQL server during query
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
@@ -87,11 +105,14 @@ SELECT a FROM t3;
a
1
2
+connect con2,localhost,root,,;
BEGIN;
INSERT INTO t2 VALUES (33101);
+connection default;
SET DEBUG_DBUG='+d,row_upd_extern_checkpoint';
SET DEBUG_SYNC='after_row_upd_extern SIGNAL have_latch WAIT_FOR crash';
UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2;
+connection con2;
SET DEBUG_SYNC='now WAIT_FOR have_latch';
SELECT info FROM information_schema.processlist
WHERE state = 'debug sync point: after_row_upd_extern';
@@ -100,6 +121,8 @@ UPDATE t3 SET c=REPEAT('j',3000) WHERE a=2
SET DEBUG_DBUG='+d,crash_commit_before';
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
+disconnect con2;
+connection default;
ERROR HY000: Lost connection to MySQL server during query
CHECK TABLE t1,t2,t3;
Table Op Msg_type Msg_text
diff --git a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
index 96d2a3d462c..508d578193f 100644
--- a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
+++ b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
@@ -30,6 +30,8 @@ b
x
x
x
+connect con1,localhost,root,,;
+connection con1;
BEGIN;
DELETE FROM t1 WHERE a=1;
INSERT INTO t1 VALUES(1,'X',1);
diff --git a/mysql-test/suite/innodb/r/innodb-consistent.result b/mysql-test/suite/innodb/r/innodb-consistent.result
index 9115791b99c..c959dc1adb9 100644
--- a/mysql-test/suite/innodb/r/innodb-consistent.result
+++ b/mysql-test/suite/innodb/r/innodb-consistent.result
@@ -1,4 +1,7 @@
drop table if exists t1;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
set session transaction isolation level read committed;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
create table t2 like t1;
@@ -6,21 +9,25 @@ insert into t2 values (1),(2),(3),(4),(5),(6),(7);
set autocommit=0;
begin;
replace into t1 select * from t2;
+connection b;
set session transaction isolation level read committed;
set autocommit=0;
delete from t2 where a=5;
commit;
delete from t2;
commit;
+connection a;
commit;
begin;
insert into t1 select * from t2;
+connection b;
set session transaction isolation level read committed;
set autocommit=0;
delete from t2 where a=5;
commit;
delete from t2;
commit;
+connection a;
commit;
select * from t1;
a
@@ -33,3 +40,6 @@ a
7
drop table t1;
drop table t2;
+connection default;
+disconnect a;
+disconnect b;
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index b151e20d321..d7aa6c46747 100644
--- a/mysql-test/suite/innodb/r/innodb-index.result
+++ b/mysql-test/suite/innodb/r/innodb-index.result
@@ -1055,6 +1055,9 @@ t2 CREATE TABLE `t2` (
affected rows: 1
DROP TABLE t2;
DROP TABLE t1;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
CREATE TABLE t1 (a INT, b CHAR(1)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (3,'a'),(3,'b'),(1,'c'),(0,'d'),(1,'e');
CREATE TABLE t2 (a INT, b CHAR(1)) ENGINE=InnoDB;
@@ -1063,6 +1066,7 @@ CREATE TABLE t2c (a INT, b CHAR(1) NOT NULL) ENGINE=InnoDB;
INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2i SELECT * FROM t1;
INSERT INTO t2c SELECT * FROM t1;
+connection b;
BEGIN;
SELECT * FROM t1;
a b
@@ -1071,6 +1075,7 @@ a b
1 c
0 d
1 e
+connection a;
SET lock_wait_timeout=1;
CREATE INDEX t1a ON t1(a);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -1086,6 +1091,7 @@ set @@sql_mode = @old_sql_mode;
ALTER TABLE t2c ADD PRIMARY KEY(a,b), ADD INDEX t2a(a), ALGORITHM=COPY;
affected rows: 5
info: Records: 5 Duplicates: 0 Warnings: 0
+connection b;
SELECT * FROM t2i;
ERROR HY000: Table definition has changed, please retry transaction
SELECT * FROM t2i FORCE INDEX(t2a) ORDER BY a;
@@ -1153,6 +1159,9 @@ a b
1 e
3 a
3 b
+connection default;
+disconnect a;
+disconnect b;
alter table t2 add index t2a(b);
ERROR 42000: Duplicate key name 't2a'
alter table t2 drop index t2a, add index t2a(b);
diff --git a/mysql-test/suite/innodb/r/innodb-lock.result b/mysql-test/suite/innodb/r/innodb-lock.result
index 7191bcd238a..6604f2396a3 100644
--- a/mysql-test/suite/innodb/r/innodb-lock.result
+++ b/mysql-test/suite/innodb/r/innodb-lock.result
@@ -2,24 +2,31 @@ set global innodb_table_locks=1;
select @@innodb_table_locks;
@@innodb_table_locks
1
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
drop table if exists t1;
set @@innodb_table_locks=1;
+connection con1;
create table t1 (id integer, x integer) engine=INNODB;
insert into t1 values(0, 0);
set autocommit=0;
SELECT * from t1 where id = 0 FOR UPDATE;
id x
0 0
+connection con2;
set autocommit=0;
lock table t1 write;
+connection con1;
update t1 set x=1 where id = 0;
select * from t1;
id x
0 1
commit;
+connection con2;
update t1 set x=2 where id = 0;
commit;
unlock tables;
+connection con1;
select * from t1;
id x
0 2
@@ -39,7 +46,7 @@ commit;
SELECT * from t1 where id = 0 FOR UPDATE;
id x
0 0
-# Connection 'con2'.
+connection con2;
set autocommit=0;
set @@innodb_table_locks=0;
# The following statement should block because SQL-level lock
@@ -47,7 +54,7 @@ set @@innodb_table_locks=0;
# is commited.
# Sending:
lock table t1 write;;
-# Connection 'con1'.
+connection con1;
# Wait until LOCK TABLE is blocked on SQL-level lock.
# We should be able to do UPDATEs and SELECTs within transaction.
update t1 set x=1 where id = 0;
@@ -58,14 +65,14 @@ id x
2 2
# Unblock LOCK TABLE.
commit;
-# Connection 'con2'.
+connection con2;
# Reap LOCK TABLE.
unlock tables;
-# Connection 'con1'.
+connection con1;
select * from t1 where id = 0 for update;
id x
0 1
-# Connection 'con2'.
+connection con2;
# The below statement should not be blocked as LOCK TABLES ... READ
# does not take strong SQL-level lock on t1. SELECTs which do not
# conflict with transaction in the first connections should not be
@@ -86,7 +93,7 @@ id x
1 1
2 2
commit;
-# Connection 'con1'.
+connection con1;
commit;
drop table t1;
#
@@ -94,19 +101,27 @@ drop table t1;
#fixed by re-fixing Bug#7975
#aka Bug#11759688 52020: InnoDB can still deadlock on just INSERT...
#
+connection default;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT NOT NULL) ENGINE=InnoDB;
INSERT INTO t1 VALUES(3,1);
BEGIN;
INSERT IGNORE INTO t1 VALUES(3,14);
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
+connection con1;
BEGIN;
INSERT IGNORE INTO t1 VALUES(3,23);
Warnings:
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
SELECT * FROM t1 FOR UPDATE;
+connection con2;
+connection default;
COMMIT;
+connection con1;
a b
3 1
COMMIT;
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb-semi-consistent.result b/mysql-test/suite/innodb/r/innodb-semi-consistent.result
index 78ef4a23149..f4541b589f7 100644
--- a/mysql-test/suite/innodb/r/innodb-semi-consistent.result
+++ b/mysql-test/suite/innodb/r/innodb-semi-consistent.result
@@ -1,4 +1,7 @@
drop table if exists t1,t2;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
set binlog_format=mixed;
set session transaction isolation level repeatable read;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
@@ -7,28 +10,36 @@ set autocommit=0;
select * from t1 where a=3 lock in share mode;
a
3
+connection b;
set binlog_format=mixed;
set session transaction isolation level repeatable read;
set autocommit=0;
update t1 set a=10 where a=5;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
+connection a;
commit;
+connection b;
set session transaction isolation level read committed;
update t1 set a=10 where a=5;
+connection a;
select * from t1 where a=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t1 where a=2 limit 1 for update;
a
2
+connection b;
update t1 set a=11 where a=6;
update t1 set a=12 where a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t1 set a=13 where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection a;
commit;
+connection b;
update t1 set a=14 where a=1;
commit;
+connection a;
select * from t1;
a
14
@@ -39,10 +50,17 @@ a
11
7
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
create table t1 (a int, b int) engine=myisam;
create table t2 (c int, d int, key (c)) engine=innodb;
insert into t1 values (1,1);
insert into t2 values (1,2);
+connect a,localhost,root,,;
+connection a;
set session transaction isolation level read committed;
delete from t1 using t1 join t2 on t1.a = t2.c where t2.d in (1);
+connection default;
+disconnect a;
drop table t1, t2;
diff --git a/mysql-test/suite/innodb/r/innodb-timeout.result b/mysql-test/suite/innodb/r/innodb-timeout.result
index bb71ba5cb3d..f252ebac314 100644
--- a/mysql-test/suite/innodb/r/innodb-timeout.result
+++ b/mysql-test/suite/innodb/r/innodb-timeout.result
@@ -1,4 +1,7 @@
set global innodb_lock_wait_timeout=42;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
@@ -6,6 +9,7 @@ set innodb_lock_wait_timeout=1;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
1
+connection b;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
42
@@ -17,24 +21,39 @@ set innodb_lock_wait_timeout=10;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
10
+connect c,localhost,root,,;
+connection c;
select @@innodb_lock_wait_timeout;
@@innodb_lock_wait_timeout
347
+disconnect c;
+connection a;
SET @connection_b_id = <connection_b_id>;
create table t1(a int primary key)engine=innodb;
begin;
insert into t1 values(1),(2),(3);
+connection b;
select * from t1 for update;
+connection a;
commit;
+connection b;
a
1
2
3
+connection a;
begin;
insert into t1 values(4);
+connection b;
set innodb_lock_wait_timeout=3;
select * from t1 for update;
+connection a;
commit;
+connection b;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+disconnect b;
+connection a;
+disconnect a;
+connection default;
drop table t1;
set global innodb_lock_wait_timeout=<initial_timeout>;
diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result
index 3813cfcda14..73920134185 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -2492,34 +2492,46 @@ SET FOREIGN_KEY_CHECKS=1;
INSERT INTO t2 VALUES(3);
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test`.`t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
DROP TABLE t2;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2);
set autocommit=0;
checksum table t1;
Table Checksum
test.t1 1531596814
+connection b;
insert into t1 values(3);
+connection a;
checksum table t1;
Table Checksum
test.t1 1531596814
+connection a;
commit;
checksum table t1;
Table Checksum
test.t1 2050879373
commit;
drop table t1;
+connection a;
create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into t1 values (1),(2);
set autocommit=1;
checksum table t1;
Table Checksum
test.t1 1531596814
+connection b;
set autocommit=1;
insert into t1 values(3);
+connection a;
checksum table t1;
Table Checksum
test.t1 2050879373
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
set foreign_key_checks=0;
create table t2 (a int primary key, b int, foreign key (b) references t1(a)) engine = innodb;
create table t1(a char(10) primary key, b varchar(20)) engine = innodb;
@@ -2784,6 +2796,9 @@ select ml.* from t1 as ml left join t2 as mm on (mm.id=ml.id)
where mm.id is null lock in share mode;
id f_id f
drop table t1,t2;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2),(7,3);
commit;
@@ -2791,15 +2806,24 @@ SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t1 set b = 5 where b = 1;
+connection b;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
select * from t1 where a = 7 and b = 3 for update;
a b
7 3
+connection a;
commit;
+connection b;
commit;
drop table t1;
+connection default;
+disconnect a;
+disconnect b;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values(1,1),(2,2),(3,1),(4,2),(5,1),(6,2);
commit;
@@ -2813,12 +2837,21 @@ a b
5 1
6 2
update t1 set b = 5 where b = 1;
+connection b;
set autocommit = 0;
select * from t1 where a = 2 and b = 2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection a;
commit;
+connection b;
commit;
+connection default;
+disconnect a;
+disconnect b;
drop table t1;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(d int not null, e int, primary key(d)) engine=innodb;
@@ -2830,6 +2863,7 @@ d e
3 1
8 6
12 1
+connection b;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
@@ -2838,8 +2872,23 @@ update t1 set b = (select e from t2 where a = d);
create table t3(d int not null, e int, primary key(d)) engine=innodb
select * from t2;
commit;
+connection a;
commit;
+connection default;
+disconnect a;
+disconnect b;
drop table t1, t2, t3;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connect c,localhost,root,,;
+connect d,localhost,root,,;
+connect e,localhost,root,,;
+connect f,localhost,root,,;
+connect g,localhost,root,,;
+connect h,localhost,root,,;
+connect i,localhost,root,,;
+connect j,localhost,root,,;
+connection a;
create table t1(a int not null, b int, primary key(a)) engine=innodb;
insert into t1 values (1,2),(5,3),(4,2);
create table t2(a int not null, b int, primary key(a)) engine=innodb;
@@ -2861,52 +2910,82 @@ a b
3 1
8 6
12 1
+connection b;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
insert into t1 select * from t2;
+connection c;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
update t3 set b = (select b from t2 where a = d);
+connection d;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
create table t4(a int not null, b int, primary key(a)) engine=innodb select * from t2;
+connection e;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t5 (select * from t2 lock in share mode);
+connection f;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t6 set e = (select b from t2 where a = d lock in share mode);
+connection g;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t7(a int not null, b int, primary key(a)) engine=innodb select * from t2 lock in share mode;
+connection h;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
insert into t8 (select * from t2 for update);
+connection i;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
update t9 set e = (select b from t2 where a = d for update);
+connection j;
SET binlog_format='MIXED';
set autocommit = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
create table t10(a int not null, b int, primary key(a)) engine=innodb select * from t2 for update;
+connection b;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection c;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection d;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection e;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection f;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection g;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection h;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection i;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection j;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection a;
commit;
+connection default;
+disconnect a;
+disconnect b;
+disconnect c;
+disconnect d;
+disconnect e;
+disconnect f;
+disconnect g;
+disconnect h;
+disconnect i;
+disconnect j;
drop table t1, t2, t3, t5, t6, t8, t9;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
ERROR 42000: Incorrect column name 'DB_ROW_ID'
@@ -3044,6 +3123,9 @@ id
-10
1
DROP TABLE t1;
+CONNECT c1,localhost,root,,;
+CONNECT c2,localhost,root,,;
+connection c1;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
@@ -3055,24 +3137,33 @@ CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
CREATE TABLE t2 LIKE t1;
SELECT * FROM t2;
a
+connection c2;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (1);
COMMIT;
+connection c1;
SELECT * FROM t1 WHERE a=1;
a
1
+disconnect c1;
+disconnect c2;
+CONNECT c1,localhost,root,,;
+CONNECT c2,localhost,root,,;
+connection c1;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
SELECT * FROM t2;
a
+connection c2;
SET binlog_format='MIXED';
SET TX_ISOLATION='read-committed';
SET AUTOCOMMIT=0;
INSERT INTO t1 VALUES (2);
COMMIT;
+connection c1;
SELECT * FROM t1 WHERE a=2;
a
2
@@ -3081,6 +3172,9 @@ a
2
DROP TABLE t1;
DROP TABLE t2;
+disconnect c1;
+disconnect c2;
+connection default;
create table t1 (i int, j int) engine=innodb;
insert into t1 (i, j) values (1, 1), (2, 2);
update t1 set j = 2;
@@ -3094,6 +3188,7 @@ where table_schema='test' and table_name = 't1';
table_comment data_free_is_set
this is a comment 1
drop table t1;
+connection default;
CREATE TABLE t1 (
c1 INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
c2 VARCHAR(128) NOT NULL,
@@ -3113,6 +3208,7 @@ AUTO_INCREMENT
200
DROP TABLE t2;
DROP TABLE t1;
+connection default;
CREATE TABLE t1 (c1 int default NULL,
c2 int default NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
diff --git a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
index 9f6b7ca6a23..c467193bca7 100644
--- a/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
+++ b/mysql-test/suite/innodb/r/innodb_blob_unrecoverable_crash.result
@@ -1,6 +1,7 @@
call mtr.add_suppression("InnoDB: The total blob data length");
SET GLOBAL max_allowed_packet = 100*1024*1024;
-# Connection big_packets:
+connect big_packets,localhost,root,,;
+connection big_packets;
CREATE TABLE t1 (a BIGINT PRIMARY KEY, b LONGBLOB) ENGINE=InnoDB;
INSERT INTO t1 (a, b) VALUES (1, '1');
INSERT INTO t1 (a, b) VALUES (2, '2');
@@ -10,9 +11,9 @@ INSERT INTO t1 (a, b) VALUES (5, '5');
start transaction;
INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024));
ERROR 42000: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size. Increase the redo log size using innodb_log_file_size.
-# Connection default:
+connection default;
# Quick shutdown and restart server
-# Connection default:
+connection default;
SELECT a FROM t1;
a
1
diff --git a/mysql-test/suite/innodb/r/innodb_bug12400341.result b/mysql-test/suite/innodb/r/innodb_bug12400341.result
index c382bd12616..31a064e624d 100644
--- a/mysql-test/suite/innodb/r/innodb_bug12400341.result
+++ b/mysql-test/suite/innodb/r/innodb_bug12400341.result
@@ -16,11 +16,13 @@ CREATE TABLE mysqltest.transtable (id int unsigned NOT NULL PRIMARY KEY, val int
select count(*) from information_schema.processlist;
count(*)
33
+connection default;
CREATE TABLE mysqltest.testtable (id int unsigned not null primary key) ENGINE=InnoDB;
ERROR HY000: Can't create table `mysqltest`.`testtable` (errno: 177 "Too many active concurrent transactions")
select count(*) from information_schema.processlist;
count(*)
33
+connection default;
select count(*) from information_schema.processlist;
count(*)
33
diff --git a/mysql-test/suite/innodb/r/innodb_bug14007649.result b/mysql-test/suite/innodb/r/innodb_bug14007649.result
index 50de5868be4..659881b55a6 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14007649.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14007649.result
@@ -14,7 +14,11 @@ t1 CREATE TABLE `t1` (
KEY `i2` (`f2`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
insert into `t1` (rowid, f1, f2) values (1, 1, 10), (2, 1, NULL);
+connect a,localhost,root,,;
+connect b,localhost,root,,;
+connection a;
start transaction with consistent snapshot;
+connection b;
start transaction;
update t1 set f2 = 4 where f1 = 1 and f2 is null;
(b) Number of rows updated:
@@ -29,6 +33,7 @@ rowid f1 f2
2 1 4
3 1 NULL
commit;
+connection a;
(a) Before the update statement is executed.
select rowid, f1, f2 from t1;
rowid f1 f2
@@ -53,4 +58,7 @@ rowid f1 f2
1 1 10
2 1 4
3 1 6
+connection default;
+disconnect a;
+disconnect b;
drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug14704286.result b/mysql-test/suite/innodb/r/innodb_bug14704286.result
index 9de42cb01c8..f84d5206e07 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14704286.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14704286.result
@@ -6,8 +6,13 @@ insert into t1 values
(10,10,10,10),(11,11,11,11),(12,12,12,12),(13,13,13,13),(14,14,14,14),
(15,15,15,15),(16,16,16,16),(17,17,17,17),(18,18,18,18),(19,19,19,19),
(20,20,20,20);
+connect conn1, localhost, root,,;
+connect conn2, localhost, root,,;
+connect conn3, localhost, root,,;
+connection conn1;
use test;
start transaction with consistent snapshot;
+connection conn2;
use test;
CREATE PROCEDURE update_t1()
BEGIN
@@ -46,8 +51,15 @@ id value value2 value3
18 18 18 18
19 19 19 19
20 20 20 20
+connection conn1;
select * from t1 force index(value) where value=12;
+connection conn3;
kill query @id;
+connection conn1;
ERROR 70100: Query execution was interrupted
+connection default;
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
drop procedure if exists update_t1;
drop table if exists t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug38231.result b/mysql-test/suite/innodb/r/innodb_bug38231.result
index 195775f74c8..0ecdc13b048 100644
--- a/mysql-test/suite/innodb/r/innodb_bug38231.result
+++ b/mysql-test/suite/innodb/r/innodb_bug38231.result
@@ -1 +1,2 @@
SET storage_engine=InnoDB;
+connection default;
diff --git a/mysql-test/suite/innodb/r/innodb_bug42419.result b/mysql-test/suite/innodb/r/innodb_bug42419.result
index f304bb634cb..cf10ef3e12a 100644
--- a/mysql-test/suite/innodb/r/innodb_bug42419.result
+++ b/mysql-test/suite/innodb/r/innodb_bug42419.result
@@ -1,3 +1,4 @@
+connection default;
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3);
COMMIT;
@@ -5,13 +6,18 @@ SET AUTOCOMMIT = 0;
CREATE TEMPORARY TABLE t1_tmp ( b INT );
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 3;
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 2;
+connect user2,localhost,root,,,$MASTER_MYPORT,$MASTER_MYSOCK;
SET AUTOCOMMIT = 0;
CREATE TEMPORARY TABLE t2_tmp ( a int, new_a int );
INSERT INTO t2_tmp VALUES (1,51),(2,52),(3,53);
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 1;
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 2;
+connection default;
INSERT INTO t1_tmp (b) SELECT b FROM t1 WHERE a = 1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+connection user2;
Reap the server message for connection user2 UPDATE t1 ...
UPDATE t1 SET a = (SELECT new_a FROM t2_tmp WHERE t2_tmp.a = t1.a) WHERE a = 3;
+connection default;
+disconnect user2;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug47622.result b/mysql-test/suite/innodb/r/innodb_bug47622.result
index f5d13711c52..e520d1491ed 100644
--- a/mysql-test/suite/innodb/r/innodb_bug47622.result
+++ b/mysql-test/suite/innodb/r/innodb_bug47622.result
@@ -1,3 +1,5 @@
+connect a,localhost,root,,;
+connect b,localhost,root,,;
CREATE TABLE bug47622(
`rule_key` int(11) NOT NULL DEFAULT '0',
`seq` smallint(6) NOT NULL DEFAULT '0',
@@ -6,8 +8,10 @@ CREATE TABLE bug47622(
`else_ind` TINYINT NOT NULL,
KEY IDX_A (`arg_id`)
) ENGINE=InnoDB;
+connection a;
ALTER TABLE bug47622 ADD UNIQUE IDX_B (rule_key,else_ind,seq,action,arg_id);
drop index IDX_B on bug47622;
+connection b;
create index idx on bug47622(seq, arg_id);
ALTER TABLE bug47622 ADD UNIQUE IDX_X (rule_key,else_ind,seq,action);
drop table bug47622;
diff --git a/mysql-test/suite/innodb/r/innodb_bug49164.result b/mysql-test/suite/innodb/r/innodb_bug49164.result
index 9456702e1d0..857cd2851f2 100644
--- a/mysql-test/suite/innodb/r/innodb_bug49164.result
+++ b/mysql-test/suite/innodb/r/innodb_bug49164.result
@@ -1,3 +1,6 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
SET tx_isolation = 'READ-COMMITTED';
CREATE TABLE bug49164 (a INT, b BIGINT, c TINYINT, PRIMARY KEY (a, b))
ENGINE=InnoDB;
@@ -17,6 +20,7 @@ a b c
3 3 3
begin;
update bug49164 set c=7;
+connection con2;
SET tx_isolation = 'READ-COMMITTED';
begin;
select * from bug49164;
@@ -27,16 +31,22 @@ a b c
commit;
begin;
update bug49164 set c=6 where a=1 and b=1;
+connection con1;
rollback;
select * from bug49164;
a b c
1 1 1
2 2 2
3 3 3
+connection con2;
commit;
+connection con1;
select * from bug49164;
a b c
1 1 6
2 2 2
3 3 3
+connection default;
+disconnect con1;
+disconnect con2;
drop table bug49164;
diff --git a/mysql-test/suite/innodb/r/innodb_bug51920.result b/mysql-test/suite/innodb/r/innodb_bug51920.result
index 7ded141c239..ddb9e29fab2 100644
--- a/mysql-test/suite/innodb/r/innodb_bug51920.result
+++ b/mysql-test/suite/innodb/r/innodb_bug51920.result
@@ -4,10 +4,16 @@ BEGIN;
SELECT * FROM bug51920 FOR UPDATE;
i
1
+connect con1,localhost,root,,;
+connection con1;
UPDATE bug51920 SET i=2;
+connection default;
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE INFO="UPDATE bug51920 SET i=2"
INTO @thread_id;
KILL @thread_id;
+connection con1;
Got one of the listed errors
+connection default;
DROP TABLE bug51920;
+disconnect con1;
diff --git a/mysql-test/suite/innodb/r/innodb_bug52663.result b/mysql-test/suite/innodb/r/innodb_bug52663.result
index 89add18617b..348a7b21022 100644
--- a/mysql-test/suite/innodb/r/innodb_bug52663.result
+++ b/mysql-test/suite/innodb/r/innodb_bug52663.result
@@ -3,23 +3,30 @@ create table innodb_bug52663 (what varchar(5), id integer, count integer, primar
(what, id)) engine=innodb;
insert into innodb_bug52663 values ('total', 0, 0);
begin;
+connect addconroot, localhost, root,,;
+connection addconroot;
set session transaction isolation level read committed;
begin;
+connection default;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
select * from innodb_bug52663;
what id count
total 0 1
+connection addconroot;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from innodb_bug52663;
what id count
total 0 0
+connection default;
commit;
+connection addconroot;
update innodb_bug52663 set count = count + 1 where what = 'total' and id = 0;
commit;
select * from innodb_bug52663;
what id count
total 0 2
+connection default;
select * from innodb_bug52663;
what id count
total 0 2
diff --git a/mysql-test/suite/innodb/r/innodb_bug53756.result b/mysql-test/suite/innodb/r/innodb_bug53756.result
index 2a2a30e2482..6b44479677f 100644
--- a/mysql-test/suite/innodb/r/innodb_bug53756.result
+++ b/mysql-test/suite/innodb/r/innodb_bug53756.result
@@ -19,75 +19,64 @@ pk c1
2 22
3 33
4 44
-
-# connection con1 deletes row 1
+connect con1,localhost,root,,;
START TRANSACTION;
SELECT @@tx_isolation;
@@tx_isolation
READ-COMMITTED
DELETE FROM bug_53756 WHERE pk=1;
-
-# connection con2 deletes row 2
+connect con2,localhost,root,,;
START TRANSACTION;
SELECT @@tx_isolation;
@@tx_isolation
READ-COMMITTED
DELETE FROM bug_53756 WHERE pk=2;
-
-# connection con3 updates row 3
+connect con3,localhost,root,,;
START TRANSACTION;
SELECT @@tx_isolation;
@@tx_isolation
READ-COMMITTED
UPDATE bug_53756 SET c1=77 WHERE pk=3;
-
-# connection con4 updates row 4
+connect con4,localhost,root,,;
START TRANSACTION;
SELECT @@tx_isolation;
@@tx_isolation
READ-COMMITTED
UPDATE bug_53756 SET c1=88 WHERE pk=4;
-
-# connection con5 inserts row 5
+connect con5,localhost,root,,;
START TRANSACTION;
SELECT @@tx_isolation;
@@tx_isolation
READ-COMMITTED
INSERT INTO bug_53756 VALUES(5, 55);
-
-# connection con6 inserts row 6
+connect con6,localhost,root,,;
START TRANSACTION;
SELECT @@tx_isolation;
@@tx_isolation
READ-COMMITTED
INSERT INTO bug_53756 VALUES(6, 66);
-
-# connection con1 commits.
+connection con1;
COMMIT;
-
-# connection con3 commits.
+connection con3;
COMMIT;
-
-# connection con4 rolls back.
+connection con4;
ROLLBACK;
-
-# connection con6 rolls back.
+connection con6;
ROLLBACK;
# The connections 2 and 5 stay open.
-# connection default selects resulting data.
# Delete of row 1 was committed.
# Update of row 3 was committed.
# Due to isolation level read committed, these should be included.
# All other changes should not be included.
+connection default;
SELECT * FROM bug_53756;
pk c1
2 22
3 77
4 44
-
-# connection default
+connection default;
#
# Crash server.
START TRANSACTION;
@@ -96,8 +85,12 @@ SET SESSION debug_dbug="+d,crash_commit_before";
COMMIT;
ERROR HY000: Lost connection to MySQL server during query
-#
-# disconnect con1, con2, con3, con4, con5, con6.
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
+disconnect con5;
+disconnect con6;
#
# Restart server.
diff --git a/mysql-test/suite/innodb/r/innodb_bug59641.result b/mysql-test/suite/innodb/r/innodb_bug59641.result
index 9c5d363e5fe..f22d39654de 100644
--- a/mysql-test/suite/innodb/r/innodb_bug59641.result
+++ b/mysql-test/suite/innodb/r/innodb_bug59641.result
@@ -7,15 +7,21 @@ XA START '123';
INSERT INTO t VALUES(1,1);
XA END '123';
XA PREPARE '123';
+CONNECT con1,localhost,root,,;
+connection con1;
XA START '456';
INSERT INTO t VALUES(3,47),(5,67);
UPDATE t SET b=2*b WHERE a BETWEEN 5 AND 8;
XA END '456';
XA PREPARE '456';
+CONNECT con2,localhost,root,,;
+connection con2;
XA START '789';
UPDATE t SET b=4*a WHERE a=32;
XA END '789';
XA PREPARE '789';
+CONNECT con3,localhost,root,,;
+connection con3;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
a b
diff --git a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
index d3ad9cc9065..ff32bf694cb 100644
--- a/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
+++ b/mysql-test/suite/innodb/r/innodb_defrag_concurrent.result
@@ -4,6 +4,11 @@ select @@global.innodb_stats_persistent;
0
set global innodb_defragment_stats_accuracy = 80;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARCHAR(256), c INT, KEY second(a, b),KEY third(c)) ENGINE=INNODB;
+connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con2,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con3,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect con4,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection default;
SET @@global.innodb_defragment_n_pages = 20;
select count(*) from t1;
count(*)
@@ -32,11 +37,25 @@ count(stat_value) > 0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
+connection con1;
optimize table t1;;
+connection default;
INSERT INTO t1 VALUES (400000, REPEAT('A', 256),300000);;
+connection con2;
INSERT INTO t1 VALUES (500000, REPEAT('A', 256),400000);;
+connection con3;
DELETE FROM t1 where a between 1 and 100;;
+connection con4;
UPDATE t1 SET c = c + 1 where c between 2000 and 8000;;
+connection con1;
+connection con2;
+connection con3;
+connection con4;
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
+disconnect con4;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
diff --git a/mysql-test/suite/innodb/r/innodb_defragment.result b/mysql-test/suite/innodb/r/innodb_defragment.result
index 5f3fd523946..c42cbd972f8 100644
--- a/mysql-test/suite/innodb/r/innodb_defragment.result
+++ b/mysql-test/suite/innodb/r/innodb_defragment.result
@@ -31,7 +31,13 @@ count(stat_value)
select count(*) from t1;
count(*)
10004
+connect con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection con1;
call defragment();
+connection default;
+connection con1;
+connection default;
+disconnect con1;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
diff --git a/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
index 26ed20ca730..3a17d4a273b 100644
--- a/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
+++ b/mysql-test/suite/innodb/r/innodb_lock_wait_timeout_1.result
@@ -13,6 +13,8 @@ BEGIN;
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
b
7
+CONNECT addconroot, localhost, root,,;
+connection addconroot;
BEGIN;
SELECT b FROM t2 WHERE b=7 FOR UPDATE;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -25,6 +27,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1;
a b
1070109 99
+connection default;
+disconnect addconroot;
DROP TABLE t2, t1;
# End of 5.0 tests
#
@@ -40,10 +44,14 @@ begin;
select * from t1 where b=5 for update;
a b
5 5
+connect con1, localhost, root,,;
+connection con1;
insert ignore into t1 (b) select a as b from t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
# Cleanup
#
+disconnect con1;
commit;
set autocommit=default;
drop table t1;
@@ -51,19 +59,27 @@ drop table t1;
# Bug #37183 insert ignore into .. select ... hangs
# after deadlock was encountered
#
+connect con1,localhost,root,,;
create table t1(id int primary key,v int)engine=innodb;
insert into t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
create table t2 like t1;
+connection con1;
begin;
update t1 set v=id*2 where id=1;
+connection default;
begin;
update t1 set v=id*2 where id=2;
+connection con1;
update t1 set v=id*2 where id=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
insert ignore into t2 select * from t1 where id=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
+connection con1;
rollback;
+connection default;
+disconnect con1;
drop table t1, t2;
#
# Bug#41756 Strange error messages about locks from InnoDB
@@ -162,8 +178,8 @@ begin;
select 1 from t1 natural join (select 2 as a, 1 as b union all
select 2 as a, 2 as b) as t2 for update;
1
-#
-# Switching to connection con1
+connect con1,localhost,root,,;
+connection con1;
# We should be able to delete all records from t1 except (2, null),
# since they were not locked.
begin;
@@ -184,8 +200,7 @@ delete from t1 where a in (19,20);
delete from t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
-#
-# Switching to connection default
+connection default;
#
# Show that the original contents of t1 is intact:
select * from t1;
@@ -247,8 +262,7 @@ a b
18 1
19 1
20 1
-#
-# Switching to connection con1
+connection con1;
begin;
# Since there is another distinct record in the derived table
# the previous matching record in t1 -- (2,null) -- was unlocked.
@@ -278,8 +292,7 @@ a b
19 1
20 1
commit;
-#
-# Switching to connection default
+connection default;
rollback;
begin;
#
@@ -339,15 +352,16 @@ select 1 from t1 natural join (select 3 as a, 2 as b union all
select 3 as a, 1 as b) as t2 for update;
1
1
-# Switching to connection con1
+connection con1;
#
# We should not be able to delete record (3,1) from t1,
# (previously it was possible).
#
delete from t1 where a=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Switching to connection default
+connection default;
commit;
+disconnect con1;
set @@session.tx_isolation=default;
drop table t1;
#
diff --git a/mysql-test/suite/innodb/r/innodb_mutexes.result b/mysql-test/suite/innodb/r/innodb_mutexes.result
index 129d7f0762b..ff7bfa6f32a 100644
--- a/mysql-test/suite/innodb/r/innodb_mutexes.result
+++ b/mysql-test/suite/innodb/r/innodb_mutexes.result
@@ -1,3 +1,6 @@
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
create table t1(a int not null primary key, b int, c int,d CHAR(100)) engine=innodb;
create procedure innodb_insert_proc (repeat_count int)
begin
@@ -13,9 +16,20 @@ set autocommit=0;
call innodb_insert_proc(20000);
commit;
set autocommit=1;
+connection con1;
delete from t1 where a between 1000 and 1300;
+connection con2;
update t1 set b=b+1 where a between 2000 and 2600;
+connection con3;
insert into t1 select a+30000,b,c,d from t1 where a between 3000 and 4000;
+connection default;
delete from t1 where a between 6000 and 7000;
+connection con1;
+connection con2;
+connection con3;
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
drop procedure innodb_insert_proc;
drop table t1;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result
index 61eec8d4155..1f40887b9fc 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql.result
@@ -109,12 +109,19 @@ id1
2
DROP TABLE t1, t2;
create table t1 (c1 int) engine=innodb;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con2;
handler t1 open;
handler t1 read first;
c1
+disconnect con2;
+connection con1;
Before and after comparison
0
+connection default;
drop table t1;
+disconnect con1;
CREATE TABLE t1(c1 TEXT, UNIQUE (c1(1)), cnt INT DEFAULT 1)
ENGINE=INNODB CHARACTER SET UTF8;
INSERT INTO t1 (c1) VALUES ('1a');
@@ -399,12 +406,16 @@ innodb_rollback_on_timeout OFF
create table t1 (a int unsigned not null primary key) engine = innodb;
insert into t1 values (1);
commit;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con2;
begin work;
insert into t1 values (2);
select * from t1;
a
1
2
+connection con1;
begin work;
insert into t1 values (5);
select * from t1;
@@ -418,21 +429,27 @@ a
1
5
commit;
+connection con2;
select * from t1;
a
1
2
commit;
+connection default;
select * from t1;
a
1
2
5
drop table t1;
+disconnect con1;
+disconnect con2;
set @save_qcache_size=@@global.query_cache_size;
set @save_qcache_type=@@global.query_cache_type;
set global query_cache_size=10*1024*1024;
set global query_cache_type=1;
+connect con1,localhost,root,,;
+connection con1;
drop table if exists `test`;
Warnings:
Note 1051 Unknown table 'test.test'
@@ -440,6 +457,9 @@ CREATE TABLE `test` (`test1` varchar(3) NOT NULL,
`test2` varchar(4) NOT NULL,PRIMARY KEY (`test1`))
ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `test` (`test1`, `test2`) VALUES ('tes', '5678');
+disconnect con1;
+connect con2,localhost,root,,;
+connection con2;
select * from test;
test1 test2
tes 5678
@@ -452,6 +472,8 @@ flush tables;
select * from test;
test1 test2
tes 1234
+disconnect con2;
+connection default;
drop table test;
set global query_cache_type=@save_qcache_type;
set global query_cache_size=@save_qcache_size;
@@ -462,12 +484,16 @@ innodb_rollback_on_timeout OFF
create table t1 (a int unsigned not null primary key) engine = innodb;
insert into t1 values (1);
commit;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con2;
begin work;
insert into t1 values (2);
select * from t1;
a
1
2
+connection con1;
begin work;
insert into t1 values (5);
select * from t1;
@@ -481,17 +507,21 @@ a
1
5
commit;
+connection con2;
select * from t1;
a
1
2
commit;
+connection default;
select * from t1;
a
1
2
5
drop table t1;
+disconnect con1;
+disconnect con2;
create table t1(
id int auto_increment,
c char(1) not null,
@@ -637,18 +667,22 @@ Warnings:
Warning 1932 Table 'test.bug29807' doesn't exist in engine
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
-switch to connection c1
+CONNECT c1,localhost,root,,;
+CONNECT c2,localhost,root,,;
+connection c1;
SET AUTOCOMMIT=0;
INSERT INTO t2 VALUES (1);
-switch to connection c2
+connection c2;
SET AUTOCOMMIT=0;
LOCK TABLES t1 READ, t2 READ;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-switch to connection c1
+connection c1;
COMMIT;
INSERT INTO t1 VALUES (1);
-switch to connection default
+connection default;
SET AUTOCOMMIT=default;
+disconnect c1;
+disconnect c2;
DROP TABLE t1,t2;
CREATE TABLE t1 (
id int NOT NULL auto_increment PRIMARY KEY,
@@ -790,12 +824,16 @@ innodb_rollback_on_timeout OFF
create table t1 (a int unsigned not null primary key) engine = innodb;
insert into t1 values (1);
commit;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con2;
begin work;
insert into t1 values (2);
select * from t1;
a
1
2
+connection con1;
begin work;
insert into t1 values (5);
select * from t1;
@@ -809,17 +847,21 @@ a
1
5
commit;
+connection con2;
select * from t1;
a
1
2
commit;
+connection default;
select * from t1;
a
1
2
5
drop table t1;
+disconnect con1;
+disconnect con2;
drop table if exists t1;
create table t1 (a int) engine=innodb;
alter table t1 alter a set default 1;
@@ -1117,9 +1159,19 @@ SELECT COUNT(*) INTO cnt FROM t1 LOCK IN SHARE MODE;
END WHILE;
COMMIT;
END;|
+CONNECT con1,localhost,root,,;
+CONNECT con2,localhost,root,,;
+connection con1;
CALL p1();
+connection con2;
CALL p1();
+connection default;
CALL p1();
+connection con1;
+connection con2;
+connection default;
+disconnect con1;
+disconnect con2;
DROP PROCEDURE p1;
DROP TABLE t1;
create table t1(a text) engine=innodb default charset=utf8;
@@ -1144,12 +1196,15 @@ START TRANSACTION;
SELECT * FROM t1 WHERE b=20 FOR UPDATE;
a b
2 20
+connect conn2, localhost, root,,test;
START TRANSACTION;
SELECT * FROM t1 WHERE b=10 ORDER BY A FOR UPDATE;
a b
1 10
2 10
ROLLBACK;
+disconnect conn2;
+connection default;
ROLLBACK;
DROP TABLE t1;
CREATE TABLE t1(
@@ -1574,10 +1629,12 @@ select if(@a=@b,"ok","wrong");
if(@a=@b,"ok","wrong")
ok
drop table t1;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
set binlog_format=mixed;
-# Switch to connection con1
+connection con1;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(256))
ENGINE = InnoDB;
INSERT INTO t1 VALUES (1,2);
@@ -1589,17 +1646,17 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
1 12
-# Switch to connection con2
+connection con2;
UPDATE t1 SET b = 21 WHERE a = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a b
1 12
ROLLBACK;
-# Switch to connection con2
+connection con2;
ROLLBACK;
-# Switch to connection con1
+connection con1;
# 2. test for serialized update:
CREATE TABLE t2 (a INT);
TRUNCATE t1;
@@ -1626,9 +1683,9 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
1 init+con1
-# Switch to connection con2
+connection con2;
CALL p1;;
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a b
1 init+con1
@@ -1636,12 +1693,12 @@ COMMIT;
SELECT * FROM t1;
a b
1 init+con1
-# Switch to connection con2
+connection con2;
SELECT * FROM t1;
a b
1 init+con1+con2
COMMIT;
-# Switch to connection con1
+connection con1;
# 3. test for updated key column:
TRUNCATE t1;
TRUNCATE t2;
@@ -1653,9 +1710,9 @@ info: Rows matched: 1 Changed: 1 Warnings: 0
SELECT * FROM t1;
a b
2 init+con1
-# Switch to connection con2
+connection con2;
CALL p1;;
-# Switch to connection con1
+connection con1;
SELECT * FROM t1;
a b
2 init+con1
@@ -1663,10 +1720,13 @@ COMMIT;
SELECT * FROM t1;
a b
2 init+con1
-# Switch to connection con2
+connection con2;
SELECT * FROM t1;
a b
2 init+con1
+connection default;
+disconnect con1;
+disconnect con2;
DROP PROCEDURE p1;
DROP TABLE t1, t2;
CREATE TABLE t1 (a INT NOT NULL, b INT NOT NULL, PRIMARY KEY (a,b)) engine=innodb;
@@ -1826,21 +1886,21 @@ a
1
2
3
-# Connection con1
+connect con1, localhost, root,,;
TRUNCATE TABLE t1;;
-# Connection default
+connection default;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
ROLLBACK;
-# Connection con1
+connection con1;
# Reaping TRUNCATE TABLE
SELECT * FROM t1;
a
-# Disconnect con1
-# Connection default
+disconnect con1;
+connection default;
DROP TABLE t1;
drop table if exists t1, t2, t3;
#
@@ -2370,6 +2430,8 @@ INSERT INTO t1 VALUES (),();
INSERT INTO t2 VALUES (),();
CREATE OR REPLACE VIEW v1 AS SELECT 1 FROM t2
WHERE b =(SELECT a FROM t1 LIMIT 1);
+CONNECT con1, localhost, root,,;
+connection default;
CREATE PROCEDURE p1(num INT)
BEGIN
DECLARE i INT DEFAULT 0;
@@ -2380,6 +2442,7 @@ UNTIL i>num END REPEAT;
END|
# Should not crash
# Should not crash
+disconnect con1;
DROP PROCEDURE p1;
DROP VIEW v1;
DROP TABLE t1,t2;
@@ -2774,19 +2837,18 @@ CREATE TABLE t1(x INT PRIMARY KEY, y INT) ENGINE=innodb;
INSERT INTO t1 VALUES (1, 0), (2, 0);
CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA
RETURN (SELECT x FROM t1 WHERE x = z);
-# Connection default
START TRANSACTION;
SELECT f1(1);
f1(1)
1
-# Connection con2
START TRANSACTION;
SELECT f1(1);
f1(1)
1
UPDATE t1 SET y = 1 WHERE x = 1;
COMMIT;
-# Connection default
+disconnect con2;
+connection default;
COMMIT;
DROP TABLE t1;
DROP FUNCTION f1;
diff --git a/mysql-test/suite/innodb/r/innodb_mysql_rbk.result b/mysql-test/suite/innodb/r/innodb_mysql_rbk.result
index 21ac4295325..64f508a501c 100644
--- a/mysql-test/suite/innodb/r/innodb_mysql_rbk.result
+++ b/mysql-test/suite/innodb/r/innodb_mysql_rbk.result
@@ -1,21 +1,30 @@
CREATE TABLE t1(a INT, b INT NOT NULL, PRIMARY KEY (a)) ENGINE=innodb
DEFAULT CHARSET=latin1;
INSERT INTO t1 VALUES (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7);
+CONNECT con1,localhost,root,,;
+CONNECT con2,localhost,root,,;
+connection con1;
START TRANSACTION;
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
a b
3 3
+connection con2;
START TRANSACTION;
UPDATE t1 SET b=b+12 WHERE a > 2 ORDER BY a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ROLLBACK;
+connection con1;
START TRANSACTION;
SELECT * FROM t1 WHERE b=3 LIMIT 1 FOR UPDATE;
a b
3 3
+connection con2;
START TRANSACTION;
UPDATE t1 SET b=10 WHERE a > 1 ORDER BY a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 WHERE b = 10;
a b
+connection default;
+disconnect con1;
+disconnect con2;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/r/innodb_notembedded.result b/mysql-test/suite/innodb/r/innodb_notembedded.result
index af332aba38a..b8ff28a10b5 100644
--- a/mysql-test/suite/innodb/r/innodb_notembedded.result
+++ b/mysql-test/suite/innodb/r/innodb_notembedded.result
@@ -1,5 +1,7 @@
drop table if exists t1;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
+connect a,localhost,root,,;
+connect b,localhost,root,,;
SET GLOBAL log_bin_trust_function_creators = 1;
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100);
@@ -12,12 +14,21 @@ start transaction;
select f1();
f1()
100
+connection b;
update t1 set col2=0 where col1=1;
+connection default;
select * from t1;
col1 col2
1 100
+connection a;
rollback;
+connection b;
rollback;
+connection a;
+disconnect a;
+connection b;
+disconnect b;
+connection default;
drop table t1;
drop function f1;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
diff --git a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
index e1f6f8608e1..cf5d77a679c 100644
--- a/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
+++ b/mysql-test/suite/innodb/r/innodb_prefix_index_restart_server.result
@@ -11,7 +11,7 @@ SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
1 1
-"In connection 1"
+connect con1,localhost,root,,;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
@@ -19,10 +19,10 @@ col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
-"In connection 2"
+connect con2,localhost,root,,;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
-"In connection 1"
+connection con1;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
@@ -31,7 +31,7 @@ SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
START TRANSACTION;
-"In connection default ....restarting the server"
+connection default;
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
@@ -39,7 +39,9 @@ SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
1 1
-"In connection 1"
+disconnect con1;
+disconnect con2;
+connect con1,localhost,root,,;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
@@ -54,7 +56,7 @@ SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
1 1
-"In connection default ....restarting the server"
+connection default;
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
@@ -62,7 +64,8 @@ SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
1 1
-"In connection 1"
+disconnect con1;
+connect con2,localhost,root,,;
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("a", 3500) col_2_text = REPEAT("o", 3500)
@@ -76,7 +79,7 @@ SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
col_1_text = REPEAT("b", 3500) col_2_text = REPEAT("o", 3500)
1 1
-"In connection default ....restarting the server"
+connection default;
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
diff --git a/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result b/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result
index 13cc45e0ef9..b8f312ccd63 100644
--- a/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result
+++ b/mysql-test/suite/innodb/r/innodb_stats_drop_locked.result
@@ -17,6 +17,8 @@ innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
innodb_stats_drop_locked
+connect con1,localhost,root,,;
+connection con1;
ALTER TABLE innodb_stats_drop_locked DROP INDEX c_key;
Warnings:
Warning 1205 Unable to delete statistics for index c_key from mysql.innodb_index_stats because the rows are locked: Lock wait timeout. They can be deleted later using DELETE FROM mysql.innodb_index_stats WHERE database_name = 'test' AND table_name = 'innodb_stats_drop_locked' AND index_name = 'c_key';
@@ -28,6 +30,8 @@ innodb_stats_drop_locked CREATE TABLE `innodb_stats_drop_locked` (
DROP TABLE innodb_stats_drop_locked;
SHOW TABLES;
Tables_in_test
+connection default;
+disconnect con1;
COMMIT;
SELECT table_name FROM mysql.innodb_table_stats
WHERE table_name='innodb_stats_drop_locked';
diff --git a/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result b/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
index 4164e043b2c..5f14ad9b0d7 100644
--- a/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
+++ b/mysql-test/suite/innodb/r/innodb_sys_semaphore_waits.result
@@ -1,7 +1,7 @@
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
drop table if exists t1;
-# Switch to connection con1
+connection con1;
create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
set DEBUG_DBUG='+d,fatal-semaphore-timeout';
@@ -9,13 +9,13 @@ set autocommit=0;
# Sending query on con1,
# the session will hold lock table mutex and sleep
SELECT * from t1 where id = 0 FOR UPDATE;
-# Switch to connection con2
+connection con2;
set autocommit=0;
# Sending query on con2,
# the session will be blocked on the lock table mutex and
# thus be put into sync arry
SELECT * from t1 where id = 0 FOR UPDATE;
-# Switched to the default connection
+connection default;
# Waitting for mysqld to crash
# Mysqld crash was detected
# Waitting for reconnect after mysqld restarts
diff --git a/mysql-test/suite/innodb/r/innodb_timeout_rollback.result b/mysql-test/suite/innodb/r/innodb_timeout_rollback.result
index e2da6ba8af7..30db5a21a4d 100644
--- a/mysql-test/suite/innodb/r/innodb_timeout_rollback.result
+++ b/mysql-test/suite/innodb/r/innodb_timeout_rollback.result
@@ -5,12 +5,16 @@ innodb_rollback_on_timeout ON
create table t1 (a int unsigned not null primary key) engine = innodb;
insert into t1 values (1);
commit;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con2;
begin work;
insert into t1 values (2);
select * from t1;
a
1
2
+connection con1;
begin work;
insert into t1 values (5);
select * from t1;
@@ -23,14 +27,18 @@ select * from t1;
a
1
commit;
+connection con2;
select * from t1;
a
1
2
commit;
+connection default;
select * from t1;
a
1
2
drop table t1;
+disconnect con1;
+disconnect con2;
End of 5.0 tests
diff --git a/mysql-test/suite/innodb/r/innodb_uninstall.result b/mysql-test/suite/innodb/r/innodb_uninstall.result
index b1f618c5221..f3b166c5736 100644
--- a/mysql-test/suite/innodb/r/innodb_uninstall.result
+++ b/mysql-test/suite/innodb/r/innodb_uninstall.result
@@ -2,15 +2,23 @@ install plugin innodb soname 'ha_innodb';
Warnings:
Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled
create table t1(a int not null primary key) engine=innodb;
+connect con1, localhost, root;
+connection con1;
begin;
insert into t1 values(1);
+connection default;
flush tables;
uninstall plugin innodb;
+connection con1;
select sleep(1);
sleep(1)
0
+disconnect con1;
+connection default;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
+connect con1, localhost, root;
+connection con1;
install plugin innodb soname 'ha_innodb';
Warnings:
Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled
@@ -18,9 +26,13 @@ drop table t1;
create table t2(a int not null primary key) engine=innodb;
insert into t2 values(1);
drop table t2;
+connection default;
uninstall plugin innodb;
+connection con1;
select sleep(1);
sleep(1)
0
+disconnect con1;
+connection default;
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
diff --git a/mysql-test/suite/innodb/r/mdev-117.result b/mysql-test/suite/innodb/r/mdev-117.result
index 40c63b5ae38..997470fea6f 100644
--- a/mysql-test/suite/innodb/r/mdev-117.result
+++ b/mysql-test/suite/innodb/r/mdev-117.result
@@ -1,12 +1,17 @@
SET GLOBAL innodb_lock_wait_timeout=3;
CREATE TABLE t1 (col_int_key INT, KEY (col_int_key)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (6);
+connect con1,localhost,root,,test;
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
SET AUTOCOMMIT=OFF;
SELECT col_int_key FROM t1;
col_int_key
6
+connection default;
DELETE IGNORE FROM t1;;
+connection con1;
DELETE FROM t1 WHERE col_int_key IN (1, 40000000);
+connection default;
+disconnect con1;
drop table t1;
SET GLOBAL innodb_lock_wait_timeout=default;
diff --git a/mysql-test/suite/innodb/r/row_lock.result b/mysql-test/suite/innodb/r/row_lock.result
index 7344927a587..7ea09fa3bad 100644
--- a/mysql-test/suite/innodb/r/row_lock.result
+++ b/mysql-test/suite/innodb/r/row_lock.result
@@ -4,10 +4,18 @@ CREATE TABLE t2 (c INT, d INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,1), (2,2);
CREATE TABLE t3 (e INT) ENGINE=InnoDB;
CREATE TABLE t4 ENGINE=InnoDB AS SELECT * FROM t2;
+connect con11,localhost,root,,test;
BEGIN;
UPDATE t1 SET a = 0 WHERE a = ( SELECT e FROM t3 );
+connect con12,localhost,root,,test;
UPDATE t4 SET d = 1 WHERE d in ( SELECT a FROM t1 ) ORDER BY c LIMIT 6;
+connection con11;
UPDATE t4 SET d = 9;
+connection con12;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
+connection con11;
commit;
+connection default;
+disconnect con12;
+disconnect con11;
drop table t1,t2,t3,t4;
diff --git a/mysql-test/suite/innodb/r/snapshot.result b/mysql-test/suite/innodb/r/snapshot.result
index dcb3d242fc2..fa4ec2bdc21 100644
--- a/mysql-test/suite/innodb/r/snapshot.result
+++ b/mysql-test/suite/innodb/r/snapshot.result
@@ -1,5 +1,7 @@
START TRANSACTION WITH CONSISTENT SNAPSHOT;
+connect con1,localhost,root,,test;
CREATE TABLE IF NOT EXISTS t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=InnoDB;
+connection default;
UPDATE t1 SET i = 0;
ERROR HY000: Table definition has changed, please retry transaction
UPDATE t1 SET pk = 0;
diff --git a/mysql-test/suite/innodb/r/tmpdir.result b/mysql-test/suite/innodb/r/tmpdir.result
index f9475c1b7f8..a277883a975 100644
--- a/mysql-test/suite/innodb/r/tmpdir.result
+++ b/mysql-test/suite/innodb/r/tmpdir.result
@@ -10,11 +10,13 @@ Variable_name Value
innodb_tmpdir
alter table t1 add column b int not null;
set global innodb_tmpdir=NULL;
-# Connection con1
+connect con1,localhost,root;
show session variables like 'innodb_tmpdir';
Variable_name Value
innodb_tmpdir
alter table t1 add key(b);
+connection default;
+disconnect con1;
drop table t1;
# innodb_tmpdir with invalid path.
create table t1(a int primary key)engine=innodb;
@@ -45,7 +47,9 @@ set global innodb_tmpdir = @tmpdir;
show session variables like 'innodb_tmpdir';
Variable_name Value
innodb_tmpdir
-# Connection con3
+connect con3,localhost,root;
alter table t1 add fulltext(b);
+disconnect con3;
+connection default;
set global innodb_tmpdir=NULL;
drop table t1;
diff --git a/mysql-test/suite/innodb/r/xa_recovery.result b/mysql-test/suite/innodb/r/xa_recovery.result
index 84cb37ef7c9..0ddfd9c3298 100644
--- a/mysql-test/suite/innodb/r/xa_recovery.result
+++ b/mysql-test/suite/innodb/r/xa_recovery.result
@@ -1,11 +1,17 @@
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
+connect con1,localhost,root;
XA START 'x';
UPDATE t1 set a=2;
XA END 'x';
XA PREPARE 'x';
+connection default;
call mtr.add_suppression("Found 1 prepared XA transactions");
+disconnect con1;
+connect con1,localhost,root;
SELECT * FROM t1 LOCK IN SHARE MODE;
+connection default;
+disconnect con1;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t1;
a
diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test
index abbff46075a..798a4ecbff7 100644
--- a/mysql-test/suite/innodb/t/auto_increment_dup.test
+++ b/mysql-test/suite/innodb/t/auto_increment_dup.test
@@ -23,16 +23,10 @@ CREATE TABLE t1(
--connection con1
---echo #
---echo # Connection 1
---echo #
SET DEBUG_SYNC='ha_write_row_end SIGNAL continue2 WAIT_FOR continue1';
--send INSERT INTO t1(k) VALUES (1), (2), (3) ON DUPLICATE KEY UPDATE c='1'
--connection con2
---echo #
---echo # Connection 2
---echo #
SET DEBUG_SYNC='ha_write_row_start WAIT_FOR continue2';
SET DEBUG_SYNC='after_mysql_insert SIGNAL continue1';
INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2';
diff --git a/mysql-test/suite/innodb/t/binlog_consistent.test b/mysql-test/suite/innodb/t/binlog_consistent.test
index 4ab2903e693..1c8198bb321 100644
--- a/mysql-test/suite/innodb/t/binlog_consistent.test
+++ b/mysql-test/suite/innodb/t/binlog_consistent.test
@@ -14,7 +14,6 @@ connect(con3,localhost,root,,);
connect(con4,localhost,root,,);
connection default;
---echo # Connection default
CREATE TABLE t1 (a INT, b VARCHAR(100), PRIMARY KEY (a,b)) ENGINE=innodb;
let pos=`select $binlog_start_pos + 238`;
@@ -26,12 +25,10 @@ BEGIN;
INSERT INTO t1 VALUES (0, "");
connection con1;
---echo # Connection con1
BEGIN;
INSERT INTO t1 VALUES (1, "");
connection con2;
---echo # Connection con2
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=myisam;
BEGIN;
INSERT INTO t1 VALUES (2, "first");
@@ -39,26 +36,22 @@ INSERT INTO t2 VALUES (2);
INSERT INTO t1 VALUES (2, "second");
connection default;
---echo # Connection default
COMMIT;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection con3;
---echo # Connection con3
BEGIN;
INSERT INTO t1 VALUES (3, "");
INSERT INTO t2 VALUES (3);
connection con4;
---echo # Connection con4
BEGIN;
INSERT INTO t1 VALUES (4, "");
COMMIT;
connection default;
---echo # Connection default
SELECT * FROM t1 ORDER BY a,b;
let pos=`select $binlog_start_pos + 740`;
--replace_result $pos <pos>
@@ -69,21 +62,17 @@ SHOW MASTER STATUS;
SELECT * FROM t2 ORDER BY a;
connection con1;
---echo # Connection con1
COMMIT;
connection con2;
---echo # Connection con2
COMMIT;
connection con3;
---echo # Connection con3
COMMIT;
FLUSH LOGS;
--source include/wait_for_binlog_checkpoint.inc
connection default;
---echo # Connection default
SELECT * FROM t1 ORDER BY a,b;
let pos=`select $binlog_start_pos + 740`;
--replace_result $pos <pos>
diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-61209.test b/mysql-test/suite/innodb/t/innodb-autoinc-61209.test
index 2a981fe9d44..0b285fb2ebc 100644
--- a/mysql-test/suite/innodb/t/innodb-autoinc-61209.test
+++ b/mysql-test/suite/innodb/t/innodb-autoinc-61209.test
@@ -17,35 +17,23 @@ CREATE TABLE bug_61209 (a INT auto_increment, PRIMARY KEY(a)) ENGINE=InnoDB;
INSERT INTO bug_61209 VALUES (), (), (), ();
---echo
---echo # Connect con1
--connect (con1,localhost,root,,)
---echo
---echo # Connect con2
--connect (con2,localhost,root,,)
---echo
---echo # Connection con1
--connection con1
SET SESSION auto_increment_increment=3;
SET SESSION auto_increment_offset=2;
SELECT GET_LOCK('a', 9);
---echo
---echo # Connection con2
--connection con2
SET SESSION auto_increment_increment=3;
SET SESSION auto_increment_offset=2;
send INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10));
---echo
---echo # Connection con1 reap
--connection con1
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL);
SELECT RELEASE_LOCK('a');
---echo
---echo # Connection con2 reap
--connection con2
reap;
diff --git a/mysql-test/suite/innodb/t/innodb-lock.test b/mysql-test/suite/innodb/t/innodb-lock.test
index e3026ac505b..47246c53759 100644
--- a/mysql-test/suite/innodb/t/innodb-lock.test
+++ b/mysql-test/suite/innodb/t/innodb-lock.test
@@ -71,7 +71,6 @@ insert into t1 values(0, 0),(1,1),(2,2);
commit;
SELECT * from t1 where id = 0 FOR UPDATE;
---echo # Connection 'con2'.
connection con2;
set autocommit=0;
set @@innodb_table_locks=0;
@@ -82,7 +81,6 @@ set @@innodb_table_locks=0;
--echo # Sending:
--send lock table t1 write;
---echo # Connection 'con1'.
connection con1;
--echo # Wait until LOCK TABLE is blocked on SQL-level lock.
let $wait_condition=
@@ -96,18 +94,15 @@ select * from t1;
--echo # Unblock LOCK TABLE.
commit;
---echo # Connection 'con2'.
connection con2;
--echo # Reap LOCK TABLE.
--reap
unlock tables;
---echo # Connection 'con1'.
connection con1;
select * from t1 where id = 0 for update;
---echo # Connection 'con2'.
connection con2;
--echo # The below statement should not be blocked as LOCK TABLES ... READ
--echo # does not take strong SQL-level lock on t1. SELECTs which do not
@@ -120,7 +115,6 @@ unlock tables;
select * from t1;
commit;
---echo # Connection 'con1'.
connection con1;
commit;
diff --git a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
index 16fb570737d..8553d97bd9e 100644
--- a/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
+++ b/mysql-test/suite/innodb/t/innodb_blob_unrecoverable_crash.test
@@ -7,7 +7,6 @@ call mtr.add_suppression("InnoDB: The total blob data length");
let $old_max_allowed_packet = `select @@max_allowed_packet`;
SET GLOBAL max_allowed_packet = 100*1024*1024;
---echo # Connection big_packets:
connect(big_packets,localhost,root,,);
connection big_packets;
@@ -28,7 +27,6 @@ start transaction;
--error ER_TOO_BIG_ROWSIZE
INSERT INTO t1 (a, b) VALUES (6, REPEAT('a', 20*1024*1024));
---echo # Connection default:
connection default;
# We expect a restart.
@@ -41,7 +39,6 @@ connection default;
--enable_reconnect
--source include/wait_until_connected_again.inc
---echo # Connection default:
connection default;
# We should see (1,2,3,4,5) here.
diff --git a/mysql-test/suite/innodb/t/innodb_bug53756.test b/mysql-test/suite/innodb/t/innodb_bug53756.test
index c298c945434..4aee0f87746 100644
--- a/mysql-test/suite/innodb/t/innodb_bug53756.test
+++ b/mysql-test/suite/innodb/t/innodb_bug53756.test
@@ -47,65 +47,45 @@ START TRANSACTION;
SELECT @@tx_isolation;
SELECT * FROM bug_53756;
---echo
---echo # connection con1 deletes row 1
--connect (con1,localhost,root,,)
START TRANSACTION;
SELECT @@tx_isolation;
DELETE FROM bug_53756 WHERE pk=1;
---echo
---echo # connection con2 deletes row 2
--connect (con2,localhost,root,,)
START TRANSACTION;
SELECT @@tx_isolation;
DELETE FROM bug_53756 WHERE pk=2;
---echo
---echo # connection con3 updates row 3
--connect (con3,localhost,root,,)
START TRANSACTION;
SELECT @@tx_isolation;
UPDATE bug_53756 SET c1=77 WHERE pk=3;
---echo
---echo # connection con4 updates row 4
--connect (con4,localhost,root,,)
START TRANSACTION;
SELECT @@tx_isolation;
UPDATE bug_53756 SET c1=88 WHERE pk=4;
---echo
---echo # connection con5 inserts row 5
--connect (con5,localhost,root,,)
START TRANSACTION;
SELECT @@tx_isolation;
INSERT INTO bug_53756 VALUES(5, 55);
---echo
---echo # connection con6 inserts row 6
--connect (con6,localhost,root,,)
START TRANSACTION;
SELECT @@tx_isolation;
INSERT INTO bug_53756 VALUES(6, 66);
---echo
---echo # connection con1 commits.
--connection con1
COMMIT;
---echo
---echo # connection con3 commits.
--connection con3
COMMIT;
---echo
---echo # connection con4 rolls back.
--connection con4
ROLLBACK;
---echo
---echo # connection con6 rolls back.
--connection con6
ROLLBACK;
@@ -113,7 +93,6 @@ ROLLBACK;
--echo # The connections 2 and 5 stay open.
--echo
---echo # connection default selects resulting data.
--echo # Delete of row 1 was committed.
--echo # Update of row 3 was committed.
--echo # Due to isolation level read committed, these should be included.
@@ -121,8 +100,6 @@ ROLLBACK;
--connection default
SELECT * FROM bug_53756;
---echo
---echo # connection default
--connection default
--echo #
--echo # Crash server.
@@ -144,8 +121,6 @@ SET SESSION debug_dbug="+d,crash_commit_before";
--error 2013
COMMIT;
--echo
---echo #
---echo # disconnect con1, con2, con3, con4, con5, con6.
--disconnect con1
--disconnect con2
--disconnect con3
@@ -182,4 +157,3 @@ DROP TABLE bug_53756;
eval SET GLOBAL tx_isolation= '$global_isolation';
eval SET SESSION tx_isolation= '$session_isolation';
--enable_query_log
-
diff --git a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
index f6f65391b82..3968321d7d5 100644
--- a/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
+++ b/mysql-test/suite/innodb/t/innodb_lock_wait_timeout_1.test
@@ -166,8 +166,6 @@ begin;
select 1 from t1 natural join (select 2 as a, 1 as b union all
select 2 as a, 2 as b) as t2 for update;
connect (con1,localhost,root,,);
---echo #
---echo # Switching to connection con1
connection con1;
--echo # We should be able to delete all records from t1 except (2, null),
--echo # since they were not locked.
@@ -189,8 +187,6 @@ delete from t1 where a in (19,20);
--error ER_LOCK_WAIT_TIMEOUT
delete from t1;
rollback;
---echo #
---echo # Switching to connection default
connection default;
--echo #
--echo # Show that the original contents of t1 is intact:
@@ -211,8 +207,6 @@ delete t1.* from t1 natural join (select 2 as a, 2 as b union all
select 0 as a, 0 as b) as t2;
--echo # Demonstrate that nothing was deleted form t1
select * from t1;
---echo #
---echo # Switching to connection con1
connection con1;
begin;
--echo # Since there is another distinct record in the derived table
@@ -222,8 +216,6 @@ delete from t1;
rollback;
select * from t1;
commit;
---echo #
---echo # Switching to connection default
connection default;
rollback;
begin;
@@ -245,7 +237,6 @@ select 1 from t1 natural join (select 3 as a, 2 as b union all
--echo # Lock the record.
select 1 from t1 natural join (select 3 as a, 2 as b union all
select 3 as a, 1 as b) as t2 for update;
---echo # Switching to connection con1
connection con1;
--echo #
--echo # We should not be able to delete record (3,1) from t1,
@@ -253,7 +244,6 @@ connection con1;
--echo #
--error ER_LOCK_WAIT_TIMEOUT
delete from t1 where a=3;
---echo # Switching to connection default
connection default;
commit;
diff --git a/mysql-test/suite/innodb/t/innodb_mysql.test b/mysql-test/suite/innodb/t/innodb_mysql.test
index 7c2ae98f001..ee3975fd350 100644
--- a/mysql-test/suite/innodb/t/innodb_mysql.test
+++ b/mysql-test/suite/innodb/t/innodb_mysql.test
@@ -907,11 +907,9 @@ INSERT INTO t1 VALUES (1, 0), (2, 0);
CREATE FUNCTION f1(z INT) RETURNS INT READS SQL DATA
RETURN (SELECT x FROM t1 WHERE x = z);
---echo # Connection default
START TRANSACTION;
SELECT f1(1);
---echo # Connection con2
--disable_query_log
connect (con2, localhost, root);
--enable_query_log
@@ -924,7 +922,6 @@ COMMIT;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
COMMIT;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
index 21a5753e909..adae10df2ad 100644
--- a/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
+++ b/mysql-test/suite/innodb/t/innodb_prefix_index_restart_server.test
@@ -43,20 +43,17 @@ INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
---echo "In connection 2"
--connect (con2,localhost,root,,)
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 3500) , REPEAT("o", 3500));
---echo "In connection 1"
--connection con1
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
@@ -64,7 +61,6 @@ SELECT COUNT(*) FROM worklog5743;
START TRANSACTION;
---echo "In connection default ....restarting the server"
--connection default
# Restart the server
-- source include/restart_mysqld.inc
@@ -75,7 +71,6 @@ worklog5743;
--disconnect con1
--disconnect con2
---echo "In connection 1"
--connect (con1,localhost,root,,)
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
@@ -86,7 +81,6 @@ DELETE FROM worklog5743 WHERE col_1_text = REPEAT("b", 3500);
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
---echo "In connection default ....restarting the server"
--connection default
# Restart the server
-- source include/restart_mysqld.inc
@@ -96,7 +90,6 @@ worklog5743;
--disconnect con1
---echo "In connection 1"
--connect (con2,localhost,root,,)
SELECT col_1_text = REPEAT("a", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
@@ -106,7 +99,6 @@ UPDATE worklog5743 SET col_1_text = REPEAT("b", 3500) WHERE col_1_text = REPEAT(
SELECT col_1_text = REPEAT("b", 3500) , col_2_text = REPEAT("o", 3500) FROM
worklog5743;
---echo "In connection default ....restarting the server"
--connection default
# Restart the server
-- source include/restart_mysqld.inc
@@ -122,4 +114,3 @@ DROP TABLE worklog5743;
eval SET GLOBAL innodb_file_format=$innodb_file_format_orig;
eval SET GLOBAL innodb_file_per_table=$innodb_file_per_table_orig;
eval SET GLOBAL innodb_large_prefix=$innodb_large_prefix_orig;
-
diff --git a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
index 800199dbc54..53d43e6b711 100644
--- a/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
+++ b/mysql-test/suite/innodb/t/innodb_sys_semaphore_waits.test
@@ -5,16 +5,13 @@
# DEBUG_SYNC must be compiled in.
--source include/have_debug_sync.inc
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1;
--enable_warnings
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
@@ -33,7 +30,6 @@ SELECT * from t1 where id = 0 FOR UPDATE;
# To make sure con1 holding the lock table mutex and sleeping
--sleep 2
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -61,7 +57,6 @@ SELECT * from t1 where id = 0 FOR UPDATE;
# so mysqld will abort after 600 * 10 + 1 * 10 = 6010 seconds
# in debug mode and 600 + 1 * 10 = 610 seconds in release mode.
---echo # Switched to the default connection
connection default;
--disable_result_log
diff --git a/mysql-test/suite/innodb/t/tmpdir.test b/mysql-test/suite/innodb/t/tmpdir.test
index abe455adda5..98517a97c7a 100644
--- a/mysql-test/suite/innodb/t/tmpdir.test
+++ b/mysql-test/suite/innodb/t/tmpdir.test
@@ -18,7 +18,6 @@ create table t1(a int primary key)engine=innodb;
show session variables like 'innodb_tmpdir';
alter table t1 add column b int not null;
set global innodb_tmpdir=NULL;
---echo # Connection con1
connect (con1,localhost,root);
show session variables like 'innodb_tmpdir';
alter table t1 add key(b);
@@ -56,7 +55,6 @@ insert into t1 values('text1', 'text2');
set @tmpdir = @@global.tmpdir;
set global innodb_tmpdir = @tmpdir;
show session variables like 'innodb_tmpdir';
---echo # Connection con3
connect (con3,localhost,root);
# Following alter using innodb_tmpdir as a path to create temporary files
alter table t1 add fulltext(b);
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
index ea0ec381faa..b76b97d0ed5 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
@@ -113,6 +113,7 @@ SELECT * FROM articles_4 WHERE MATCH (title,body)
AGAINST ('this' IN NATURAL LANGUAGE MODE);
id title body
1 test for session stopwords this should also be excluded...
+connect con1,localhost,root,,;
CREATE TABLE articles_5 (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
@@ -125,6 +126,7 @@ SELECT * FROM articles_5 WHERE MATCH (title,body)
AGAINST ('session' IN NATURAL LANGUAGE MODE);
id title body
1 test for session stopwords this should also be excluded...
+connection default;
drop table articles;
drop table articles_2;
drop table articles_3;
@@ -563,7 +565,7 @@ select @@innodb_ft_enable_stopword;
0
ALTER TABLE articles DROP INDEX idx;
ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body);
-"In connection 1"
+connection con1;
select @@innodb_ft_enable_stopword;
@@innodb_ft_enable_stopword
1
@@ -629,7 +631,7 @@ SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOO
id title body
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE);
id title body
-"In connection default"
+connection default;
select @@innodb_ft_enable_stopword;
@@innodb_ft_enable_stopword
0
@@ -661,7 +663,7 @@ SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN M
id title body
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE);
id title body
-"In connection 1"
+connection con1;
SET SESSION innodb_ft_enable_stopword = 1;
create table user_stopword(value varchar(30)) engine = innodb;
set session innodb_ft_user_stopword_table = "test/user_stopword";
@@ -672,7 +674,7 @@ SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN
id title body
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will');
id title body
-"In connection default"
+connection default;
SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE);
id title body
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will');
@@ -698,7 +700,7 @@ SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE);
id title body
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('when');
id title body
-"In connection 1"
+connection con1;
SET SESSION innodb_ft_enable_stopword = 1;
SET SESSION innodb_ft_user_stopword_table=default;
select @@innodb_ft_user_stopword_table;
@@ -719,7 +721,8 @@ SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE);
id title body
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('the');
id title body
-"In connection default"
+disconnect con1;
+connection default;
SET SESSION innodb_ft_enable_stopword = 1;
SET SESSION innodb_ft_user_stopword_table=default;
select @@innodb_ft_server_stopword_table;
diff --git a/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result b/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
index 61a1b1bef53..6f5409f63cd 100644
--- a/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
+++ b/mysql-test/suite/innodb_fts/r/innodb_fts_transaction.result
@@ -316,7 +316,7 @@ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
b TEXT
) CHARACTER SET = UTF8,ENGINE = InnoDB;
-"In connection 1"
+connect con1,localhost,root,,;
SET NAMES UTF8;
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
@@ -325,12 +325,12 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит'),
('ΜποÏῶ νὰ φάω σπασμένα' ,'γυαλιὰ χωÏὶς νὰ πάθω τίποτα'),
('Sævör grét', 'áðan því úlpan var ónýt');
-"In connection 2"
+connect con2,localhost,root,,;
SET NAMES UTF8;
CREATE FULLTEXT INDEX idx on t1 (a,b);
Warnings:
Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
-"In connection 1"
+connection con1;
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('tutorial' IN NATURAL LANGUAGE MODE);
@@ -365,7 +365,7 @@ WHERE MATCH (a,b)
AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
id a b
6 Sævör grét áðan því úlpan var ónýt
-"In connection 2"
+connection con2;
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('+record +multiple' IN BOOLEAN MODE);
@@ -422,7 +422,7 @@ id a b
1 MySQL from Tutorial DBMS stands for DataBase ...
2 when To Use MySQL Well After that you went through a ...
3 where will Optimizing MySQL what In this tutorial we will show ...
-"In connection 1"
+connection con1;
COMMIT;
SELECT * FROM t1
WHERE MATCH (a,b)
@@ -443,7 +443,7 @@ INSERT INTO t1 (a,b) VALUES (NULL,NULL);
SELECT * FROM t1 WHERE a IS NULL AND b IS NULL;
id a b
11 NULL NULL
-"In connection 2"
+connection con2;
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('usin* multipl*' IN BOOLEAN MODE);
@@ -487,7 +487,7 @@ SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('request');
id a b
-"In connection 1"
+connection con1;
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('query performace' IN BOOLEAN MODE);
@@ -500,14 +500,14 @@ SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('+mail +MySQL' IN BOOLEAN MODE);
id a b
-"In connection 2"
+connection con2;
COMMIT;
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('+query +performace' IN BOOLEAN MODE);
id a b
9 TRIAL VERSION PŘÃLIÅ  ŽLUŤOUÄŒKà query performace 1255 minute on 2.1Hz Memory 2GB...
-"In connection 1"
+connection con1;
SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('+query +performace' IN BOOLEAN MODE);
@@ -521,6 +521,9 @@ AGAINST ('well free') ORDER BY 1;
id a b
2 when To Use MySQL Well After that you went through a ...
5 when To Use MySQL Well for free faq xyz.com ...
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
SET NAMES UTF8;
CREATE TABLE t1 (
@@ -528,7 +531,7 @@ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
b TEXT
) CHARACTER SET = UTF8,ENGINE = InnoDB;
-"In connection 1"
+connect con1,localhost,root,,;
SET NAMES UTF8;
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
@@ -537,7 +540,7 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит'),
('ΜποÏῶ νὰ φάω σπασμένα' ,'γυαλιὰ χωÏὶς νὰ πάθω τίποτα'),
('Sævör grét', 'áðan því úlpan var ónýt');
-"In connection 2"
+connect con2,localhost,root,,;
SET NAMES UTF8;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -548,7 +551,7 @@ Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
-"In connection 1"
+connection con1;
SELECT * FROM t1;
id a b
1 MySQL from Tutorial DBMS stands for DataBase ...
@@ -589,7 +592,7 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
5 ΜποÏῶ νὰ φάω σπασμένα γυαλιὰ χωÏὶς νὰ πάθω τίποτα
7 adding record using session 1 for verifying multiple concurrent transactions
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -610,7 +613,7 @@ id a b
6 Sævör grét áðan því úlpan var ónýt
7 adding record using session 1 for verifying multiple concurrent transactions
8 Мога да Ñм Ñтъкло то Mне ми вреди
-"In connection 1"
+connection con1;
COMMIT;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
@@ -620,7 +623,7 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
id a b
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -637,6 +640,9 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
5 ΜποÏῶ νὰ φάω σπασμένα γυαλιὰ χωÏὶς νὰ πάθω τίποτα
7 adding record using session 1 for verifying multiple concurrent transactions
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
SET NAMES UTF8;
CREATE TABLE t1 (
@@ -644,14 +650,14 @@ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
b TEXT
) CHARACTER SET = UTF8,ENGINE = InnoDB;
-"In connection 1"
+connect con1,localhost,root,,;
SET NAMES UTF8;
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
('where will Optimizing MySQL','what In this tutorial we will show ...'),
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит');
-"In connection 2"
+connect con2,localhost,root,,;
SET NAMES UTF8;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -662,7 +668,7 @@ Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
-"In connection 1"
+connection con1;
SELECT * FROM t1;
id a b
1 MySQL from Tutorial DBMS stands for DataBase ...
@@ -703,7 +709,7 @@ id a b
5 adding record using session 1 for verifying multiple concurrent transactions
6 Мога да Ñм Ñтъкло то Mне ми вреди
7 Sævör grét áðan því úlpan var ónýt
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -751,7 +757,7 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
5 adding record using session 1 for verifying multiple concurrent transactions
6 Мога да Ñм Ñтъкло то Mне ми вреди
-"In connection 1"
+connection con1;
COMMIT;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
@@ -761,7 +767,7 @@ id a b
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
id a b
7 Sævör grét áðan því úlpan var ónýt
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
6 Мога да Ñм Ñтъкло то Mне ми вреди
@@ -779,6 +785,9 @@ id a b
5 adding record using session 1 for verifying multiple concurrent transactions
6 Мога да Ñм Ñтъкло то Mне ми вреди
7 Sævör grét áðan því úlpan var ónýt
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
SET NAMES UTF8;
CREATE TABLE t1 (
@@ -786,7 +795,7 @@ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
b TEXT
) CHARACTER SET = UTF8,ENGINE = InnoDB;
-"In connection 1"
+connect con1,localhost,root,,;
SET NAMES UTF8;
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
@@ -795,7 +804,7 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит'),
('ΜποÏῶ νὰ φάω σπασμένα' ,'γυαλιὰ χωÏὶς νὰ πάθω τίποτα'),
('Sævör grét', 'áðan því úlpan var ónýt');
-"In connection 2"
+connect con2,localhost,root,,;
SET NAMES UTF8;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -806,7 +815,7 @@ Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
-"In connection 1"
+connection con1;
SELECT * FROM t1;
id a b
1 MySQL from Tutorial DBMS stands for DataBase ...
@@ -846,7 +855,7 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
5 ΜποÏῶ νὰ φάω σπασμένα γυαλιὰ χωÏὶς νὰ πάθω τίποτα
7 adding record using session 1 for verifying multiple concurrent transactions
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -867,7 +876,7 @@ id a b
6 Sævör grét áðan því úlpan var ónýt
7 adding record using session 1 for verifying multiple concurrent transactions
8 Мога да Ñм Ñтъкло то Mне ми вреди
-"In connection 1"
+connection con1;
ROLLBACK;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
@@ -879,7 +888,7 @@ id a b
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
id a b
6 Sævör grét áðan því úlpan var ónýt
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -900,6 +909,9 @@ id a b
6 Sævör grét áðan því úlpan var ónýt
7 adding record using session 1 for verifying multiple concurrent transactions
8 Мога да Ñм Ñтъкло то Mне ми вреди
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
SET NAMES UTF8;
CREATE TABLE t1 (
@@ -907,14 +919,14 @@ id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
a VARCHAR(200),
b TEXT
) CHARACTER SET = UTF8,ENGINE = InnoDB;
-"In connection 1"
+connect con1,localhost,root,,;
SET NAMES UTF8;
INSERT INTO t1 (a,b) VALUES
('MySQL from Tutorial','DBMS stands for DataBase ...') ,
('when To Use MySQL Well','After that you went through a ...'),
('where will Optimizing MySQL','what In this tutorial we will show ...'),
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит');
-"In connection 2"
+connect con2,localhost,root,,;
SET NAMES UTF8;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -925,7 +937,7 @@ Warning 124 InnoDB rebuilding table to add column FTS_DOC_ID
INSERT INTO t1 (a,b) VALUES
('adding record using session 1','for verifying multiple concurrent transactions'),
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
-"In connection 1"
+connection con1;
SELECT * FROM t1;
id a b
1 MySQL from Tutorial DBMS stands for DataBase ...
@@ -967,7 +979,7 @@ id a b
5 adding record using session 1 for verifying multiple concurrent transactions
6 Мога да Ñм Ñтъкло то Mне ми вреди
7 Sævör grét áðan því úlpan var ónýt
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -1016,7 +1028,7 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
5 adding record using session 1 for verifying multiple concurrent transactions
6 Мога да Ñм Ñтъкло то Mне ми вреди
-"In connection 1"
+connection con1;
ROLLBACK;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
@@ -1027,7 +1039,7 @@ id a b
6 Мога да Ñм Ñтъкло то Mне ми вреди
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
id a b
-"In connection 2"
+connection con2;
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
@@ -1045,4 +1057,7 @@ id a b
4 Я могу еÑÑ‚ÑŒ Ñтекло оно мне Mне вредит
5 adding record using session 1 for verifying multiple concurrent transactions
6 Мога да Ñм Ñтъкло то Mне ми вреди
+disconnect con1;
+disconnect con2;
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/suite/innodb_fts/t/innodb-fts-stopword.test b/mysql-test/suite/innodb_fts/t/innodb-fts-stopword.test
index 5c2d383d101..0f29d092541 100644
--- a/mysql-test/suite/innodb_fts/t/innodb-fts-stopword.test
+++ b/mysql-test/suite/innodb_fts/t/innodb-fts-stopword.test
@@ -524,7 +524,6 @@ ALTER TABLE articles DROP INDEX idx;
ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body);
---echo "In connection 1"
--connection con1
select @@innodb_ft_enable_stopword;
@@ -557,7 +556,6 @@ SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@6' IN BOO
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"where will"@9' IN BOOLEAN MODE);
---echo "In connection default"
--connection default
select @@innodb_ft_enable_stopword;
# no result expected as word not indexed from connection 1
@@ -580,7 +578,6 @@ SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+the +will" IN BOOLEAN M
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('"the will"@11' IN BOOLEAN MODE);
---echo "In connection 1"
--connection con1
SET SESSION innodb_ft_enable_stopword = 1;
# Define a correct formated user stopword table
@@ -597,7 +594,6 @@ SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('will');
---echo "In connection default"
--connection default
# no result expected as innodb_ft_user_stopword_table filter it from connection1
SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+show +will" IN BOOLEAN MODE);
@@ -619,7 +615,6 @@ ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body);
SELECT * FROM articles WHERE MATCH(title,body) AGAINST("+when" IN BOOLEAN MODE);
SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('when');
---echo "In connection 1"
--connection con1
SET SESSION innodb_ft_enable_stopword = 1;
SET SESSION innodb_ft_user_stopword_table=default;
@@ -641,7 +636,6 @@ SELECT * FROM articles WHERE MATCH (title,body) AGAINST ('the');
disconnect con1;
--source include/wait_until_disconnected.inc
---echo "In connection default"
--connection default
SET SESSION innodb_ft_enable_stopword = 1;
SET SESSION innodb_ft_user_stopword_table=default;
diff --git a/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test b/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test
index 3327e0ccd77..11571f346a2 100644
--- a/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test
+++ b/mysql-test/suite/innodb_fts/t/innodb_fts_transaction.test
@@ -345,7 +345,6 @@ EVAL CREATE TABLE t1 (
) CHARACTER SET = UTF8,ENGINE = InnoDB;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SET NAMES UTF8;
@@ -359,7 +358,6 @@ INSERT INTO t1 (a,b) VALUES
('Sævör grét', 'áðan því úlpan var ónýt');
---echo "In connection 2"
--connect (con2,localhost,root,,)
SET NAMES UTF8;
@@ -367,7 +365,6 @@ SET NAMES UTF8;
CREATE FULLTEXT INDEX idx on t1 (a,b);
---echo "In connection 1"
--connection con1
# first and third record expected
@@ -407,7 +404,6 @@ SELECT * FROM t1
AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
---echo "In connection 2"
--connection con2
# one records expected
@@ -461,7 +457,6 @@ SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('tutorial' WITH QUERY EXPANSION) ORDER BY 1;
---echo "In connection 1"
--connection con1
# transaction commit ,now we will be able to see records with FTS index
COMMIT;
@@ -482,7 +477,6 @@ SELECT * FROM t1
INSERT INTO t1 (a,b) VALUES (NULL,NULL);
SELECT * FROM t1 WHERE a IS NULL AND b IS NULL;
---echo "In connection 2"
--connection con2
# one record expected
@@ -540,7 +534,6 @@ SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('request');
---echo "In connection 1"
--connection con1
# no records expected as update tnx is not committed yet.
@@ -557,7 +550,6 @@ SELECT * FROM t1
WHERE MATCH (a,b)
AGAINST ('+mail +MySQL' IN BOOLEAN MODE);
---echo "In connection 2"
--connection con2
COMMIT;
SELECT * FROM t1
@@ -566,7 +558,6 @@ SELECT * FROM t1
---echo "In connection 1"
--connection con1
SELECT * FROM t1
WHERE MATCH (a,b)
@@ -601,7 +592,6 @@ EVAL CREATE TABLE t1 (
) CHARACTER SET = UTF8,ENGINE = InnoDB;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SET NAMES UTF8;
@@ -615,7 +605,6 @@ INSERT INTO t1 (a,b) VALUES
('Sævör grét', 'áðan því úlpan var ónýt');
---echo "In connection 2"
--connect (con2,localhost,root,,)
SET NAMES UTF8;
select @@session.tx_isolation;
@@ -627,7 +616,6 @@ INSERT INTO t1 (a,b) VALUES
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
---echo "In connection 1"
--connection con1
@@ -650,7 +638,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE
SELECT * FROM t1;
---echo "In connection 2"
--connection con2
# records expected due to repeatable read
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -660,7 +647,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE
SELECT * FROM t1;
---echo "In connection 1"
--connection con1
COMMIT;
# 1 record expected
@@ -670,7 +656,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('Ñтекло');
# No record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
---echo "In connection 2"
--connection con2
# 1 record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -705,7 +690,6 @@ EVAL CREATE TABLE t1 (
) CHARACTER SET = UTF8,ENGINE = InnoDB;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SET NAMES UTF8;
@@ -717,7 +701,6 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит');
---echo "In connection 2"
--connect (con2,localhost,root,,)
SET NAMES UTF8;
select @@session.tx_isolation;
@@ -729,7 +712,6 @@ INSERT INTO t1 (a,b) VALUES
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
---echo "In connection 1"
--connection con1
@@ -753,7 +735,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"dbms stands"@05' IN BOOLEAN MODE);
SELECT * FROM t1;
---echo "In connection 2"
--connection con2
# 2 records expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -784,7 +765,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"dbms stands"@05' IN BOOLEAN MODE);
SELECT * FROM t1;
---echo "In connection 1"
--connection con1
COMMIT;
# 1 record expected
@@ -794,7 +774,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('Ñтекло');
# 1 record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
---echo "In connection 2"
--connection con2
# 1 record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -828,7 +807,6 @@ EVAL CREATE TABLE t1 (
) CHARACTER SET = UTF8,ENGINE = InnoDB;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SET NAMES UTF8;
@@ -842,7 +820,6 @@ INSERT INTO t1 (a,b) VALUES
('Sævör grét', 'áðan því úlpan var ónýt');
---echo "In connection 2"
--connect (con2,localhost,root,,)
SET NAMES UTF8;
select @@session.tx_isolation;
@@ -854,7 +831,6 @@ INSERT INTO t1 (a,b) VALUES
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
---echo "In connection 1"
--connection con1
@@ -877,7 +853,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE
SELECT * FROM t1;
---echo "In connection 2"
--connection con2
# records expected due to repeatable read
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -887,7 +862,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE
SELECT * FROM t1;
---echo "In connection 1"
--connection con1
ROLLBACK;
# 2 record expected
@@ -897,7 +871,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('Ñтъкло');
# 1 record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
---echo "In connection 2"
--connection con2
# 2 record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -932,7 +905,6 @@ EVAL CREATE TABLE t1 (
) CHARACTER SET = UTF8,ENGINE = InnoDB;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SET NAMES UTF8;
@@ -944,7 +916,6 @@ INSERT INTO t1 (a,b) VALUES
('Я могу еÑÑ‚ÑŒ Ñтекло', 'оно мне Mне вредит');
---echo "In connection 2"
--connect (con2,localhost,root,,)
SET NAMES UTF8;
select @@session.tx_isolation;
@@ -956,7 +927,6 @@ INSERT INTO t1 (a,b) VALUES
('Мога да Ñм Ñтъкло', 'то Mне ми вреди');
---echo "In connection 1"
--connection con1
@@ -980,7 +950,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"dbms stands"@05' IN BOOLEAN MODE);
SELECT * FROM t1;
---echo "In connection 2"
--connection con2
# 2 records expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
@@ -1010,7 +979,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"dbms stands"@05' IN BOOLEAN MODE);
SELECT * FROM t1;
---echo "In connection 1"
--connection con1
ROLLBACK;
# 2 record expected
@@ -1020,7 +988,6 @@ SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('Ñтъкло');
# no record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('"Sævör grét"@18' IN BOOLEAN MODE);
---echo "In connection 2"
--connection con2
# 2 record expected
SELECT * FROM t1 WHERE MATCH (a,b) AGAINST ('+Mне' IN BOOLEAN MODE);
diff --git a/mysql-test/suite/innodb_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result
index dbfae3c0630..318f65d49c3 100644
--- a/mysql-test/suite/innodb_zip/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result
@@ -111,15 +111,24 @@ create table t2(b text)engine=innodb;
insert into t2 values(concat('1abcdefghijklmnopqrstuvwxyz', repeat('A',5000)));
insert into t1 select 1, b from t2;
commit;
+connect a,localhost,root,,mysqltest_innodb_zip;
+connect b,localhost,root,,mysqltest_innodb_zip;
+connection a;
begin;
update t1 set b=repeat('B',100);
+connection b;
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
+connection a;
rollback;
+connection b;
select a,left(b,40) from t1 natural join t2;
a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
+connection default;
+disconnect a;
+disconnect b;
analyze table t1;
Table Op Msg_type Msg_text
mysqltest_innodb_zip.t1 analyze status OK
diff --git a/mysql-test/suite/innodb_zip/r/innodb_bug56680.result b/mysql-test/suite/innodb_zip/r/innodb_bug56680.result
index 5e798b69167..40c39d21243 100644
--- a/mysql-test/suite/innodb_zip/r/innodb_bug56680.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_bug56680.result
@@ -12,15 +12,21 @@ BEGIN;
SELECT b FROM bug56680;
b
x
+connect con1,localhost,root,,;
+connection con1;
BEGIN;
UPDATE bug56680 SET b='X';
+connection default;
SELECT b FROM bug56680;
b
x
SELECT * FROM bug56680;
a b c
1 x 1
+connection con1;
ROLLBACK;
+disconnect con1;
+connection default;
SELECT b FROM bug56680;
b
x
@@ -41,6 +47,8 @@ SELECT b FROM bug56680 LIMIT 2;
b
x
x
+connect con1,localhost,root,,;
+connection con1;
BEGIN;
DELETE FROM bug56680 WHERE a=1;
INSERT INTO bug56680 VALUES(1,'X',1);
@@ -49,6 +57,7 @@ b
X
x
x
+connection default;
SELECT b FROM bug56680 LIMIT 2;
b
x
@@ -56,6 +65,7 @@ x
CHECK TABLE bug56680;
Table Op Msg_type Msg_text
test.bug56680 check status OK
+connection con1;
ROLLBACK;
SELECT b FROM bug56680 LIMIT 2;
b
@@ -64,6 +74,8 @@ x
CHECK TABLE bug56680;
Table Op Msg_type Msg_text
test.bug56680 check status OK
+connection default;
+disconnect con1;
SELECT b FROM bug56680 LIMIT 2;
b
x
diff --git a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
index b610d1ed7b8..f11988034ad 100644
--- a/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_index_large_prefix.result
@@ -16,12 +16,14 @@ update worklog5743 set a = (repeat("x", 17000));
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
+connect con1,localhost,root,,;
select a = repeat("x", 17000) from worklog5743;
a = repeat("x", 17000)
0
select a = repeat("b", 16000) from worklog5743;
a = repeat("b", 16000)
1
+connect con2,localhost,root,,;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -29,6 +31,7 @@ READ-UNCOMMITTED
select a = repeat("x", 17000) from worklog5743;
a = repeat("x", 17000)
1
+connection default;
rollback;
drop table worklog5743;
### Test 2 ###
@@ -41,6 +44,7 @@ Level Code Message
insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1000;
+connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
@@ -50,12 +54,14 @@ id select_type table type possible_keys key key_len ref rows Extra
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
9 1
+connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
+connection default;
rollback;
drop table worklog5743;
### Test 3 ###
@@ -64,6 +70,7 @@ create index idx on worklog5743(a1, a2(50));
insert into worklog5743 values(9, repeat("a", 10000));
begin;
update worklog5743 set a1 = 1000;
+connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
@@ -73,12 +80,14 @@ id select_type table type possible_keys key key_len ref rows Extra
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
9 1
+connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
READ-UNCOMMITTED
select a1, a2 = repeat("a", 10000) from worklog5743 where a1 = 9;
a1 a2 = repeat("a", 10000)
+connection default;
rollback;
drop table worklog5743;
### Test 4 ###
@@ -307,6 +316,7 @@ select a1, left(a2, 20) from worklog5743_16;
a1 left(a2, 20)
1000 aaaaaaaaaaaaaaaaaaaa
1000 bbbbbbbbbbbbbbbbbbbb
+connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
@@ -340,6 +350,7 @@ a1 left(a2, 20)
select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
a1 left(a2, 20)
9 aaaaaaaaaaaaaaaaaaaa
+connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -354,6 +365,7 @@ select a1, left(a2, 20) from worklog5743_8 where a1 = 9;
a1 left(a2, 20)
select a1, left(a2, 20) from worklog5743_16 where a1 = 9;
a1 left(a2, 20)
+connection default;
rollback;
drop table worklog5743_1;
drop table worklog5743_2;
@@ -411,6 +423,7 @@ repeat("a", 3072), repeat("a", 3069),
repeat("a", 3068));
begin;
update worklog5743 set a1 = 1000;
+connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
@@ -420,12 +433,14 @@ id select_type table type possible_keys key key_len ref rows Extra
select a1 from worklog5743 where a1 = 9;
a1
9
+connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
READ-UNCOMMITTED
select a1 from worklog5743 where a1 = 9;
a1
+connection default;
rollback;
drop table worklog5743;
### Test 6 ###
@@ -442,9 +457,11 @@ update worklog5743 set a = (repeat("x", 25000));
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
+connection con1;
select a = repeat("a", 20000) from worklog5743;
a = repeat("a", 20000)
1
+connection con2;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -453,6 +470,7 @@ select a = repeat("x", 25000) from worklog5743;
a = repeat("x", 25000)
1
1
+connection default;
rollback;
drop table worklog5743;
### Test 7 ###
@@ -484,3 +502,8 @@ drop table worklog5743;
SET GLOBAL innodb_file_format=Antelope;
SET GLOBAL innodb_file_per_table=1;
SET GLOBAL innodb_large_prefix=0;
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
diff --git a/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result b/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
index ccfd8a16710..7d52ab135b3 100644
--- a/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
+++ b/mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result
@@ -760,7 +760,7 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
1 1
-"In connection 1"
+connect con1,localhost,root,,;
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
@@ -768,7 +768,7 @@ col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
-"In connection 2"
+connect con2,localhost,root,,;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
@@ -776,7 +776,7 @@ worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
1 1
0 1
-"In connection 1"
+connection con1;
select @@session.tx_isolation;
@@session.tx_isolation
REPEATABLE-READ
@@ -802,9 +802,9 @@ col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
-"In connection 2"
+connection con2;
COMMIT;
-"In connection 1"
+connection con1;
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
@@ -817,6 +817,7 @@ SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
COMMIT;
+connection default;
DROP TABLE worklog5743;
CREATE TABLE worklog5743 (
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
@@ -827,7 +828,7 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
1 1
-"In connection 1"
+connection con1;
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
@@ -836,7 +837,7 @@ SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
START TRANSACTION;
-"In connection 2"
+connection con2;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200);
@@ -845,7 +846,7 @@ worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
0 1
COMMIT;
-"In connection 1"
+connection con1;
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@session.tx_isolation
@@ -863,6 +864,7 @@ SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
COMMIT;
+connection default;
DROP TABLE worklog5743;
CREATE TABLE worklog5743 (
col_1_text TEXT(4000) , col_2_text TEXT(4000) ,
@@ -873,7 +875,7 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
1 1
-"In connection 1"
+connection con1;
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
@@ -882,7 +884,7 @@ SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
START TRANSACTION;
-"In connection 2"
+connection con2;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
DELETE FROM worklog5743 WHERE col_1_text = REPEAT("a", 200);
@@ -891,7 +893,7 @@ worklog5743;
col_1_text = REPEAT("a", 200) col_2_text = REPEAT("o", 200)
0 1
ROLLBACK;
-"In connection 1"
+connection con1;
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
col_1_text = REPEAT("b", 200) col_2_text = REPEAT("o", 200)
@@ -900,7 +902,10 @@ SELECT COUNT(*) FROM worklog5743;
COUNT(*)
1
COMMIT;
-"Disconnect the connections 1 and 2"
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
DROP TABLE worklog5743;
CREATE TABLE worklog5743 (
col_1_varchar VARCHAR (4000) , col_2_varchar VARCHAR (4000) ,
@@ -1116,12 +1121,13 @@ PRIMARY KEY (col_1_varchar (3072))
) ROW_FORMAT=DYNAMIC, engine = innodb;
INSERT INTO worklog5743 VALUES(REPEAT("c", 3500) , REPEAT("o", 3500));
CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
-" Switching to con1 connection For select "
+connect con1,localhost,root,,;
+connection con1;
SELECT col_1_varchar = REPEAT("c", 3500) , col_2_varchar = REPEAT("o", 3500)
FROM worklog5743;
col_1_varchar = REPEAT("c", 3500) col_2_varchar = REPEAT("o", 3500)
1 1
-" Switching to default connection For DMLs "
+connection default;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
@@ -1130,7 +1136,7 @@ col_1_varchar = REPEAT("b", 3500)
0
0
COMMIT;
-" Switching to con1 connection For Dropping index and some DMLs "
+connection con1;
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("k", 3500),REPEAT("p", 3500));
ALTER TABLE worklog5743 DROP PRIMARY KEY;
@@ -1142,15 +1148,15 @@ WHERE col_2_varchar = REPEAT("o", 3500);
col_1_varchar = REPEAT("b", 3500)
1
0
-" Switching to default connection For DELETE "
+connection default;
DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 3500);
SELECT col_1_varchar = REPEAT("a", 3500) FROM worklog5743
WHERE col_2_varchar = REPEAT("p", 3500);
col_1_varchar = REPEAT("a", 3500)
0
-" Switching to con1 connection to commit changes "
+connection con1;
COMMIT;
-" Switching to default connection to drop and end sub-test "
+connection default;
DROP TABLE worklog5743;
CREATE TABLE worklog5743 (
col_1_varbinary VARBINARY (4000) , col_2_varbinary VARBINARY (4000) ,
@@ -1387,4 +1393,4 @@ worklog5743 CREATE TABLE `worklog5743` (
KEY `prefix_idx` (`col_1_varchar`(767))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=REDUNDANT
DROP TABLE worklog5743;
-"Disconnect the connection 1"
+connection default;
diff --git a/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test b/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
index 77f55002da5..1c02cafa47e 100644
--- a/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
+++ b/mysql-test/suite/innodb_zip/t/innodb_prefix_index_liftedlimit.test
@@ -729,14 +729,12 @@ INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
---echo "In connection 1"
--connect (con1,localhost,root,,)
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
---echo "In connection 2"
--connect (con2,localhost,root,,)
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
@@ -748,7 +746,6 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
---echo "In connection 1"
--connection con1
select @@session.tx_isolation;
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
@@ -765,7 +762,6 @@ SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
---echo "In connection 2"
--connection con2
COMMIT;
# Wait for commit
@@ -773,7 +769,6 @@ let $wait_condition=SELECT COUNT(*)=0 FROM information_schema.processlist
WHERE info='COMMIT';
--source include/wait_condition.inc
---echo "In connection 1"
--connection con1
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
@@ -799,7 +794,6 @@ INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
---echo "In connection 1"
--connection con1
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
@@ -807,7 +801,6 @@ SELECT COUNT(*) FROM worklog5743;
START TRANSACTION;
---echo "In connection 2"
--connection con2
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
@@ -821,7 +814,6 @@ WHERE info='COMMIT';
--source include/wait_condition.inc
---echo "In connection 1"
--connection con1
SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select @@session.tx_isolation;
@@ -851,7 +843,6 @@ INSERT INTO worklog5743 VALUES(REPEAT("a", 200) , REPEAT("o", 200));
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
---echo "In connection 1"
--connection con1
SELECT col_1_text = REPEAT("a", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
@@ -859,7 +850,6 @@ SELECT COUNT(*) FROM worklog5743;
START TRANSACTION;
---echo "In connection 2"
--connection con2
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("b", 200) , REPEAT("o", 200));
@@ -873,14 +863,12 @@ WHERE info='COMMIT';
--source include/wait_condition.inc
---echo "In connection 1"
--connection con1
SELECT col_1_text = REPEAT("b", 200) , col_2_text = REPEAT("o", 200) FROM
worklog5743;
SELECT COUNT(*) FROM worklog5743;
COMMIT;
---echo "Disconnect the connections 1 and 2"
--disconnect con1
--source include/wait_until_disconnected.inc
--connection con2
@@ -1080,16 +1068,13 @@ PRIMARY KEY (col_1_varchar (3072))
INSERT INTO worklog5743 VALUES(REPEAT("c", 3500) , REPEAT("o", 3500));
CREATE INDEX prefix_idx ON worklog5743(col_1_varchar (3072));
-# Start new session
--connect (con1,localhost,root,,)
---echo " Switching to con1 connection For select "
--connection con1
SELECT col_1_varchar = REPEAT("c", 3500) , col_2_varchar = REPEAT("o", 3500)
FROM worklog5743;
---echo " Switching to default connection For DMLs "
--connection default
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("a", 3500) , REPEAT("o", 3500));
@@ -1097,7 +1082,6 @@ SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
WHERE col_2_varchar = REPEAT("o", 3500);
COMMIT;
---echo " Switching to con1 connection For Dropping index and some DMLs "
--connection con1
START TRANSACTION;
INSERT INTO worklog5743 VALUES(REPEAT("k", 3500),REPEAT("p", 3500));
@@ -1109,17 +1093,14 @@ AND col_2_varchar = REPEAT("o", 3500);
SELECT col_1_varchar = REPEAT("b", 3500) FROM worklog5743
WHERE col_2_varchar = REPEAT("o", 3500);
---echo " Switching to default connection For DELETE "
--connection default
DELETE FROM worklog5743 WHERE col_1_varchar = REPEAT("b", 3500);
SELECT col_1_varchar = REPEAT("a", 3500) FROM worklog5743
WHERE col_2_varchar = REPEAT("p", 3500);
---echo " Switching to con1 connection to commit changes "
--connection con1
COMMIT;
---echo " Switching to default connection to drop and end sub-test "
--connection default
DROP TABLE worklog5743;
@@ -1383,10 +1364,8 @@ DROP TABLE worklog5743;
eval set global innodb_file_format = $innodb_file_format_orig;
eval set global innodb_file_per_table = $innodb_file_per_table_orig;
eval set global innodb_large_prefix = $innodb_large_prefix_orig;
---echo "Disconnect the connection 1"
--connection con1
--disconnect con1
--source include/wait_until_disconnected.inc
--enable_query_log
--connection default
-
diff --git a/mysql-test/suite/maria/insert_select-7314.result b/mysql-test/suite/maria/insert_select-7314.result
index 2f25cc5855c..0202659d585 100644
--- a/mysql-test/suite/maria/insert_select-7314.result
+++ b/mysql-test/suite/maria/insert_select-7314.result
@@ -9,7 +9,9 @@ Note 1051 Unknown table 'test.t1'
create table t1 (pk int primary key) engine=Aria;
insert into t1 values (1);
insert into t1 select sleep(2)+1 from t1;
+connect con1,localhost,root,,;
insert into t1 select 2 from t1;
+connection default;
select * from t1;
pk
1
diff --git a/mysql-test/suite/maria/insert_select.result b/mysql-test/suite/maria/insert_select.result
index 878914ddabf..937d345c490 100644
--- a/mysql-test/suite/maria/insert_select.result
+++ b/mysql-test/suite/maria/insert_select.result
@@ -1,6 +1,9 @@
create table t1 (pk int primary key) engine=Aria;
insert into t1 values (1);
insert into t1 select sleep(2)+1 from t1;
+connect con1,localhost,root,,;
insert into t1 select 2 from t1;
+connection default;
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
+disconnect con1;
drop table t1;
diff --git a/mysql-test/suite/maria/maria-autozerofill.result b/mysql-test/suite/maria/maria-autozerofill.result
index ef9e2f77345..76ccc67ebb5 100644
--- a/mysql-test/suite/maria/maria-autozerofill.result
+++ b/mysql-test/suite/maria/maria-autozerofill.result
@@ -1,6 +1,8 @@
call mtr.add_suppression("Table 't1' is marked as crashed and should be repaired");
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
create table t1(a int) engine=aria;
insert into t1 values(1);
@@ -16,7 +18,10 @@ create table t6 (a int) engine=aria;
INSERT INTO t6 VALUES (1),(2);
flush tables;
create_rename_lsn has non-magic value
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
select * from t1;
a
1
diff --git a/mysql-test/suite/maria/maria-big.result b/mysql-test/suite/maria/maria-big.result
index cb6e02df00e..f7f7d3d7525 100644
--- a/mysql-test/suite/maria/maria-big.result
+++ b/mysql-test/suite/maria/maria-big.result
@@ -1,4 +1,6 @@
set global max_allowed_packet=400000000;
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
set storage_engine=aria;
affected rows: 0
drop table if exists t1, t2;
diff --git a/mysql-test/suite/maria/maria-gis-recovery.result b/mysql-test/suite/maria/maria-gis-recovery.result
index d1088dd1ba0..f84a01fb854 100644
--- a/mysql-test/suite/maria/maria-gis-recovery.result
+++ b/mysql-test/suite/maria/maria-gis-recovery.result
@@ -3,18 +3,28 @@ Warnings:
Warning 1292 Truncated incorrect aria_log_file_size value: '4294967295'
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
CREATE TABLE t1 (
i int,
shape GEOMETRY NOT NULL,
SPATIAL (shape)
) ENGINE=ARIA;
insert into t1 values(1,POINT(1, 1));
+connection admin;
* copied t1 for feeding_recovery
+connection default;
insert into t1 values(2,POINT(2, 2)), (3,POINT(3, 3)), (4,POINT(4, 4));
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -27,6 +37,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
show create table t1;
Table Create Table
@@ -36,10 +47,15 @@ t1 CREATE TABLE `t1` (
SPATIAL KEY `shape` (`shape`)
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
* TEST of UPDATE vs state.auto_increment
+connection admin;
* copied t1 for feeding_recovery
+connection default;
update t1 set shape=POINT(5, 5) where i=2;
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -52,6 +68,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/maria/maria-mvcc.result b/mysql-test/suite/maria/maria-mvcc.result
index 671b1bbf53c..050f4e410ae 100644
--- a/mysql-test/suite/maria/maria-mvcc.result
+++ b/mysql-test/suite/maria/maria-mvcc.result
@@ -1,5 +1,7 @@
set global aria_page_checksum=1;
drop table if exists t1;
+connect con1,localhost,root,,;
+connection con1;
create table t1 (i int) engine=aria;
show create table t1;
Table Create Table
@@ -19,6 +21,8 @@ i
select count(*) from t1;
count(*)
3
+connect con2,localhost,root,,;
+connection con2;
/* should see 0 */
select i from t1;
i
@@ -51,6 +55,8 @@ i
select count(*) from t1;
count(*)
4
+connect con3,localhost,root,,;
+connection con3;
lock tables t1 write concurrent;
/* should see 0, 3, 4 */
select i from t1;
@@ -61,6 +67,7 @@ i
select count(*) from t1;
count(*)
3
+connection con1;
insert into t1 values (6);
/* Should see 0, 1, 2, 6 */
select i from t1;
@@ -86,6 +93,7 @@ i
select count(*) from t1;
count(*)
6
+connection con2;
/* should see 0, 3, 4, 5 */
select i from t1;
i
@@ -110,6 +118,7 @@ i
select count(*) from t1;
count(*)
7
+connection con1;
unlock tables;
/* should see 0, 1, 2, 3, 4, 5, 6 */
select i from t1;
@@ -124,6 +133,7 @@ i
select count(*) from t1;
count(*)
7
+connection con3;
insert into t1 values (7);
/* should see 0, 3, 4, 7 */
select i from t1;
@@ -150,6 +160,7 @@ i
select count(*) from t1;
count(*)
8
+connection default;
drop table t1;
CREATE TABLE t1 (fid INT NOT NULL AUTO_INCREMENT PRIMARY KEY, g GEOMETRY NOT NULL, SPATIAL KEY(g) ) transactional=1 row_format=page engine=aria;
lock tables t1 write concurrent, t1 as t2 write concurrent;
diff --git a/mysql-test/suite/maria/maria-no-logging.result b/mysql-test/suite/maria/maria-no-logging.result
index 9c50245d05d..fb175d0e326 100644
--- a/mysql-test/suite/maria/maria-no-logging.result
+++ b/mysql-test/suite/maria/maria-no-logging.result
@@ -1,6 +1,8 @@
set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
set global aria_checkpoint_interval=0;
create table t2 (a varchar(100)) engine=myisam;
@@ -11,7 +13,10 @@ insert into t2 select * from t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
insert into t2 select * from t2;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
create table t1 (a varchar(100)) engine=aria transactional=1;
show create table t1;
Table Create Table
@@ -26,14 +31,20 @@ insert into t1 select * from t2;
show engine aria logs;
Type Name Status
Aria Size 24576 aria_log.00000001 unknown
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
truncate table t1;
insert into t1 select * from t2;
show engine aria logs;
Type Name Status
Aria Size 16384 aria_log.00000001 unknown
drop table t1;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
create table t1 (a varchar(100)) engine=aria transactional=1;
insert into t1 values('a');
create table if not exists t1 select * from t2;
@@ -42,7 +53,10 @@ Note 1050 Table 't1' already exists
show engine aria logs;
Type Name Status
Aria Size 16384 aria_log.00000001 unknown
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
drop table t1;
create table t1 engine=aria transactional=1 select * from t2;
show engine aria logs;
diff --git a/mysql-test/suite/maria/maria-purge.result b/mysql-test/suite/maria/maria-purge.result
index 382f8aedf89..53208aee990 100644
--- a/mysql-test/suite/maria/maria-purge.result
+++ b/mysql-test/suite/maria/maria-purge.result
@@ -1,4 +1,9 @@
+connect admin, localhost, root,,test,,;
+connection default;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
set global storage_engine=aria;
set session storage_engine=aria;
set global aria_log_file_size=4294959104;
diff --git a/mysql-test/suite/maria/maria-recovery-big.result b/mysql-test/suite/maria/maria-recovery-big.result
index ae4010c7a86..a04e24eab74 100644
--- a/mysql-test/suite/maria/maria-recovery-big.result
+++ b/mysql-test/suite/maria/maria-recovery-big.result
@@ -1,14 +1,23 @@
set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
* TEST of recovery with blobs
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
create table t1 (a int, b longtext) engine=aria table_checksum=1;
+connection admin;
* copied t1 for feeding_recovery
+connection default;
insert into t1 values (1,"123456789012345678901234567890"),(2,"09876543210987654321");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock table t1 write;
update t1 set b=CONCAT(b,b);
update t1 set b=CONCAT(b,b);
@@ -60,6 +69,7 @@ select a,length(b) from t1;
a length(b)
1 8
2 5
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -72,6 +82,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop table t1;
drop database mysqltest_for_feeding_recovery;
diff --git a/mysql-test/suite/maria/maria-recovery-bitmap.result b/mysql-test/suite/maria/maria-recovery-bitmap.result
index e3697334239..c6d0e2cb4e1 100644
--- a/mysql-test/suite/maria/maria-recovery-bitmap.result
+++ b/mysql-test/suite/maria/maria-recovery-bitmap.result
@@ -1,17 +1,27 @@
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
create table t1 (a varchar(10000)) engine=aria;
* TEST of over-allocated bitmap not flushed by checkpoint
insert into t1 values ("bbbbbbb");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
insert into t1 values ("bbbbbbb");
delete from t1 limit 1;
+connect extra, localhost, root,,mysqltest,,;
set session debug_dbug="+d,info,enter,exit,maria_over_alloc_bitmap";
insert into t1 values ("aaaaaaaaa");
+connection admin;
set global aria_checkpoint_interval=1;
+connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -23,12 +33,17 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
+connection default;
* TEST of bitmap flushed without REDO-UNDO in the log (WAL violation)
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values (REPEAT('a', 6000));
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_bitmap,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -40,6 +55,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop table t1;
drop database mysqltest_for_comparison;
diff --git a/mysql-test/suite/maria/maria-recovery-rtree-ft.result b/mysql-test/suite/maria/maria-recovery-rtree-ft.result
index 5c6c791d8f6..bb7d864b6b1 100644
--- a/mysql-test/suite/maria/maria-recovery-rtree-ft.result
+++ b/mysql-test/suite/maria/maria-recovery-rtree-ft.result
@@ -1,8 +1,13 @@
set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
CREATE TABLE t1 (
line POINT NOT NULL,
kind ENUM('po', 'pp', 'rr', 'dr', 'rd', 'ts', 'cl') NOT NULL DEFAULT 'po',
@@ -19,12 +24,17 @@ Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_par
t2 1 a 1 a NULL NULL NULL NULL YES FULLTEXT
t2 1 a 2 b NULL NULL NULL NULL YES FULLTEXT
* TEST of REDO: see if recovery can reconstruct if we give it an old table
+connection admin;
* copied t2 for feeding_recovery
* copied t1 for feeding_recovery
+connection default;
+connection admin;
flush table t2;
* copied t2 for comparison
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -44,13 +54,17 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
* TEST of INSERT and DELETE's rollback
+connection admin;
flush table t2;
* copied t2 for comparison
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write, t2 write;
+connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -68,12 +82,16 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
+connection admin;
flush table t2;
* copied t2 for comparison
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write, t2 write;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -91,12 +109,16 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
+connection admin;
flush table t2;
* copied t2 for comparison
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write, t2 write;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_states,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -114,12 +136,16 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
+connection admin;
flush table t2;
* copied t2 for comparison
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write, t2 write;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -137,7 +163,9 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -155,6 +183,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop database mysqltest_for_feeding_recovery;
drop database mysqltest_for_comparison;
diff --git a/mysql-test/suite/maria/maria-recovery.result b/mysql-test/suite/maria/maria-recovery.result
index 86e756badec..6c9af3eac88 100644
--- a/mysql-test/suite/maria/maria-recovery.result
+++ b/mysql-test/suite/maria/maria-recovery.result
@@ -1,14 +1,24 @@
set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
+connect admin, localhost, root,,mysqltest,,;
+connection default;
use mysqltest;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
create table t1 (a varchar(1000)) engine=aria;
* TEST of REDO: see if recovery can reconstruct if we give it an old table
+connection admin;
* copied t1 for feeding_recovery
+connection default;
insert into t1 values ("00000000");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -22,16 +32,20 @@ mysqltest.t1 check status OK
Checksum-check
ok
* compared t1 to old version
+connection default;
use mysqltest;
select * from t1;
a
00000000
* TEST of REDO+UNDO: normal recovery test (no moving tables under its feet)
insert into t1 values ("00000000");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values ("aaaaaaaaa");
+connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -43,16 +57,20 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
select * from t1;
a
00000000
00000000
insert into t1 values ("00000000");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values ("aaaaaaaaa");
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -64,6 +82,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
select * from t1;
a
@@ -71,10 +90,13 @@ a
00000000
00000000
insert into t1 values ("00000000");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values ("aaaaaaaaa");
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_states,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -86,6 +108,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
select * from t1;
a
@@ -94,10 +117,13 @@ a
00000000
00000000
insert into t1 values ("00000000");
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values ("aaaaaaaaa");
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -109,6 +135,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
select * from t1;
a
@@ -119,20 +146,28 @@ a
00000000
drop table t1;
* TEST of two REDOs for same page in one REDO group
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
CREATE TABLE t1 (
i int,
b blob default NULL,
c varchar(6000) default NULL
) ENGINE=ARIA CHECKSUM=1;
+connection admin;
* copied t1 for feeding_recovery
+connection default;
INSERT INTO t1 VALUES (1, REPEAT('a', 5000), REPEAT('b', 5000));
UPDATE t1 SET i=3, b=CONCAT(b,'c') WHERE i=1;
SELECT LENGTH(b) FROM t1 WHERE i=3;
LENGTH(b)
5001
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -145,24 +180,33 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
SELECT LENGTH(b) FROM t1 WHERE i=3;
LENGTH(b)
5001
drop table t1;
* TEST of INSERT vs state.auto_increment
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
CREATE TABLE t1 (
i int auto_increment primary key,
c varchar(6),
key(c)
) ENGINE=ARIA;
insert into t1 values(null,"b");
+connection admin;
* copied t1 for feeding_recovery
+connection default;
insert into t1 values(null,"a"), (null,"c"), (null,"d");
delete from t1 where c="d";
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -175,6 +219,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
show create table t1;
Table Create Table
@@ -185,10 +230,15 @@ t1 CREATE TABLE `t1` (
KEY `c` (`c`)
) ENGINE=Aria AUTO_INCREMENT=5 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
* TEST of UPDATE vs state.auto_increment
+connection admin;
* copied t1 for feeding_recovery
+connection default;
update t1 set i=15 where c="a";
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -201,6 +251,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
show create table t1;
Table Create Table
@@ -211,10 +262,13 @@ t1 CREATE TABLE `t1` (
KEY `c` (`c`)
) ENGINE=Aria AUTO_INCREMENT=16 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
* TEST of INSERT's rollback vs state.auto_increment
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values(null, "e");
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -226,6 +280,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
show create table t1;
Table Create Table
diff --git a/mysql-test/suite/maria/maria-recovery2.result b/mysql-test/suite/maria/maria-recovery2.result
index 054e86d079c..0ed49ab8142 100644
--- a/mysql-test/suite/maria/maria-recovery2.result
+++ b/mysql-test/suite/maria/maria-recovery2.result
@@ -3,17 +3,25 @@ call mtr.add_suppression("Table '.\/mysqltest\/t_corrupted1' is crashed, skippin
set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
+connect admin, 127.0.0.1, root,,mysqltest,,;
+connection default;
use mysqltest;
* TEST of removing logs manually
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
* TEST of UNDO_ROW_DELETE preserving rowid
create table t1(a int) engine=aria;
insert into t1 values(1),(2);
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values(3);
delete from t1 where a in (1,2,3);
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -25,6 +33,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop table t1;
* TEST of checkpoint
@@ -34,8 +43,10 @@ create table t1(a int, b varchar(10), index(a,b)) engine=aria;
insert into t1 values(1,"a"),(2,"b"),(3,"c");
delete from t1 where b="b";
update t1 set b="d" where a=1;
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values(4,"e"),(5,"f"),(6,"g");
update t1 set b="h" where a=5;
@@ -45,6 +56,7 @@ Variable_name Value
Aria_pagecache_blocks_not_flushed 3
set global aria_checkpoint_interval=10000;
update t1 set b="i" where a=5;
+connection admin;
SET SESSION debug_dbug="+d,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -56,13 +68,16 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop table t1;
Test of REPAIR's implicit commit
create table t1 (a varchar(100), key(a)) engine=aria;
insert into t1 values(3);
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write;
insert into t1 values (1);
repair table t1;
@@ -74,6 +89,7 @@ a
1
2
3
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -85,6 +101,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
failure
+connection default;
use mysqltest;
select * from t1;
a
@@ -103,14 +120,17 @@ insert into t2 select (rand()) from t2;
insert into t2 select (rand()) from t2;
insert into t2 select (rand()) from t2;
insert into t1 values(30);
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
lock tables t1 write, t2 read;
delete from t1 limit 1;
select count(*) from t1;
count(*)
0
insert into t1 select * from t2;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -122,6 +142,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
@@ -133,8 +154,11 @@ drop table t1;
* TEST of recovery when OPTIMIZE has replaced the index file and crash
create table t_corrupted1 (a varchar(100), key(a)) engine=aria;
insert into t_corrupted1 select (rand()) from t2;
+connection admin;
flush table t_corrupted1;
* copied t_corrupted1 for comparison
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_flush_whole_page_cache,maria_crash_sort_index";
* crashing mysqld intentionally
optimize table t_corrupted1;
@@ -147,6 +171,7 @@ mysqltest.t_corrupted1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop table t_corrupted1, t2;
drop database mysqltest_for_comparison;
diff --git a/mysql-test/suite/maria/maria-recovery3.result b/mysql-test/suite/maria/maria-recovery3.result
index 84fd6fbb91e..9d25cd13b90 100644
--- a/mysql-test/suite/maria/maria-recovery3.result
+++ b/mysql-test/suite/maria/maria-recovery3.result
@@ -1,17 +1,27 @@
set global aria_log_file_size=4294959104;
drop database if exists mysqltest;
create database mysqltest;
+connect admin, 127.0.0.1, root,,mysqltest,,;
+connection default;
use mysqltest;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
* TEST of Checkpoint between writing the commit log record and committing in trnman
create table t1(a int primary key) engine=aria;
insert into t1 values(1);
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
set session debug_dbug="+d,maria_sleep_in_commit";
insert into t1 values(2);
+connection admin;
set global aria_checkpoint_interval=1000;
+connection default;
delete from t1 where a=2;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -23,6 +33,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
drop table t1;
* TEST of logging of BLOBs
@@ -31,8 +42,10 @@ CREATE TABLE `t1` (
`blob_key` blob
) ENGINE=aria ROW_FORMAT=page
;
+connection admin;
* copied t1 for feeding_recovery
* compared t1 to old version
+connection default;
set global aria_checkpoint_interval=0;
INSERT INTO `t1` VALUES (NULL,repeat('A',5198));
INSERT INTO `t1` VALUES (NULL,repeat('B',65535));
@@ -45,9 +58,12 @@ INSERT INTO `t1` VALUES (repeat('I',5198),repeat('J',65535));
check table t1 extended;
Table Op Msg_type Msg_text
mysqltest.t1 check status OK
+connection admin;
flush table t1;
* copied t1 for comparison
* compared t1 to old version
+connection default;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -61,16 +77,22 @@ mysqltest.t1 check status OK
Checksum-check
ok
* compared t1 to old version
+connection default;
use mysqltest;
drop table t1;
create table t1 engine=aria select 1;
+connection admin;
* copied t1 for feeding_recovery
+connection default;
set global aria_checkpoint_interval=0;
insert into t1 values(2);
truncate table t1;
+connection admin;
flush table t1;
* copied t1 for comparison
+connection default;
truncate table t1;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash_create_table";
* crashing mysqld intentionally
truncate table t1;
@@ -83,6 +105,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
ok
+connection default;
use mysqltest;
truncate table t1;
check table t1 extended;
@@ -95,6 +118,7 @@ SET AUTOCOMMIT=0;
DELETE FROM t1;
LOAD DATA INFILE '../../std_data/bug887051.txt' INTO TABLE t1 IGNORE 1 LINES;
COMMIT;
+connection admin;
SET SESSION debug_dbug="+d,maria_flush_whole_log,maria_crash";
* crashing mysqld intentionally
set global aria_checkpoint_interval=1;
@@ -106,6 +130,7 @@ mysqltest.t1 check status OK
* testing that checksum after recovery is as expected
Checksum-check
failure
+connection default;
use mysqltest;
select * from t1;
word
diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result
index 952cdc09c90..1b80f5ef695 100644
--- a/mysql-test/suite/maria/maria.result
+++ b/mysql-test/suite/maria/maria.result
@@ -581,8 +581,11 @@ select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
a a b
1 1 1
2 2 1
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
insert into t2 values(2,0);
commit;
+disconnect root;
+connection default;
select straight_join * from t1,t2 force index (primary) where t1.a=t2.a;
a a b
1 1 1
@@ -598,7 +601,11 @@ LOCK TABLES t1 READ LOCAL, t2 READ LOCAL;
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
t1c1 t2c1
+connect con1,localhost,root,,;
+connection con1;
INSERT INTO t2 VALUES ('test000001'), ('test000005');
+disconnect con1;
+connection default;
SELECT t1.c1 AS t1c1, t2.c1 AS t2c1 FROM t1, t2
WHERE t1.c1 = t2.c1 HAVING t1c1 != t2c1;
t1c1 t2c1
@@ -1601,12 +1608,17 @@ set global concurrent_insert=1;
create table t1 (a int) ROW_FORMAT=FIXED;
insert into t1 values (1),(2),(3),(4),(5);
lock table t1 read local;
+connect con1,localhost,root,,;
+connection con1;
insert into t1 values(6),(7);
+connection default;
unlock tables;
delete from t1 where a>=3 and a<=4;
lock table t1 read local;
+connection con1;
set global concurrent_insert=2;
insert into t1 values (8),(9);
+connection default;
unlock tables;
insert into t1 values (10),(11),(12);
select * from t1;
@@ -1625,15 +1637,21 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+disconnect con1;
create table t1 (a int, b varchar(30) default "hello") ROW_FORMAT=DYNAMIC;
insert into t1 (a) values (1),(2),(3),(4),(5);
lock table t1 read local;
+connect con1,localhost,root,,;
+connection con1;
insert into t1 (a) values(6),(7);
+connection default;
unlock tables;
delete from t1 where a>=3 and a<=4;
lock table t1 read local;
+connection con1;
set global concurrent_insert=2;
insert into t1 (a) values (8),(9);
+connection default;
unlock tables;
insert into t1 (a) values (10),(11),(12);
select a from t1;
@@ -1652,6 +1670,7 @@ check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
drop table t1;
+disconnect con1;
set global concurrent_insert=@save_concurrent_insert;
create table t1 (a int, key(a));
insert into t1 values (1),(2),(3),(4),(NULL),(NULL),(NULL),(NULL);
@@ -1670,15 +1689,25 @@ show keys from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 1 a 1 a A 8 NULL NULL YES BTREE
drop table t1;
+connect session1,localhost,root,,;
+connect session2,localhost,root,,;
+connection session1;
show create table t1;
+connection session2;
show create table t1;
+connection default;
create table t1 (a int) select 42 a;
+connection session1;
select * from t1;
a
9
+disconnect session1;
+connection session2;
select * from t1;
a
99
+disconnect session2;
+connection default;
select * from t1;
a
42
diff --git a/mysql-test/suite/maria/maria3.result b/mysql-test/suite/maria/maria3.result
index 7e0e55ed8c0..e6b73eb8909 100644
--- a/mysql-test/suite/maria/maria3.result
+++ b/mysql-test/suite/maria/maria3.result
@@ -622,8 +622,11 @@ create table t2 (a int, unique(a)) engine=aria transactional=0 row_format=dynami
insert into t2 values(1);
insert into t2 values(2),(2);
ERROR 23000: Duplicate entry '2' for key 'a'
+connect root,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connection root;
insert into t1 values(3);
insert into t2 values(3);
+connection default;
drop table t1, t2;
CREATE TABLE t1 (
a INT PRIMARY KEY,
diff --git a/mysql-test/suite/maria/maria_notembedded.result b/mysql-test/suite/maria/maria_notembedded.result
index f9d8bbfedc8..5617238e075 100644
--- a/mysql-test/suite/maria/maria_notembedded.result
+++ b/mysql-test/suite/maria/maria_notembedded.result
@@ -27,29 +27,43 @@ create table t1 (a int unique) transactional=1;
insert t1 values (1);
lock table t1 write concurrent;
insert t1 values (2);
+connect con_a,localhost,root,,;
lock table t1 write concurrent;
insert t1 values (3);
insert t1 values (2);
+connect con_b,localhost,root,,;
lock table t1 write concurrent;
insert t1 values (4);
insert t1 values (3);
+connect con_c,localhost,root,,;
lock table t1 write concurrent;
insert t1 values (5);
insert t1 values (4);
+connect con_d,localhost,root,,;
lock table t1 write concurrent;
insert t1 values (6);
insert t1 values (5);
+connection default;
insert t1 values (6);
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
unlock tables;
+connection con_a;
ERROR 23000: Duplicate entry '2' for key 'a'
unlock tables;
+disconnect con_a;
+connection con_b;
ERROR 23000: Duplicate entry '3' for key 'a'
unlock tables;
+disconnect con_b;
+connection con_c;
ERROR 23000: Duplicate entry '4' for key 'a'
unlock tables;
+disconnect con_c;
+connection con_d;
ERROR 23000: Duplicate entry '5' for key 'a'
unlock tables;
+disconnect con_d;
+connection default;
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
diff --git a/mysql-test/suite/maria/maria_showlog_error.result b/mysql-test/suite/maria/maria_showlog_error.result
index e2434efec28..cd4ef6f5d7a 100644
--- a/mysql-test/suite/maria/maria_showlog_error.result
+++ b/mysql-test/suite/maria/maria_showlog_error.result
@@ -1,5 +1,16 @@
+connect admin, localhost, root,,test,,;
+connection default;
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
+connection default;
show engine aria logs;
Type Name Status
Aria Size unknown ; aria_log.00000001 can't stat
+connection default;
+connection admin;
* shut down mysqld, removed logs, restarted it
+connection default;
+disconnect admin;
+connection default;
diff --git a/mysql-test/suite/multi_source/gtid.result b/mysql-test/suite/multi_source/gtid.result
index 28ac1e7429e..0ed1062b70f 100644
--- a/mysql-test/suite/multi_source/gtid.result
+++ b/mysql-test/suite/multi_source/gtid.result
@@ -1,3 +1,8 @@
+connect slave1,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connect slave2,127.0.0.1,root,,,$SERVER_MYPORT_4;
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connection slave1;
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
set default_master_connection = 'slave1';
@@ -7,17 +12,21 @@ set default_master_connection = 'slave2';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection slave2;
CHANGE MASTER TO master_port=MYPORT_3, master_host='127.0.0.1', master_user='root';
start all slaves;
Warnings:
Note 1937 SLAVE '' started
include/wait_for_slave_to_start.inc
+connection master1;
SET GLOBAL gtid_domain_id= 1;
SET SESSION gtid_domain_id= 1;
CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
INSERT INTO t1 VALUES (1, "initial");
INSERT INTO t3 VALUES (101, "initial 1");
+connection slave1;
+connection master2;
SET GLOBAL gtid_domain_id= 2;
SET SESSION gtid_domain_id= 2;
CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
@@ -26,14 +35,18 @@ SET SQL_LOG_BIN=0;
CREATE TABLE t3 (a INT PRIMARY KEY, b VARCHAR(10));
SET SQL_LOG_BIN=1;
INSERT INTO t3 VALUES (201, "initial 2");
+connection slave2;
*** Now move slave2 to replicate from both master1 and master2 instead of just slave1 ***
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE '' stopped
+connection master1;
INSERT INTO t1 VALUES (2, "switch1");
INSERT INTO t3 VALUES (102, "switch1 a");
+connection master2;
INSERT INTO t2 VALUES (2, "switch1");
INSERT INTO t3 VALUES (202, "switch1 b");
+connection slave2;
CHANGE MASTER 'slave1' TO master_port=MYPORT_1, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
CHANGE MASTER 'slave2' TO master_port=MYPORT_2, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
SET default_master_connection = 'slave1';
@@ -44,16 +57,24 @@ START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
*** Move slave1 to replicate from slave2 instead of from master1 and master2 ***
+connection slave1;
STOP SLAVE 'slave1';
+connection master1;
INSERT INTO t1 VALUES (3, "switch 2");
INSERT INTO t3 VALUES (103, "switch 2 a");
+connection slave2;
+connection master2;
INSERT INTO t2 VALUES (3, "switch 2");
INSERT INTO t3 VALUES (203, "switch 2 b");
include/save_master_gtid.inc
+connection slave1;
STOP SLAVE 'slave2';
+connection master2;
INSERT INTO t2 VALUES (4, "switch 3");
INSERT INTO t3 VALUES (204, "switch 3 b");
+connection slave2;
include/sync_with_master_gtid.inc
+connection slave1;
CHANGE MASTER TO master_port=MYPORT_4, master_host='127.0.0.1', master_user='root', master_use_gtid=current_pos;
START SLAVE;
SELECT * FROM t1 ORDER BY a;
@@ -76,24 +97,34 @@ a b
202 switch1 b
203 switch 2 b
204 switch 3 b
+connection master1;
DROP TABLE t1;
SET SQL_LOG_BIN=0;
DROP TABLE t3;
SET SQL_LOG_BIN=1;
+connection master2;
DROP TABLE t2;
DROP TABLE t3;
+connection slave1;
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE '' stopped
include/reset_master_slave.inc
+disconnect slave1;
+connection slave2;
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE 'slave1' stopped
Note 1938 SLAVE 'slave2' stopped
include/reset_master_slave.inc
+disconnect slave2;
+connection master1;
SET GLOBAL gtid_domain_id=0;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
SET GLOBAL gtid_domain_id=0;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/gtid_ignore_duplicates.result b/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
index 2e15f11a7c7..92d096245c7 100644
--- a/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
+++ b/mysql-test/suite/multi_source/gtid_ignore_duplicates.result
@@ -1,4 +1,9 @@
*** Test all-to-all replication with --gtid-ignore-duplicates ***
+connect server_1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect server_2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connect server_3,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connect server_4,127.0.0.1,root,,,$SERVER_MYPORT_4;
+connection server_1;
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=5;
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
@@ -14,6 +19,7 @@ set default_master_connection = 'c2a';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection server_2;
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=5;
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
@@ -29,6 +35,7 @@ set default_master_connection = 'c2b';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection server_3;
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=5;
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
@@ -44,6 +51,7 @@ set default_master_connection = 'b2c';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection server_4;
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=5;
SET @old_ignore_duplicates= @@GLOBAL.gtid_ignore_duplicates;
@@ -55,6 +63,7 @@ set default_master_connection = 'a2d';
START SLAVE;
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
@@ -65,6 +74,7 @@ COMMIT;
INSERT INTO t1 VALUES (4), (5);
INSERT INTO t1 VALUES (6);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -74,6 +84,7 @@ a
4
5
6
+connection server_3;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -83,6 +94,7 @@ a
4
5
6
+connection server_4;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -92,6 +104,7 @@ a
4
5
6
+connection server_1;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -101,8 +114,10 @@ a
4
5
6
+connection server_3;
INSERT INTO t1 VALUES (10);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
@@ -113,8 +128,10 @@ include/wait_for_slave_to_stop.inc
STOP SLAVE "a2b";
SET default_master_connection = "a2b";
include/wait_for_slave_to_stop.inc
+connection server_3;
INSERT INTO t1 VALUES (11);
include/save_master_gtid.inc
+connection server_1;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
@@ -123,12 +140,14 @@ a
SET default_master_connection = "b2a";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
+connection server_2;
INSERT INTO t1 VALUES (12);
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
10
12
include/save_master_gtid.inc
+connection server_1;
START SLAVE "b2a";
SET default_master_connection = "b2a";
include/wait_for_slave_to_start.inc
@@ -138,13 +157,16 @@ a
10
11
12
+connection server_2;
START SLAVE "c2b";
SET default_master_connection = "c2b";
include/wait_for_slave_to_start.inc
START SLAVE "a2b";
SET default_master_connection = "a2b";
include/wait_for_slave_to_start.inc
+connection server_1;
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a
@@ -152,6 +174,7 @@ a
11
12
*** Test also with not using parallel replication.
+connection server_1;
SET default_master_connection = "b2a";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
@@ -165,6 +188,7 @@ include/wait_for_slave_to_start.inc
SET default_master_connection = "c2a";
START SLAVE;
include/wait_for_slave_to_start.inc
+connection server_2;
SET default_master_connection = "a2b";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
@@ -178,6 +202,7 @@ include/wait_for_slave_to_start.inc
SET default_master_connection = "c2b";
START SLAVE;
include/wait_for_slave_to_start.inc
+connection server_3;
SET default_master_connection = "a2c";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
@@ -191,6 +216,7 @@ include/wait_for_slave_to_start.inc
SET default_master_connection = "b2c";
START SLAVE;
include/wait_for_slave_to_start.inc
+connection server_4;
SET default_master_connection = "a2d";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
@@ -198,6 +224,7 @@ SET GLOBAL slave_parallel_threads=0;
SET default_master_connection = "a2d";
START SLAVE;
include/wait_for_slave_to_start.inc
+connection server_2;
INSERT INTO t1 VALUES (21);
BEGIN;
INSERT INTO t1 VALUES (22);
@@ -206,6 +233,7 @@ COMMIT;
INSERT INTO t1 VALUES (24), (25);
INSERT INTO t1 VALUES (26);
include/save_master_gtid.inc
+connection server_1;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
a
@@ -215,6 +243,7 @@ a
24
25
26
+connection server_3;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
a
@@ -224,6 +253,7 @@ a
24
25
26
+connection server_4;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
a
@@ -233,6 +263,7 @@ a
24
25
26
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
a
@@ -243,15 +274,18 @@ a
25
26
*** MDEV-8354: out-of-order error with --gtid-ignore-duplicates and row-based replication ***
+connection server_1;
SET default_master_connection = "b2a";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
SET default_master_connection = "c2a";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
+connection server_2;
SET default_master_connection = "c2b";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
+connection server_3;
SET default_master_connection = "b2c";
STOP SLAVE;
include/wait_for_slave_to_stop.inc
@@ -261,6 +295,7 @@ SET @old_strict=@@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode=1;
SET @old_dbug=@@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,inject_sleep_gtid_100_x_x";
+connection server_1;
SET @old_domain=@@SESSION.gtid_domain_id;
SET @old_format=@@SESSION.binlog_format;
SET SESSION gtid_domain_id=100;
@@ -288,15 +323,18 @@ INSERT INTO t1 VALUES (49);
SET SESSION gtid_domain_id=@old_domain;
SET SESSION binlog_format=@old_format;
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
INSERT INTO t1 VALUES (50);
include/save_master_gtid.inc
+connection server_3;
SET default_master_connection = "b2c";
START SLAVE;
include/wait_for_slave_to_start.inc
SELECT MASTER_GTID_WAIT("GTID", 30);
MASTER_GTID_WAIT("GTID", 30)
0
+connection server_1;
SET default_master_connection = "b2a";
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -327,6 +365,7 @@ a
48
49
50
+connection server_2;
SET default_master_connection = "c2b";
START SLAVE;
include/wait_for_slave_to_start.inc
@@ -354,6 +393,7 @@ a
48
49
50
+connection server_3;
include/sync_with_master_gtid.inc
SET GLOBAL debug_dbug=@old_dbug;
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
@@ -382,6 +422,7 @@ a
SET GLOBAL slave_exec_mode=@old_slave_mode;
SET GLOBAL gtid_strict_mode=@old_strict;
*** MDEV-8496: gtid_ignore_duplicates treats gtid_seq_no as 32-bit ***
+connection server_1;
SET @old_domain= @@SESSION.gtid_domain_id;
SET SESSION gtid_domain_id=102;
SET SESSION gtid_seq_no=4294967294;
@@ -390,12 +431,14 @@ INSERT INTO t1 VALUES (61);
INSERT INTO t1 VALUES (62);
SET SESSION gtid_domain_id= @old_domain;
include/save_master_gtid.inc
+connection server_4;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 60 ORDER BY a;
a
60
61
62
+connection server_2;
SET default_master_connection = "c2b";
include/sync_with_master_gtid.inc
SET default_master_connection = "a2b";
@@ -405,6 +448,7 @@ a
60
61
62
+connection server_3;
SET default_master_connection = "b2c";
include/sync_with_master_gtid.inc
SET default_master_connection = "a2c";
@@ -414,6 +458,7 @@ a
60
61
62
+connection server_1;
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
@@ -421,6 +466,7 @@ Note 1938 SLAVE 'b2a' stopped
Note 1938 SLAVE 'c2a' stopped
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
+connection server_2;
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
@@ -428,6 +474,7 @@ Note 1938 SLAVE 'a2b' stopped
Note 1938 SLAVE 'c2b' stopped
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
+connection server_3;
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
@@ -435,17 +482,26 @@ Note 1938 SLAVE 'a2c' stopped
Note 1938 SLAVE 'b2c' stopped
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
+connection server_4;
SET GLOBAL gtid_domain_id=0;
STOP ALL SLAVES;
Warnings:
Note 1938 SLAVE 'a2d' stopped
SET GLOBAL slave_parallel_threads= @old_parallel;
SET GLOBAL gtid_ignore_duplicates= @old_ignore_duplicates;
+connection server_1;
DROP TABLE t1;
include/reset_master_slave.inc
+disconnect server_1;
+connection server_2;
DROP TABLE t1;
include/reset_master_slave.inc
+disconnect server_2;
+connection server_3;
DROP TABLE t1;
include/reset_master_slave.inc
+disconnect server_3;
+connection server_4;
DROP TABLE t1;
include/reset_master_slave.inc
+disconnect server_4;
diff --git a/mysql-test/suite/multi_source/info_logs.result b/mysql-test/suite/multi_source/info_logs.result
index d644939bd6f..1e3243df07a 100644
--- a/mysql-test/suite/multi_source/info_logs.result
+++ b/mysql-test/suite/multi_source/info_logs.result
@@ -1,3 +1,4 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
#
# List of files matching '*info*' pattern before starting any slaves
multi-master.info
@@ -31,6 +32,8 @@ master_user='root';
start slave 'MASTER 2.2';
set default_master_connection = 'MASTER 2.2';
include/wait_for_slave_to_start.inc
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connection slave;
#
# List of files matching '*info*' pattern
# while 'master1' and 'MASTER 2.2' are running
@@ -69,6 +72,8 @@ master_host='127.0.0.1',
master_user='root';
start slave;
include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connection slave;
#
# List of files matching '*info*' pattern
# while 'MASTER 2.2' and '' are running
@@ -111,5 +116,10 @@ MASTER 2.2
# EOF
#
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/load_data.result b/mysql-test/suite/multi_source/load_data.result
index 3a04156ce6a..21b1bfff488 100644
--- a/mysql-test/suite/multi_source/load_data.result
+++ b/mysql-test/suite/multi_source/load_data.result
@@ -1,3 +1,7 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connection slave;
change master '' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
change master 'master2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
start all slaves;
@@ -9,22 +13,38 @@ include/wait_for_slave_to_start.inc
set default_master_connection = 'master2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection master1;
create table t1 (a varchar(10) character set utf8);
load data infile '../../std_data/loaddata6.dat' into table t1;
+connection slave;
+connection master2;
create table t2 (a varchar(10) character set utf8);
load data infile '../../std_data/loaddata6.dat' into table t2;
+connection slave;
select count(*) from t1;
count(*)
1
select count(*) from t2;
count(*)
1
+connection master1;
drop table t1;
+connection master2;
drop table t2;
+connection master1;
+connection slave;
+connection master2;
+connection slave;
+connection slave;
stop all slaves;
Warnings:
Note 1938 SLAVE '' stopped
Note 1938 SLAVE 'master2' stopped
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/multisource.result b/mysql-test/suite/multi_source/multisource.result
index 227e88f6d71..d99a377f0c5 100644
--- a/mysql-test/suite/multi_source/multisource.result
+++ b/mysql-test/suite/multi_source/multisource.result
@@ -1,3 +1,4 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'abc' to relay_log_file='';
ERROR HY000: Failed initializing relay log position: Could not find target log during relay log initialization
change master 'abc2' to master_host='';
@@ -9,6 +10,8 @@ master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connection slave;
#
# Checking SHOW SLAVE 'master1' STATUS
#
@@ -39,11 +42,13 @@ Last_Errno = '0'
Last_SQL_Errno = '0'
Slave_heartbeat_period = '60.000'
#
+connection master1;
drop database if exists db1;
create database db1;
use db1;
create table t1 (i int auto_increment, f1 varchar(16), primary key pk (i,f1)) engine=MyISAM;
insert into t1 (f1) values ('one'),('two');
+connection slave;
select * from db1.t1;
i f1
1 one
@@ -115,13 +120,18 @@ Last_SQL_Errno = '0'
Slave_heartbeat_period = '60.000'
Slave_heartbeat_period = '60.000'
#
+connection master1;
insert into t1 (f1) values ('three');
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
drop database if exists db2;
create database db2;
use db2;
create table t1 (pk int auto_increment primary key, f1 int) engine=InnoDB;
begin;
insert into t1 (f1) values (1),(2);
+connection slave;
+connection master2;
+connection slave;
select * from db1.t1;
i f1
1 one
@@ -129,18 +139,24 @@ i f1
3 three
select * from db2.t1;
pk f1
+connection master2;
commit;
+connection slave;
select * from db2.t1;
pk f1
1 1
2 2
+connection master1;
flush logs;
+connection slave;
+connection master1;
purge binary logs to 'master-bin.000002';
show binary logs;
Log_name File_size
master-bin.000002 filesize
insert into t1 (f1) values ('four');
create table db1.t3 (f1 int) engine=InnoDB;
+connection slave;
#
# Checking SHOW ALL SLAVES STATUS
#
@@ -188,6 +204,8 @@ mysqld-relay-bin.000002 # Gtid # # BEGIN GTID #-#-#
mysqld-relay-bin.000002 # Intvar # # INSERT_ID=1
mysqld-relay-bin.000002 # Query # # use `db2`; insert into t1 (f1) values (1),(2)
mysqld-relay-bin.000002 # Xid # # COMMIT /* XID */
+disconnect slave;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
stop slave io_thread;
show status like 'Slave_running';
Variable_name Value
@@ -199,7 +217,12 @@ Slave_running ON
drop database db1;
drop database db2;
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
drop database db1;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
drop database db2;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/relaylog_events.result b/mysql-test/suite/multi_source/relaylog_events.result
index b96d71f4183..5a4f480b32b 100644
--- a/mysql-test/suite/multi_source/relaylog_events.result
+++ b/mysql-test/suite/multi_source/relaylog_events.result
@@ -1,3 +1,4 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
@@ -5,8 +6,10 @@ master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
drop table if exists t1;
create table t1 (i int) engine=MyISAM;
+connection slave;
mysqld-relay-bin-master1.000001
mysqld-relay-bin-master1.000002
mysqld-relay-bin-master1.index
@@ -25,6 +28,11 @@ include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
mysqld-relay-bin-master1.000001 # Format_desc # # SERVER_VERSION, BINLOG_VERSION
mysqld-relay-bin-master1.000001 # Rotate # # mysqld-relay-bin-master1.000002;pos=4
+connection master1;
drop table t1;
+connection slave;
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
include/reset_master_slave.inc
+disconnect master1;
diff --git a/mysql-test/suite/multi_source/reset_slave.result b/mysql-test/suite/multi_source/reset_slave.result
index 6a9dbcdc561..926c603f701 100644
--- a/mysql-test/suite/multi_source/reset_slave.result
+++ b/mysql-test/suite/multi_source/reset_slave.result
@@ -1,3 +1,4 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
@@ -5,9 +6,11 @@ master_user='root';
start slave 'master1';
set default_master_connection = 'master1';
include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
drop table if exists t1;
create table t1 (i int) engine=MyISAM;
insert into t1 values (1),(2);
+connection slave;
stop slave 'master1';
show slave 'master1' status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode
@@ -24,5 +27,8 @@ show slave 'master1' status;
ERROR HY000: There is no master connection 'master1'
drop table t1;
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
drop table t1;
include/reset_master_slave.inc
+disconnect master1;
diff --git a/mysql-test/suite/multi_source/simple.result b/mysql-test/suite/multi_source/simple.result
index 3bf25e8d788..cabad76d7e6 100644
--- a/mysql-test/suite/multi_source/simple.result
+++ b/mysql-test/suite/multi_source/simple.result
@@ -1,3 +1,7 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
+connection slave;
change master 'slave1' to master_port=MYPORT_1, master_host='127.0.0.1', master_user='root';
change master 'slave2' to master_port=MYPORT_2, master_host='127.0.0.1', master_user='root';
start slave 'slave1';
@@ -9,6 +13,10 @@ Warnings:
Note 1937 SLAVE 'slave2' started
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection master1;
+connection slave;
+connection master2;
+connection slave;
show all slaves status;
Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master Master_SSL_Verify_Server_Cert Last_IO_Errno Last_IO_Error Last_SQL_Errno Last_SQL_Error Replicate_Ignore_Server_Ids Master_Server_Id Master_SSL_Crl Master_SSL_Crlpath Using_Gtid Gtid_IO_Pos Replicate_Do_Domain_Ids Replicate_Ignore_Domain_Ids Parallel_Mode Retried_transactions Max_relay_log_size Executed_log_entries Slave_received_heartbeats Slave_heartbeat_period Gtid_Slave_Pos
slave1 Slave has read all relay log; waiting for the slave I/O thread to update it Waiting for master to send event 127.0.0.1 root MYPORT_1 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave1.000002 <relay_log_pos> master-bin.000001 Yes Yes 0 0 <read_master_log_pos> <relay_log_space1> None 0 No 0 No 0 0 1 No conservative 0 1073741824 7 0 60.000
@@ -80,5 +88,10 @@ Connection_name Slave_SQL_State Slave_IO_State Master_Host Master_User Master_Po
slave2 127.0.0.1 root MYPORT_2 60 master-bin.000001 <read_master_log_pos> mysqld-relay-bin-slave2.000002 <relay_log_pos> master-bin.000001 No No 0 0 <read_master_log_pos> <relay_log_space1> None 0 No NULL No 0 0 2 No conservative 0 1073741824 7 0 60.000
stop all slaves;
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/skip_counter.result b/mysql-test/suite/multi_source/skip_counter.result
index 10226e2ba4e..03103af21b9 100644
--- a/mysql-test/suite/multi_source/skip_counter.result
+++ b/mysql-test/suite/multi_source/skip_counter.result
@@ -1,11 +1,14 @@
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
drop database if exists db;
create database db;
create table db.this_will_not_be_replicated (i int) engine=MyISAM;
create table db.t1 (i int) engine=MyISAM;
create table db.t2 (i int) engine=MyISAM;
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
drop database if exists db;
create database db;
create table db.t3 (i int) engine=MyISAM;
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
change master 'master1' to
master_port=MYPORT_1,
master_host='127.0.0.1',
@@ -100,6 +103,8 @@ select @@global.max_relay_log_size;
start slave 'master2';
include/wait_for_slave_to_start.inc
set default_master_connection = '';
+connection master2;
+connection slave;
show tables in db;
Tables_in_db
t1
@@ -111,7 +116,12 @@ set global sql_slave_skip_counter = 0;
set global max_relay_log_size = 1073741824;
set global max_binlog_size = 1073741824;
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
drop database db;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
drop database db;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/status_vars.result b/mysql-test/suite/multi_source/status_vars.result
index 12917f94140..35a58e0fef1 100644
--- a/mysql-test/suite/multi_source/status_vars.result
+++ b/mysql-test/suite/multi_source/status_vars.result
@@ -1,3 +1,4 @@
+connect slave,127.0.0.1,root,,,$SERVER_MYPORT_3;
call mtr.add_suppression("Connection 'master1' already exists");
change master 'master1' to
master_port=MYPORT_1,
@@ -74,8 +75,10 @@ Slave_received_heartbeats 1
set default_master_connection = '';
start slave;
include/wait_for_slave_to_start.inc
+connect master1,127.0.0.1,root,,,$SERVER_MYPORT_1;
set binlog_format = statement;
create temporary table tmp1 (i int) engine=MyISAM;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
@@ -83,8 +86,10 @@ set default_master_connection = 'master1';
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
+connect master2,127.0.0.1,root,,,$SERVER_MYPORT_2;
set binlog_format = statement;
create temporary table tmp1 (i int) engine=MyISAM;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 2
@@ -93,5 +98,10 @@ show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 2
include/reset_master_slave.inc
+disconnect slave;
+connection master1;
include/reset_master_slave.inc
+disconnect master1;
+connection master2;
include/reset_master_slave.inc
+disconnect master2;
diff --git a/mysql-test/suite/multi_source/syntax.result b/mysql-test/suite/multi_source/syntax.result
index 55b124bf5a1..7059234472a 100644
--- a/mysql-test/suite/multi_source/syntax.result
+++ b/mysql-test/suite/multi_source/syntax.result
@@ -35,6 +35,7 @@ master_pos_wait('master-bin.999999',0,2,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
NULL
Warnings:
Warning 1210 Incorrect arguments to MASTER_CONNECTION_NAME
+connection slave;
#
# checking usage of default_master_connection;
#
diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result
index 5973c8ade46..ad8f67d9d18 100644
--- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result
+++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug41029.result
@@ -2,6 +2,9 @@ select @default_binlog_format:=@@global.binlog_format;
@default_binlog_format:=@@global.binlog_format
STATEMENT
set global binlog_format=row;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
set session debug_dbug="+d,optimizer_innodb_ds_mrr";
set autocommit=0;
use test;
@@ -20,6 +23,7 @@ select * from t1 where a > 2 for update;
dummy a b
3 3 3
5 5 5
+connection con2;
use test;
set autocommit=0;
start transaction;
@@ -29,6 +33,8 @@ select 1;
insert into t1 values(2,2,2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
rollback;
+connection con1;
rollback;
drop table t1;
+connection default;
set global binlog_format=@default_binlog_format;
diff --git a/mysql-test/suite/parts/inc/part_exch_qa_5.inc b/mysql-test/suite/parts/inc/part_exch_qa_5.inc
index 1ad28df5f8c..6825571165c 100644
--- a/mysql-test/suite/parts/inc/part_exch_qa_5.inc
+++ b/mysql-test/suite/parts/inc/part_exch_qa_5.inc
@@ -7,7 +7,6 @@ GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, INSERT, SELECT ON test.* TO test1@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
---echo connect (test1,localhost,test1,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test1,localhost,test1,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
SELECT current_user();
SHOW GRANTS FOR CURRENT_USER;
@@ -18,11 +17,9 @@ SHOW GRANTS FOR CURRENT_USER;
--enable_query_log
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo disconnect test1;
disconnect test1;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SELECT current_user();
@@ -52,14 +49,11 @@ ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
SELECT * FROM tsp_00;
--sorted_result
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
REVOKE ALTER ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SELECT current_user();
@@ -77,9 +71,7 @@ ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
---echo connection default;
connection default;
---echo disconnect test2;
disconnect test2;
--source suite/parts/inc/part_exch_drop_tabs.inc
diff --git a/mysql-test/suite/parts/inc/part_exch_qa_7.inc b/mysql-test/suite/parts/inc/part_exch_qa_7.inc
index d8809902d51..e6276fe3ca2 100644
--- a/mysql-test/suite/parts/inc/part_exch_qa_7.inc
+++ b/mysql-test/suite/parts/inc/part_exch_qa_7.inc
@@ -14,7 +14,6 @@ CREATE USER test_2@localhost;
--send
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo connect (test_2,localhost,test_2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test_2,localhost,test_2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
# Wait until exchange has been done.
let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=1;
@@ -31,7 +30,6 @@ INSERT INTO tp VALUES (7,"Seven");
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo connection default;
connection default;
--echo reap;
reap;
@@ -40,7 +38,6 @@ SELECT * FROM t_10;
--sorted_result
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
---echo connection test_2;
connection test_2;
let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=2;
--source include/wait_condition.inc
@@ -48,10 +45,8 @@ let $wait_condition= SELECT count(a)>0 FROM tp WHERE a=2;
SELECT * FROM t_10;
--sorted_result
SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
---echo disconnect test_2;
disconnect test_2;
---echo connection default;
connection default;
--sorted_result
SELECT * FROM t_10;
@@ -60,4 +55,3 @@ SELECT * FROM tp WHERE a BETWEEN 0 AND 10;
--source suite/parts/inc/part_exch_drop_tabs.inc
DROP USER test_2@localhost;
-
diff --git a/mysql-test/suite/parts/inc/part_exch_qa_8.inc b/mysql-test/suite/parts/inc/part_exch_qa_8.inc
index af0b5a9c6cd..56c050e3481 100644
--- a/mysql-test/suite/parts/inc/part_exch_qa_8.inc
+++ b/mysql-test/suite/parts/inc/part_exch_qa_8.inc
@@ -20,7 +20,6 @@ GRANT CREATE, ALTER, DROP, INSERT, SELECT on test.* TO test2@localhost;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on testdb.* TO test2@localhost;
# 8) Exchanges partition and table and back in 2 sessions with 2 databases.
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
# Privileges on both DB's
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
@@ -46,26 +45,20 @@ ALTER TABLE testdb.tp EXCHANGE PARTITION p0 WITH TABLE t_10;
SELECT * FROM t_10;
--sorted_result
SELECT * FROM testdb.tp WHERE a BETWEEN 0 AND 10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
REVOKE INSERT ON testdb.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE testdb.tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
--source suite/parts/inc/part_exch_drop_tabs.inc
DROP USER test2@localhost;
DROP DATABASE testdb;
-
diff --git a/mysql-test/suite/parts/inc/partition_auto_increment.inc b/mysql-test/suite/parts/inc/partition_auto_increment.inc
index e3a8d681275..199c8680864 100644
--- a/mysql-test/suite/parts/inc/partition_auto_increment.inc
+++ b/mysql-test/suite/parts/inc/partition_auto_increment.inc
@@ -356,7 +356,6 @@ DROP TABLE t1;
-- echo # Test with two threads
connection default;
--- echo # con default
eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = $engine
PARTITION BY HASH(c1)
@@ -365,32 +364,26 @@ INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
connect(con1, localhost, root,,);
connection con1;
--- echo # con1
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
connection default;
--- echo # con default
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
--- echo # con1
connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
connection default;
--- echo # con default
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
INSERT INTO t1 (c1) VALUES (16);
if ($mysql_errno)
{
echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
}
--- echo # con1
connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
disconnect con1;
connection default;
--- echo # con default
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
DROP TABLE t1;
@@ -398,35 +391,29 @@ DROP TABLE t1;
-- echo # Test with two threads + start transaction NO PARTITIONING
connect(con1, localhost, root,,);
connection default;
--- echo # con default
eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = $engine;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
connection con1;
--- echo # con1
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
connection default;
--- echo # con default
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
--- echo # con1
connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
connection default;
--- echo # con default
-- error 0, ER_DUP_KEY
INSERT INTO t1 (c1) VALUES (16);
if ($mysql_errno)
{
echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
}
--- echo # con1
connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
@@ -434,7 +421,6 @@ COMMIT;
SELECT * FROM t1 ORDER BY c1;
disconnect con1;
connection default;
--- echo # con default
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
COMMIT;
@@ -444,7 +430,6 @@ DROP TABLE t1;
-- echo # Test with two threads + start transaction
connect(con1, localhost, root,,);
connection default;
--- echo # con default
eval CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = $engine
PARTITION BY HASH(c1)
@@ -453,25 +438,20 @@ START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
connection con1;
--- echo # con1
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
connection default;
--- echo # con default
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
--- echo # con1
connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
connection default;
--- echo # con default
-- error 0, ER_DUP_ENTRY, ER_DUP_KEY
INSERT INTO t1 (c1) VALUES (16);
if ($mysql_errno)
{
echo # ERROR (only OK if Archive) mysql_errno: $mysql_errno;
}
--- echo # con1
connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
@@ -479,7 +459,6 @@ COMMIT;
SELECT * FROM t1 ORDER BY c1;
disconnect con1;
connection default;
--- echo # con default
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
COMMIT;
diff --git a/mysql-test/suite/parts/inc/partition_exchange.inc b/mysql-test/suite/parts/inc/partition_exchange.inc
index f5ecddd13a4..95a67a339d0 100644
--- a/mysql-test/suite/parts/inc/partition_exchange.inc
+++ b/mysql-test/suite/parts/inc/partition_exchange.inc
@@ -152,7 +152,6 @@ SELECT * FROM tp;
SET AUTOCOMMIT = 1;
connect(con1, localhost, root,,);
---echo # con1
SET DEBUG_SYNC= 'swap_partition_after_compare_tables SIGNAL swap_in_progress WAIT_FOR goto_verification';
SET DEBUG_SYNC= 'swap_partition_first_row_read SIGNAL swap_in_progress WAIT_FOR goto_wait';
SET DEBUG_SYNC= 'swap_partition_after_wait SIGNAL swap_in_progress WAIT_FOR goto_rename';
@@ -160,7 +159,6 @@ SET DEBUG_SYNC= 'swap_partition_before_rename SIGNAL swap_in_progress WAIT_FOR t
send ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
connection default;
---echo # con default
SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress';
--echo # select from t and select/update/delete/insert from tp should work
SELECT * FROM t WHERE a = 99;
@@ -315,10 +313,8 @@ SHOW CREATE TABLE tp;
SET DEBUG_SYNC= 'now SIGNAL test_done';
connection con1;
---echo # con1
--reap
connection default;
---echo # con default
--echo # Tables should now be as normal
SHOW CREATE TABLE t;
SHOW CREATE TABLE tp;
@@ -347,7 +343,6 @@ eval ALTER TABLE tp ENGINE = $engine;
disconnect con1;
connection default;
---echo # con default
SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
SHOW CREATE TABLE tp;
@@ -357,5 +352,3 @@ SELECT * FROM t;
SELECT * FROM tp;
DROP TABLE t, tp, tsp;
-
-
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_archive.result b/mysql-test/suite/parts/r/partition_auto_increment_archive.result
index f62e4aa005a..c9a2103f2ce 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_archive.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_archive.result
@@ -398,29 +398,31 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Archive'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
# ERROR (only OK if Archive) mysql_errno: 1022
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -437,27 +439,28 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Archive';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
# ERROR (only OK if Archive) mysql_errno: 1022
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -484,7 +487,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -515,7 +519,8 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Archive'
PARTITION BY HASH(c1)
@@ -523,18 +528,18 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
# ERROR (only OK if Archive) mysql_errno: 1022
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -561,7 +566,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
index 03e87bc22fb..e1d5814dc45 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_blackhole.result
@@ -356,60 +356,64 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Blackhole'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Blackhole';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
COMMIT;
SELECT * FROM t1 ORDER BY c1;
c1
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -418,7 +422,8 @@ SELECT * FROM t1 ORDER BY c1;
c1
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Blackhole'
PARTITION BY HASH(c1)
@@ -426,24 +431,25 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
COMMIT;
SELECT * FROM t1 ORDER BY c1;
c1
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
index 34e47f58272..63bd8a83b70 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_innodb.result
@@ -445,28 +445,30 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'InnoDB'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -484,26 +486,27 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'InnoDB';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -518,7 +521,8 @@ c1
10
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -551,7 +555,8 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'InnoDB'
PARTITION BY HASH(c1)
@@ -559,17 +564,17 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -584,7 +589,8 @@ c1
10
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_maria.result b/mysql-test/suite/parts/r/partition_auto_increment_maria.result
index b9310a2a314..9a38ae6b8d5 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_maria.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_maria.result
@@ -444,28 +444,30 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Aria'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -483,26 +485,27 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Aria';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -531,7 +534,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -564,7 +568,8 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Aria'
PARTITION BY HASH(c1)
@@ -572,17 +577,17 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -611,7 +616,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_memory.result b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
index c3a5073b029..e6240f1bb40 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_memory.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_memory.result
@@ -444,28 +444,30 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Memory'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -483,26 +485,27 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Memory';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -531,7 +534,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -564,7 +568,8 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'Memory'
PARTITION BY HASH(c1)
@@ -572,17 +577,17 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -611,7 +616,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
index ad440155d33..32e75205f3b 100644
--- a/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
+++ b/mysql-test/suite/parts/r/partition_auto_increment_myisam.result
@@ -444,28 +444,30 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'MyISAM'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -483,26 +485,27 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'MyISAM';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -531,7 +534,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -564,7 +568,8 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'MyISAM'
PARTITION BY HASH(c1)
@@ -572,17 +577,17 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -611,7 +616,8 @@ c1
21
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
index 77129d6bebb..9a62988087e 100644
--- a/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
+++ b/mysql-test/suite/parts/r/partition_debug_sync_innodb.result
@@ -15,9 +15,9 @@ a
1
21
33
-# con1 (send)
+connect con1, localhost, root,,;
ALTER TABLE t1 TRUNCATE PARTITION pMax;
-# con default
+connection default;
SELECT * FROM t1;
a
1
@@ -25,9 +25,9 @@ a
33
# Commit will allow the TRUNCATE to finish
COMMIT;
-# con1 (reap)
-# con1 (disconnect)
-# default connection
+connection con1;
+disconnect con1;
+connection default;
SELECT * FROM t1;
a
1
@@ -62,6 +62,7 @@ SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
PARTITION_DESCRIPTION, TABLE_ROWS
FROM INFORMATION_SCHEMA.PARTITIONS
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+connect con1, localhost, root,,;
SET DEBUG_SYNC = 'now WAIT_FOR parked';
# When waiting for the name lock in get_all_tables in sql_show.cc
# this will not be concurrent any more, thus the TIMEOUT
@@ -73,6 +74,8 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
PARTITION p10 VALUES LESS THAN MAXVALUE);
Warnings:
Warning 1639 debug sync point wait timed out
+disconnect con1;
+connection default;
TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS
test t1 p0 1 10 1
test t1 p10 2 MAXVALUE 3
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
index e539c37a0b4..03ef0ed2c09 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_innodb.result
@@ -4,7 +4,7 @@ GRANT USAGE ON *.* TO test1@localhost;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, INSERT, SELECT ON test.* TO test1@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
-connect (test1,localhost,test1,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test1,localhost,test1,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SELECT current_user();
current_user()
test1@localhost
@@ -15,7 +15,7 @@ GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SELECT current_user();
current_user()
@@ -73,7 +73,7 @@ a b
disconnect test2;
connection default;
REVOKE ALTER ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SELECT current_user();
current_user()
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
index e539c37a0b4..03ef0ed2c09 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_5_myisam.result
@@ -4,7 +4,7 @@ GRANT USAGE ON *.* TO test1@localhost;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, INSERT, SELECT ON test.* TO test1@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
-connect (test1,localhost,test1,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test1,localhost,test1,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SELECT current_user();
current_user()
test1@localhost
@@ -15,7 +15,7 @@ GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SELECT current_user();
current_user()
@@ -73,7 +73,7 @@ a b
disconnect test2;
connection default;
REVOKE ALTER ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SELECT current_user();
current_user()
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_6.result b/mysql-test/suite/parts/r/partition_exch_qa_6.result
index 92527ab1dd9..bef277f695a 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_6.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_6.result
@@ -1,7 +1,7 @@
CREATE USER test2@localhost;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
@@ -56,7 +56,7 @@ a b
disconnect test2;
connection default;
REVOKE INSERT ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
@@ -68,7 +68,7 @@ disconnect test2;
connection default;
GRANT INSERT ON test.* TO test2@localhost;
REVOKE CREATE ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
@@ -80,7 +80,7 @@ disconnect test2;
connection default;
GRANT CREATE ON test.* TO test2@localhost;
REVOKE DROP ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SHOW GRANTS FOR CURRENT_USER;
Grants for test2@localhost
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
index 8ae4bfd3d3a..0913bbaa55b 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_7_innodb.result
@@ -1,7 +1,7 @@
CREATE USER test_2@localhost;
send
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
-connect (test_2,localhost,test_2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test_2,localhost,test_2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SELECT * FROM t_10;
a b
2 Two
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
index 8ae4bfd3d3a..0913bbaa55b 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_7_myisam.result
@@ -1,7 +1,7 @@
CREATE USER test_2@localhost;
send
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
-connect (test_2,localhost,test_2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test_2,localhost,test_2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SELECT * FROM t_10;
a b
2 Two
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result b/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
index b252fc616b1..2fd45be9261 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_8_innodb.result
@@ -4,7 +4,7 @@ USE testdb;
USE test;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on test.* TO test2@localhost;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on testdb.* TO test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
SELECT * FROM testdb.t_10;
a b
@@ -60,7 +60,7 @@ a b
disconnect test2;
connection default;
REVOKE INSERT ON testdb.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 't_10'
ALTER TABLE testdb.tp EXCHANGE PARTITION p0 WITH TABLE t_10;
diff --git a/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result b/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
index b252fc616b1..2fd45be9261 100755..100644
--- a/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exch_qa_8_myisam.result
@@ -4,7 +4,7 @@ USE testdb;
USE test;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on test.* TO test2@localhost;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on testdb.* TO test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
SELECT * FROM testdb.t_10;
a b
@@ -60,7 +60,7 @@ a b
disconnect test2;
connection default;
REVOKE INSERT ON testdb.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 't_10'
ALTER TABLE testdb.tp EXCHANGE PARTITION p0 WITH TABLE t_10;
diff --git a/mysql-test/suite/parts/r/partition_exchange_innodb.result b/mysql-test/suite/parts/r/partition_exchange_innodb.result
index f0e4923d39a..3070f7c3932 100644
--- a/mysql-test/suite/parts/r/partition_exchange_innodb.result
+++ b/mysql-test/suite/parts/r/partition_exchange_innodb.result
@@ -147,13 +147,13 @@ a b
64 Sixty four
# Start by testing read/write locking
SET AUTOCOMMIT = 1;
-# con1
+connect con1, localhost, root,,;
SET DEBUG_SYNC= 'swap_partition_after_compare_tables SIGNAL swap_in_progress WAIT_FOR goto_verification';
SET DEBUG_SYNC= 'swap_partition_first_row_read SIGNAL swap_in_progress WAIT_FOR goto_wait';
SET DEBUG_SYNC= 'swap_partition_after_wait SIGNAL swap_in_progress WAIT_FOR goto_rename';
SET DEBUG_SYNC= 'swap_partition_before_rename SIGNAL swap_in_progress WAIT_FOR test_done';
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
-# con default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress';
# select from t and select/update/delete/insert from tp should work
SELECT * FROM t WHERE a = 99;
@@ -295,8 +295,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE tp;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL test_done';
-# con1
-# con default
+connection con1;
+connection default;
# Tables should now be as normal
SHOW CREATE TABLE t;
Table Create Table
@@ -329,7 +329,8 @@ INSERT INTO tp VALUES (63, "Sixty three, new"), (59, "To be deleted");
DELETE FROM tp WHERE a = 3;
ALTER TABLE t ENGINE = 'InnoDB';
ALTER TABLE tp ENGINE = 'InnoDB';
-# con default
+disconnect con1;
+connection default;
SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
diff --git a/mysql-test/suite/parts/r/partition_exchange_memory.result b/mysql-test/suite/parts/r/partition_exchange_memory.result
index 9cc42791905..edd3667a484 100644
--- a/mysql-test/suite/parts/r/partition_exchange_memory.result
+++ b/mysql-test/suite/parts/r/partition_exchange_memory.result
@@ -147,13 +147,13 @@ a b
64 Sixty four
# Start by testing read/write locking
SET AUTOCOMMIT = 1;
-# con1
+connect con1, localhost, root,,;
SET DEBUG_SYNC= 'swap_partition_after_compare_tables SIGNAL swap_in_progress WAIT_FOR goto_verification';
SET DEBUG_SYNC= 'swap_partition_first_row_read SIGNAL swap_in_progress WAIT_FOR goto_wait';
SET DEBUG_SYNC= 'swap_partition_after_wait SIGNAL swap_in_progress WAIT_FOR goto_rename';
SET DEBUG_SYNC= 'swap_partition_before_rename SIGNAL swap_in_progress WAIT_FOR test_done';
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
-# con default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress';
# select from t and select/update/delete/insert from tp should work
SELECT * FROM t WHERE a = 99;
@@ -295,8 +295,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE tp;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL test_done';
-# con1
-# con default
+connection con1;
+connection default;
# Tables should now be as normal
SHOW CREATE TABLE t;
Table Create Table
@@ -329,7 +329,8 @@ INSERT INTO tp VALUES (63, "Sixty three, new"), (59, "To be deleted");
DELETE FROM tp WHERE a = 3;
ALTER TABLE t ENGINE = 'Memory';
ALTER TABLE tp ENGINE = 'Memory';
-# con default
+disconnect con1;
+connection default;
SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
diff --git a/mysql-test/suite/parts/r/partition_exchange_myisam.result b/mysql-test/suite/parts/r/partition_exchange_myisam.result
index c31e2a6ee89..9ad0b9f2728 100644
--- a/mysql-test/suite/parts/r/partition_exchange_myisam.result
+++ b/mysql-test/suite/parts/r/partition_exchange_myisam.result
@@ -147,13 +147,13 @@ a b
64 Sixty four
# Start by testing read/write locking
SET AUTOCOMMIT = 1;
-# con1
+connect con1, localhost, root,,;
SET DEBUG_SYNC= 'swap_partition_after_compare_tables SIGNAL swap_in_progress WAIT_FOR goto_verification';
SET DEBUG_SYNC= 'swap_partition_first_row_read SIGNAL swap_in_progress WAIT_FOR goto_wait';
SET DEBUG_SYNC= 'swap_partition_after_wait SIGNAL swap_in_progress WAIT_FOR goto_rename';
SET DEBUG_SYNC= 'swap_partition_before_rename SIGNAL swap_in_progress WAIT_FOR test_done';
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
-# con default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress';
# select from t and select/update/delete/insert from tp should work
SELECT * FROM t WHERE a = 99;
@@ -295,8 +295,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE tp;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL test_done';
-# con1
-# con default
+connection con1;
+connection default;
# Tables should now be as normal
SHOW CREATE TABLE t;
Table Create Table
@@ -329,7 +329,8 @@ INSERT INTO tp VALUES (63, "Sixty three, new"), (59, "To be deleted");
DELETE FROM tp WHERE a = 3;
ALTER TABLE t ENGINE = 'MyISAM';
ALTER TABLE tp ENGINE = 'MyISAM';
-# con default
+disconnect con1;
+connection default;
SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
diff --git a/mysql-test/suite/parts/r/partition_innodb_status_file.result b/mysql-test/suite/parts/r/partition_innodb_status_file.result
index 29b5a3b3766..13cc9b094c3 100644
--- a/mysql-test/suite/parts/r/partition_innodb_status_file.result
+++ b/mysql-test/suite/parts/r/partition_innodb_status_file.result
@@ -2,13 +2,14 @@ CREATE TABLE t1 (a INT) ENGINE = InnoDB PARTITION BY HASH(a);
INSERT INTO t1 VALUES (0), (1), (2);
START TRANSACTION;
UPDATE t1 SET a = 5 WHERE a = 1;
-# Connection con1
+connect con1, localhost, root,,;
# InnoDB lock timeout and monitor thread runs every 15 seconds
SET innodb_lock_wait_timeout = 20;
START TRANSACTION;
UPDATE t1 SET a = 3 WHERE a = 1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
COMMIT;
-# Connection default
+disconnect con1;
+connection default;
COMMIT;
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/r/partition_special_innodb.result b/mysql-test/suite/parts/r/partition_special_innodb.result
index 1a513aa3d5f..78d15373924 100644
--- a/mysql-test/suite/parts/r/partition_special_innodb.result
+++ b/mysql-test/suite/parts/r/partition_special_innodb.result
@@ -215,22 +215,33 @@ PRIMARY KEY (a))
ENGINE = InnoDB
PARTITION BY HASH (a)
PARTITIONS 2;
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
SET autocommit=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2');
+connection con2;
SET autocommit=OFF;
SET SESSION lock_wait_timeout= 1;
ALTER TABLE t1 AUTO_INCREMENT = 10;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+disconnect con2;
+disconnect con1;
+connection default;
DROP TABLE t1;
#
# Bug#53676: Unexpected errors and possible table corruption on
# ADD PARTITION and LOCK TABLE
+connect con1,localhost,root,,;
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+connect con2,localhost,root,,;
SET lock_wait_timeout = 2;
+connection con1;
#Connection 1 locks the table
LOCK TABLE t1 READ;
+connection con2;
# Connection 2 tries to add partitions:
# First attempt: lock wait timeout (as expected)
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
@@ -238,9 +249,11 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# Second attempt: says that partition already exists
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
# Connection 1 unlocks the table and locks it again:
UNLOCK TABLES;
LOCK TABLE t1 READ;
+connection con2;
# Connection 2 tries again to add partitions:
# Third attempt: says that the table does not exist
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
@@ -249,39 +262,57 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
+connection con1;
UNLOCK TABLES;
+connection con2;
DROP TABLE t1;
+connection con1;
CREATE TABLE t2 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+connection con2;
SET lock_wait_timeout = 2;
+connection con1;
LOCK TABLE t2 READ;
+connection con2;
ALTER TABLE t2 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE t2 ADD PARTITION PARTITIONS 2;
+connection con1;
UNLOCK TABLES;
+connection con2;
+connect con3,localhost,root,,;
CHECK TABLE t2;
Table Op Msg_type Msg_text
test.t2 check status OK
SELECT * FROM t2;
i f
DROP TABLE t2;
+connection con1;
CREATE TABLE t3 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = InnoDB PARTITION BY HASH(i) PARTITIONS 2;
+connection con2;
SET lock_wait_timeout = 2;
+connection con1;
# Connection 1 locks the table
LOCK TABLE t3 READ;
+connection con2;
# Connection 2 tries to add partitions (timeout):
ALTER TABLE t3 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con3;
SET lock_wait_timeout = 2;
# Connection 3 tries to add partitions (partition already exists):
ALTER TABLE t3 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connect con4,localhost,root,,;
# Connection 4 tries to rename the table:
RENAME TABLE t3 TO t4;
+connection con1;
# Connection 1 unlocks the table:
UNLOCK TABLES;
+connection con4;
# Connection 4 gets error on rename:
+connect con5,localhost,root,,;
# SHOW TABLES returns the table (not renamed):
SHOW TABLES;
Tables_in_test
@@ -290,3 +321,9 @@ t4
SELECT * FROM t3;
ERROR 42S02: Table 'test.t3' doesn't exist
DROP TABLE t4;
+disconnect con5;
+disconnect con4;
+disconnect con3;
+disconnect con2;
+disconnect con1;
+connection default;
diff --git a/mysql-test/suite/parts/r/partition_special_myisam.result b/mysql-test/suite/parts/r/partition_special_myisam.result
index d300d6d2d44..9e82019e9bc 100644
--- a/mysql-test/suite/parts/r/partition_special_myisam.result
+++ b/mysql-test/suite/parts/r/partition_special_myisam.result
@@ -212,17 +212,19 @@ drop table t1;
# after timed out COALESCE PARTITION
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = MyISAM PARTITION BY HASH(i) PARTITIONS 3;
-# Connection 1 starts transaction and gets lock
START TRANSACTION;
SELECT * FROM t1;
i f
+connect con2,localhost,root,,;
SET lock_wait_timeout = 2;
-# Connection 2 tries to coalesce partitions (timeout):
ALTER TABLE t1 COALESCE PARTITION 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
-# Connection 3 tries to load into the table:
+connect con3,localhost,root,,;
LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);
-# Connection 1 commits the transaction
+connection default;
COMMIT;
-# Connection 3...
+connection con3;
DROP TABLE t1;
+disconnect con3;
+disconnect con2;
+connection default;
diff --git a/mysql-test/suite/parts/r/rpl_partition.result b/mysql-test/suite/parts/r/rpl_partition.result
index 2e6f0a5d1ba..9969d53a3d7 100644
--- a/mysql-test/suite/parts/r/rpl_partition.result
+++ b/mysql-test/suite/parts/r/rpl_partition.result
@@ -7,7 +7,7 @@ SET SESSION binlog_format = 'ROW';
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format ROW
@@session.binlog_format ROW
-[on slave]
+connection slave;
set @old_global_binlog_format= @@global.binlog_format;
set @old_session_binlog_format= @@session.binlog_format;
SET GLOBAL binlog_format = 'ROW';
@@ -17,7 +17,7 @@ select @@global.binlog_format, @@session.binlog_format;
@@session.binlog_format ROW
include/stop_slave.inc
include/start_slave.inc
-[on master]
+connection master;
CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
dt TIMESTAMP, user CHAR(255), uuidf LONGBLOB,
fkid MEDIUMINT, filler VARCHAR(255),
@@ -122,6 +122,8 @@ CALL p3();
commit;
SELECT count(*) as "Master byrange" FROM t3;
Master byrange 500
+connection slave;
+connection slave;
show create table t3;
Table t3
Create Table CREATE TABLE `t3` (
@@ -154,13 +156,14 @@ SELECT count(*) "Slave bykey" FROM t2;
Slave bykey 500
SELECT count(*) "Slave byrange" FROM t3;
Slave byrange 500
+connection master;
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
-[on slave]
+connection slave;
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
include/rpl_end.inc
diff --git a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
index df9c06011c2..d73333c3b8d 100644
--- a/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
+++ b/mysql-test/suite/parts/t/partition_debug_sync_innodb.test
@@ -20,12 +20,10 @@ DELETE FROM t1 WHERE a = 11;
SELECT * FROM t1;
--connect (con1, localhost, root,,)
---echo # con1 (send)
--send
ALTER TABLE t1 TRUNCATE PARTITION pMax;
--connection default
---echo # con default
let $wait_condition=
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = "Waiting for table metadata lock" AND
@@ -36,13 +34,10 @@ SELECT * FROM t1;
--echo # Commit will allow the TRUNCATE to finish
COMMIT;
---echo # con1 (reap)
--connection con1
--reap
---echo # con1 (disconnect)
--disconnect con1
--connection default
---echo # default connection
SELECT * FROM t1;
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/t/partition_exch_qa_6.test b/mysql-test/suite/parts/t/partition_exch_qa_6.test
index bad1e134af7..69b49a32813 100644
--- a/mysql-test/suite/parts/t/partition_exch_qa_6.test
+++ b/mysql-test/suite/parts/t/partition_exch_qa_6.test
@@ -19,7 +19,6 @@ CREATE USER test2@localhost;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
@@ -47,56 +46,44 @@ ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
SELECT * FROM tsp_00;
--sorted_result
SELECT * FROM tsp WHERE a BETWEEN 0 AND 10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
REVOKE INSERT ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
# Privilege for ALTER and SELECT
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
GRANT INSERT ON test.* TO test2@localhost;
REVOKE CREATE ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE tsp EXCHANGE PARTITION sp00 WITH TABLE tsp_00;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
GRANT CREATE ON test.* TO test2@localhost;
REVOKE DROP ON test.* FROM test2@localhost;
---echo connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
connect (test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
USE test;
SHOW GRANTS FOR CURRENT_USER;
# Privilege for ALTER and SELECT
--error ER_TABLEACCESS_DENIED_ERROR
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
---echo disconnect test2;
disconnect test2;
---echo connection default;
connection default;
--source suite/parts/inc/part_exch_drop_tabs.inc
DROP USER test2@localhost;
-
diff --git a/mysql-test/suite/parts/t/partition_innodb_status_file.test b/mysql-test/suite/parts/t/partition_innodb_status_file.test
index f066ce5d485..c5793d104db 100644
--- a/mysql-test/suite/parts/t/partition_innodb_status_file.test
+++ b/mysql-test/suite/parts/t/partition_innodb_status_file.test
@@ -6,7 +6,6 @@ INSERT INTO t1 VALUES (0), (1), (2);
START TRANSACTION;
UPDATE t1 SET a = 5 WHERE a = 1;
connect (con1, localhost, root,,);
---echo # Connection con1
--echo # InnoDB lock timeout and monitor thread runs every 15 seconds
SET innodb_lock_wait_timeout = 20;
START TRANSACTION;
@@ -15,6 +14,5 @@ UPDATE t1 SET a = 3 WHERE a = 1;
COMMIT;
disconnect con1;
connection default;
---echo # Connection default
COMMIT;
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/t/partition_special_myisam.test b/mysql-test/suite/parts/t/partition_special_myisam.test
index 2eac5b3bf16..5a573259373 100644
--- a/mysql-test/suite/parts/t/partition_special_myisam.test
+++ b/mysql-test/suite/parts/t/partition_special_myisam.test
@@ -50,13 +50,11 @@ let $engine= 'MyISAM';
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = MyISAM PARTITION BY HASH(i) PARTITIONS 3;
---echo # Connection 1 starts transaction and gets lock
START TRANSACTION;
SELECT * FROM t1;
--connect (con2,localhost,root,,)
SET lock_wait_timeout = 2;
---echo # Connection 2 tries to coalesce partitions (timeout):
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 COALESCE PARTITION 2;
@@ -68,16 +66,13 @@ ALTER TABLE t1 COALESCE PARTITION 2;
2
3
EOF
---echo # Connection 3 tries to load into the table:
send LOAD DATA INFILE 'load.in' INTO TABLE t1 (f);
--connection default
--real_sleep 1
---echo # Connection 1 commits the transaction
COMMIT;
--connection con3
---echo # Connection 3...
--reap
DROP TABLE t1;
diff --git a/mysql-test/suite/parts/t/rpl_partition.test b/mysql-test/suite/parts/t/rpl_partition.test
index e278b236f7b..529d94b2b31 100644
--- a/mysql-test/suite/parts/t/rpl_partition.test
+++ b/mysql-test/suite/parts/t/rpl_partition.test
@@ -12,7 +12,6 @@ set @old_session_binlog_format= @@session.binlog_format;
SET GLOBAL binlog_format = 'ROW';
SET SESSION binlog_format = 'ROW';
select @@global.binlog_format, @@session.binlog_format;
---echo [on slave]
connection slave;
set @old_global_binlog_format= @@global.binlog_format;
set @old_session_binlog_format= @@session.binlog_format;
@@ -23,7 +22,6 @@ select @@global.binlog_format, @@session.binlog_format;
# from @@global.binlog_format
--source include/stop_slave.inc
--source include/start_slave.inc
---echo [on master]
connection master;
eval CREATE TABLE t1(id MEDIUMINT NOT NULL AUTO_INCREMENT,
@@ -168,7 +166,6 @@ DROP TABLE t1, t2, t3;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
DROP PROCEDURE p3;
---echo [on slave]
sync_slave_with_master;
set @@global.binlog_format= @old_global_binlog_format;
set @@session.binlog_format= @old_session_binlog_format;
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.result b/mysql-test/suite/percona/percona_innodb_deadlock_count.result
index 00902e87feb..b2af780778d 100644
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.result
+++ b/mysql-test/suite/percona/percona_innodb_deadlock_count.result
@@ -1,6 +1,6 @@
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
-# Establish connection con3 (user=root)
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,root,,;
# Drop test table
drop table if exists t;
# Create test table
@@ -8,21 +8,21 @@ create table t(a INT PRIMARY KEY, b INT) engine=InnoDB;
# Insert two rows to test table
insert into t values(2,1);
insert into t values(1,2);
-# Switch to connection con1
+connection con1;
BEGIN;
SELECT b FROM t WHERE a=1 FOR UPDATE;
-# Switch to connection con2
+connection con2;
BEGIN;
SELECT b FROM t WHERE a=2 FOR UPDATE;
-# Switch to connection con1
+connection con1;
SELECT b FROM t WHERE a=2 FOR UPDATE;
-# Switch to connection con2
+connection con2;
SELECT b FROM t WHERE a=1 FOR UPDATE;
-# Switch to connection con1
+connection con1;
ROLLBACK;
-# Switch to connection con2
+connection con2;
ROLLBACK;
-# Switch to connection con3
+connection con3;
Deadlocks: 1
# Drop test table
drop table t;
diff --git a/mysql-test/suite/percona/percona_innodb_deadlock_count.test b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
index f953b9d7822..da1273bc038 100644
--- a/mysql-test/suite/percona/percona_innodb_deadlock_count.test
+++ b/mysql-test/suite/percona/percona_innodb_deadlock_count.test
@@ -1,9 +1,6 @@
--source include/have_xtradb.inc
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
---echo # Establish connection con3 (user=root)
connect (con3,localhost,root,,);
--echo # Drop test table
--disable_warnings
@@ -21,35 +18,28 @@ let $current = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHER
--disable_result_log
---echo # Switch to connection con1
connection con1;
BEGIN; SELECT b FROM t WHERE a=1 FOR UPDATE;
---echo # Switch to connection con2
connection con2;
BEGIN; SELECT b FROM t WHERE a=2 FOR UPDATE;
---echo # Switch to connection con1
connection con1;
SEND SELECT b FROM t WHERE a=2 FOR UPDATE;
---echo # Switch to connection con2
connection con2;
SEND SELECT b FROM t WHERE a=1 FOR UPDATE;
---echo # Switch to connection con1
connection con1;
--error 0, ER_LOCK_DEADLOCK
reap;
ROLLBACK;
---echo # Switch to connection con2
connection con2;
--error 0, ER_LOCK_DEADLOCK
reap;
ROLLBACK;
---echo # Switch to connection con3
connection con3;
let $result = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'Innodb_deadlocks'`;
diff --git a/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result b/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result
index c2b533ca9f3..233b55b8ac4 100644
--- a/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result
+++ b/mysql-test/suite/percona/percona_innodb_fake_changes_locks.result
@@ -2,18 +2,22 @@ DROP TABLE IF EXISTS t1;
# Verifying that X_LOCK not acquired
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
+connect conn1,localhost,root,,;
+connection conn1;
SET autocommit=0;
SET innodb_fake_changes=1;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
1
+connection default;
SET innodb_lock_wait_timeout=3;
UPDATE t1 SET a=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1 LOCK IN SHARE MODE;
a
1
+connection conn1;
ROLLBACK;
SET innodb_fake_changes=default;
DROP TABLE t1;
diff --git a/mysql-test/suite/perfschema/include/event_aggregate_load.inc b/mysql-test/suite/perfschema/include/event_aggregate_load.inc
index 4a1b3f02c03..68dbde276df 100644
--- a/mysql-test/suite/perfschema/include/event_aggregate_load.inc
+++ b/mysql-test/suite/perfschema/include/event_aggregate_load.inc
@@ -39,8 +39,6 @@ execute dump_hosts;
connect (con1, localhost, user1, , );
-echo "================== con1 connected ==================";
-
--connection default
# Wait for the connect to complete
@@ -76,8 +74,6 @@ select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
-echo "================== con1 marker ==================";
-
--connection default
# Wait for the payload to complete
@@ -113,8 +109,6 @@ execute dump_hosts;
connect (con2, localhost, user2, , );
-echo "================== con2 connected ==================";
-
--connection default
# Wait for the connect to complete
@@ -150,8 +144,6 @@ select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
-echo "================== con2 marker ==================";
-
--connection default
# Wait for the payload to complete
@@ -183,8 +175,6 @@ execute dump_hosts;
connect (con3, localhost, user3, , );
-echo "================== con3 connected ==================";
-
--connection default
# Wait for the connect to complete
@@ -220,8 +210,6 @@ select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
-echo "================== con3 marker ==================";
-
--connection default
# Wait for the payload to complete
@@ -253,8 +241,6 @@ execute dump_hosts;
connect (con4, localhost, user4, , );
-echo "================== con4 connected ==================";
-
--connection default
# Wait for the connect to complete
@@ -290,8 +276,6 @@ select get_lock("marker", 10);
select release_lock("marker");
insert into test.t1 values ("marker");
-echo "================== con4 marker ==================";
-
--connection default
# Wait for the payload to complete
@@ -331,8 +315,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
--source include/wait_condition.inc
-echo "================== con1 disconnected ==================";
-
echo "================== Step 10 ==================";
call dump_thread();
execute dump_waits_account;
@@ -364,8 +346,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
--source include/wait_condition.inc
-echo "================== con2 disconnected ==================";
-
echo "================== Step 11 ==================";
call dump_thread();
execute dump_waits_account;
@@ -397,8 +377,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
--source include/wait_condition.inc
-echo "================== con3 disconnected ==================";
-
echo "================== Step 12 ==================";
call dump_thread();
execute dump_waits_account;
@@ -430,8 +408,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
--source include/wait_condition.inc
-echo "================== con4 disconnected ==================";
-
echo "================== Step 13 ==================";
call dump_thread();
execute dump_waits_account;
diff --git a/mysql-test/suite/perfschema/include/table_aggregate_load.inc b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
index f42ebe1fc76..ae548d11627 100644
--- a/mysql-test/suite/perfschema/include/table_aggregate_load.inc
+++ b/mysql-test/suite/perfschema/include/table_aggregate_load.inc
@@ -90,8 +90,6 @@ select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
-echo "================== con1 marker ==================";
-
--connection default
echo "================== Step 3 ==================";
@@ -151,8 +149,6 @@ select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
-echo "================== con2 marker ==================";
-
--connection default
echo "================== Step 5 ==================";
@@ -208,8 +204,6 @@ select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
-echo "================== con3 marker ==================";
-
--connection default
echo "================== Step 7 ==================";
@@ -265,8 +259,6 @@ select * from test.t1 where b=5;
select * from test.t2 where b=5;
select * from test.t3 where b=5;
-echo "================== con4 marker ==================";
-
--connection default
echo "================== Step 9 ==================";
@@ -288,8 +280,6 @@ unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-echo "================== con1 marker ==================";
-
--connection default
echo "================== Step 10 ==================";
@@ -347,8 +337,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user1';
--source include/wait_condition.inc
-echo "================== con1 disconnected ==================";
-
echo "================== Step 13 ==================";
call dump_thread();
execute dump_waits_account;
@@ -369,8 +357,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user2';
--source include/wait_condition.inc
-echo "================== con2 disconnected ==================";
-
echo "================== Step 14 ==================";
call dump_thread();
execute dump_waits_account;
@@ -391,8 +377,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user3';
--source include/wait_condition.inc
-echo "================== con3 disconnected ==================";
-
echo "================== Step 15 ==================";
call dump_thread();
execute dump_waits_account;
@@ -413,8 +397,6 @@ let $wait_condition=
where `TYPE`='FOREGROUND' and PROCESSLIST_USER= 'user4';
--source include/wait_condition.inc
-echo "================== con4 disconnected ==================";
-
echo "================== Step 16 ==================";
call dump_thread();
execute dump_waits_account;
diff --git a/mysql-test/suite/perfschema/r/column_privilege.result b/mysql-test/suite/perfschema/r/column_privilege.result
index ea901484d7e..f88a5615e16 100644
--- a/mysql-test/suite/perfschema/r/column_privilege.result
+++ b/mysql-test/suite/perfschema/r/column_privilege.result
@@ -9,6 +9,7 @@ to 'pfs_user_5'@localhost;
grant UPDATE(enabled) on performance_schema.setup_instruments
to 'pfs_user_5'@localhost;
flush privileges;
+connect con1, localhost, pfs_user_5, , ;
select thread_id from performance_schema.events_waits_current;
select thread_id, event_id from performance_schema.events_waits_current;
update performance_schema.setup_instruments set enabled='YES';
@@ -21,6 +22,8 @@ update performance_schema.setup_instruments set name='illegal';
ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'name' in table 'setup_instruments'
update performance_schema.setup_instruments set timed='NO';
ERROR 42000: UPDATE command denied to user 'pfs_user_5'@'localhost' for column 'timed' in table 'setup_instruments'
+connection default;
+disconnect con1;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'pfs_user_5'@localhost;
DROP USER 'pfs_user_5'@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/r/connect_attrs.result b/mysql-test/suite/perfschema/r/connect_attrs.result
index 0fb0ad34ab2..5e45a4cd900 100644
--- a/mysql-test/suite/perfschema/r/connect_attrs.result
+++ b/mysql-test/suite/perfschema/r/connect_attrs.result
@@ -25,6 +25,8 @@ FROM performance_schema.session_account_connect_attrs;
COUNT(DISTINCT PROCESSLIST_ID)
1
CREATE USER wl5924@localhost;
+connect non_privileged_user,localhost,wl5924,,test;
+connection default;
# must return 1
SELECT COUNT(DISTINCT PROCESSLIST_ID)
FROM performance_schema.session_account_connect_attrs;
@@ -35,12 +37,15 @@ SELECT COUNT(DISTINCT PROCESSLIST_ID)
FROM performance_schema.session_connect_attrs;
COUNT(DISTINCT PROCESSLIST_ID)
2
+connection non_privileged_user;
SELECT COUNT(DISTINCT PROCESSLIST_ID)
FROM performance_schema.session_account_connect_attrs;
ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_account_connect_attrs'
SELECT COUNT(DISTINCT PROCESSLIST_ID)
FROM performance_schema.session_connect_attrs;
ERROR 42000: SELECT command denied to user 'wl5924'@'localhost' for table 'session_connect_attrs'
+connection default;
+disconnect non_privileged_user;
grant select on performance_schema.* to wl5924@localhost;
SELECT SUM(ISNULL(ATTR_VALUE)), COUNT(*)
FROM performance_schema.session_account_connect_attrs
diff --git a/mysql-test/suite/perfschema/r/connection.result b/mysql-test/suite/perfschema/r/connection.result
index fe312f6fa04..332b5a43466 100644
--- a/mysql-test/suite/perfschema/r/connection.result
+++ b/mysql-test/suite/perfschema/r/connection.result
@@ -11,6 +11,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1a, localhost, user1, , ;
select "user1 in con1a" as status;
status
user1 in con1a
@@ -30,6 +31,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1b, localhost, user1, , ;
select "user1 in con1b" as status;
status
user1 in con1b
@@ -50,6 +52,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1c, localhost, user1, , ;
select "user1 in con1c" as status;
status
user1 in con1c
@@ -71,6 +74,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2a, localhost, user2, , ;
select "user2 in con2a" as status;
status
user2 in con2a
@@ -95,6 +99,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2b, localhost, user2, , ;
select "user2 in con2b" as status;
status
user2 in con2b
@@ -120,6 +125,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2c, localhost, user2, , ;
select "user2 in con2c" as status;
status
user2 in con2c
@@ -146,6 +152,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con3a, localhost, user3, , ;
select "user3 in con3a" as status;
status
user3 in con3a
@@ -175,6 +182,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con3b, localhost, user3, , ;
select "user3 in con3b" as status;
status
user3 in con3b
@@ -205,6 +213,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con3c, localhost, user3, , ;
select "user3 in con3c" as status;
status
user3 in con3c
@@ -236,6 +245,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connection default;
+disconnect con1a;
select "con1a disconnected" as status;
status
con1a disconnected
@@ -266,6 +277,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con2a;
select "con2a disconnected" as status;
status
con2a disconnected
@@ -295,6 +307,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con3a;
select "con3a disconnected" as status;
status
con3a disconnected
@@ -401,6 +414,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con4a, localhost, user4, , ;
select "user4 in con4a" as status;
status
user4 in con4a
@@ -432,6 +446,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con4b, localhost, user4, , ;
select "user4 in con4b" as status;
status
user4 in con4b
@@ -464,6 +479,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con4c, localhost, user4, , ;
select "user4 in con4c" as status;
status
user4 in con4c
@@ -497,6 +513,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connection default;
+disconnect con1b;
select "con1b disconnected" as status;
status
con1b disconnected
@@ -529,6 +547,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con2b;
select "con2b disconnected" as status;
status
con2b disconnected
@@ -560,6 +579,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con3b;
select "con3b disconnected" as status;
status
con3b disconnected
@@ -590,6 +610,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con1c;
select "con1c disconnected" as status;
status
con1c disconnected
@@ -619,6 +640,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con2c;
select "con2c disconnected" as status;
status
con2c disconnected
@@ -647,6 +669,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con3c;
select "con3c disconnected" as status;
status
con3c disconnected
@@ -734,6 +757,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con5a, localhost, user5, , ;
select "user5 in con5a" as status;
status
user5 in con5a
@@ -758,6 +782,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con5b, localhost, user5, , ;
select "user5 in con5b" as status;
status
user5 in con5b
@@ -783,6 +808,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con5c, localhost, user5, , ;
select "user5 in con5c" as status;
status
user5 in con5c
@@ -809,6 +835,13 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connection default;
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
+disconnect con5a;
+disconnect con5b;
+disconnect con5c;
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
diff --git a/mysql-test/suite/perfschema/r/connection_3a.result b/mysql-test/suite/perfschema/r/connection_3a.result
index 1f92d67137d..e799864edfd 100644
--- a/mysql-test/suite/perfschema/r/connection_3a.result
+++ b/mysql-test/suite/perfschema/r/connection_3a.result
@@ -11,6 +11,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1a, localhost, user1, , ;
select "user1 in con1a" as status;
status
user1 in con1a
@@ -30,6 +31,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1b, localhost, user1, , ;
select "user1 in con1b" as status;
status
user1 in con1b
@@ -50,6 +52,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1c, localhost, user1, , ;
select "user1 in con1c" as status;
status
user1 in con1c
@@ -71,6 +74,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2a, localhost, user2, , ;
select "user2 in con2a" as status;
status
user2 in con2a
@@ -94,6 +98,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2b, localhost, user2, , ;
select "user2 in con2b" as status;
status
user2 in con2b
@@ -118,6 +123,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2c, localhost, user2, , ;
select "user2 in con2c" as status;
status
user2 in con2c
@@ -143,6 +149,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con3a, localhost, user3, , ;
select "user3 in con3a" as status;
status
user3 in con3a
@@ -170,6 +177,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con3b, localhost, user3, , ;
select "user3 in con3b" as status;
status
user3 in con3b
@@ -198,6 +206,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con3c, localhost, user3, , ;
select "user3 in con3c" as status;
status
user3 in con3c
@@ -227,6 +236,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connection default;
+disconnect con1a;
select "con1a disconnected" as status;
status
con1a disconnected
@@ -255,6 +266,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con2a;
select "con2a disconnected" as status;
status
con2a disconnected
@@ -282,6 +294,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con3a;
select "con3a disconnected" as status;
status
con3a disconnected
@@ -380,6 +393,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con4a, localhost, user4, , ;
select "user4 in con4a" as status;
status
user4 in con4a
@@ -408,6 +422,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con4b, localhost, user4, , ;
select "user4 in con4b" as status;
status
user4 in con4b
@@ -437,6 +452,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con4c, localhost, user4, , ;
select "user4 in con4c" as status;
status
user4 in con4c
@@ -467,6 +483,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connection default;
+disconnect con1b;
select "con1b disconnected" as status;
status
con1b disconnected
@@ -496,6 +514,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con2b;
select "con2b disconnected" as status;
status
con2b disconnected
@@ -524,6 +543,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con3b;
select "con3b disconnected" as status;
status
con3b disconnected
@@ -551,6 +571,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con1c;
select "con1c disconnected" as status;
status
con1c disconnected
@@ -577,6 +598,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con2c;
select "con2c disconnected" as status;
status
con2c disconnected
@@ -602,6 +624,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+disconnect con3c;
select "con3c disconnected" as status;
status
con3c disconnected
@@ -683,6 +706,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con5a, localhost, user5, , ;
select "user5 in con5a" as status;
status
user5 in con5a
@@ -706,6 +730,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con5b, localhost, user5, , ;
select "user5 in con5b" as status;
status
user5 in con5b
@@ -730,6 +755,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con5c, localhost, user5, , ;
select "user5 in con5c" as status;
status
user5 in con5c
@@ -755,6 +781,13 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connection default;
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
+disconnect con5a;
+disconnect con5b;
+disconnect con5c;
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
diff --git a/mysql-test/suite/perfschema/r/connection_3a_3u.result b/mysql-test/suite/perfschema/r/connection_3a_3u.result
index 0a6229d9f93..a3758a6ace1 100644
--- a/mysql-test/suite/perfschema/r/connection_3a_3u.result
+++ b/mysql-test/suite/perfschema/r/connection_3a_3u.result
@@ -11,6 +11,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1a, localhost, user1, , ;
select "user1 in con1a" as status;
status
user1 in con1a
@@ -30,6 +31,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1b, localhost, user1, , ;
select "user1 in con1b" as status;
status
user1 in con1b
@@ -50,6 +52,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1c, localhost, user1, , ;
select "user1 in con1c" as status;
status
user1 in con1c
@@ -71,6 +74,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2a, localhost, user2, , ;
select "user2 in con2a" as status;
status
user2 in con2a
@@ -93,6 +97,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 1
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
+connect con2b, localhost, user2, , ;
select "user2 in con2b" as status;
status
user2 in con2b
@@ -116,6 +121,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 2
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+connect con2c, localhost, user2, , ;
select "user2 in con2c" as status;
status
user2 in con2c
@@ -140,6 +146,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 3
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connect con3a, localhost, user3, , ;
select "user3 in con3a" as status;
status
user3 in con3a
@@ -165,6 +172,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 4
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 4
+connect con3b, localhost, user3, , ;
select "user3 in con3b" as status;
status
user3 in con3b
@@ -191,6 +199,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 5
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 5
+connect con3c, localhost, user3, , ;
select "user3 in con3c" as status;
status
user3 in con3c
@@ -218,6 +227,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
+connection default;
+disconnect con1a;
select "con1a disconnected" as status;
status
con1a disconnected
@@ -244,6 +255,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
+disconnect con2a;
select "con2a disconnected" as status;
status
con2a disconnected
@@ -269,6 +281,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
+disconnect con3a;
select "con3a disconnected" as status;
status
con3a disconnected
@@ -359,6 +372,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 6
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 6
+connect con4a, localhost, user4, , ;
select "user4 in con4a" as status;
status
user4 in con4a
@@ -384,6 +398,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 7
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 7
+connect con4b, localhost, user4, , ;
select "user4 in con4b" as status;
status
user4 in con4b
@@ -410,6 +425,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 8
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 8
+connect con4c, localhost, user4, , ;
select "user4 in con4c" as status;
status
user4 in con4c
@@ -437,6 +453,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+connection default;
+disconnect con1b;
select "con1b disconnected" as status;
status
con1b disconnected
@@ -463,6 +481,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+disconnect con2b;
select "con2b disconnected" as status;
status
con2b disconnected
@@ -488,6 +507,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+disconnect con3b;
select "con3b disconnected" as status;
status
con3b disconnected
@@ -512,6 +532,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+disconnect con1c;
select "con1c disconnected" as status;
status
con1c disconnected
@@ -535,6 +556,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+disconnect con2c;
select "con2c disconnected" as status;
status
con2c disconnected
@@ -557,6 +579,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+disconnect con3c;
select "con3c disconnected" as status;
status
con3c disconnected
@@ -630,6 +653,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+connect con5a, localhost, user5, , ;
select "user5 in con5a" as status;
status
user5 in con5a
@@ -652,6 +676,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+connect con5b, localhost, user5, , ;
select "user5 in con5b" as status;
status
user5 in con5b
@@ -675,6 +700,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+connect con5c, localhost, user5, , ;
select "user5 in con5c" as status;
status
user5 in con5c
@@ -699,6 +725,13 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 9
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 9
+connection default;
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
+disconnect con5a;
+disconnect con5b;
+disconnect con5c;
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
diff --git a/mysql-test/suite/perfschema/r/connection_3u.result b/mysql-test/suite/perfschema/r/connection_3u.result
index f0606301532..7bb5691c7f6 100644
--- a/mysql-test/suite/perfschema/r/connection_3u.result
+++ b/mysql-test/suite/perfschema/r/connection_3u.result
@@ -11,6 +11,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1a, localhost, user1, , ;
select "user1 in con1a" as status;
status
user1 in con1a
@@ -30,6 +31,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1b, localhost, user1, , ;
select "user1 in con1b" as status;
status
user1 in con1b
@@ -50,6 +52,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con1c, localhost, user1, , ;
select "user1 in con1c" as status;
status
user1 in con1c
@@ -71,6 +74,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 0
+connect con2a, localhost, user2, , ;
select "user2 in con2a" as status;
status
user2 in con2a
@@ -94,6 +98,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
+connect con2b, localhost, user2, , ;
select "user2 in con2b" as status;
status
user2 in con2b
@@ -118,6 +123,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
+connect con2c, localhost, user2, , ;
select "user2 in con2c" as status;
status
user2 in con2c
@@ -143,6 +149,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 1
+connect con3a, localhost, user3, , ;
select "user3 in con3a" as status;
status
user3 in con3a
@@ -170,6 +177,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+connect con3b, localhost, user3, , ;
select "user3 in con3b" as status;
status
user3 in con3b
@@ -198,6 +206,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+connect con3c, localhost, user3, , ;
select "user3 in con3c" as status;
status
user3 in con3c
@@ -227,6 +236,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+connection default;
+disconnect con1a;
select "con1a disconnected" as status;
status
con1a disconnected
@@ -255,6 +266,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+disconnect con2a;
select "con2a disconnected" as status;
status
con2a disconnected
@@ -282,6 +294,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+disconnect con3a;
select "con3a disconnected" as status;
status
con3a disconnected
@@ -380,6 +393,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 2
+connect con4a, localhost, user4, , ;
select "user4 in con4a" as status;
status
user4 in con4a
@@ -408,6 +422,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connect con4b, localhost, user4, , ;
select "user4 in con4b" as status;
status
user4 in con4b
@@ -437,6 +452,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connect con4c, localhost, user4, , ;
select "user4 in con4c" as status;
status
user4 in con4c
@@ -467,6 +483,8 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connection default;
+disconnect con1b;
select "con1b disconnected" as status;
status
con1b disconnected
@@ -496,6 +514,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+disconnect con2b;
select "con2b disconnected" as status;
status
con2b disconnected
@@ -524,6 +543,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+disconnect con3b;
select "con3b disconnected" as status;
status
con3b disconnected
@@ -551,6 +571,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+disconnect con1c;
select "con1c disconnected" as status;
status
con1c disconnected
@@ -577,6 +598,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+disconnect con2c;
select "con2c disconnected" as status;
status
con2c disconnected
@@ -602,6 +624,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+disconnect con3c;
select "con3c disconnected" as status;
status
con3c disconnected
@@ -681,6 +704,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connect con5a, localhost, user5, , ;
select "user5 in con5a" as status;
status
user5 in con5a
@@ -704,6 +728,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connect con5b, localhost, user5, , ;
select "user5 in con5b" as status;
status
user5 in con5b
@@ -728,6 +753,7 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connect con5c, localhost, user5, , ;
select "user5 in con5c" as status;
status
user5 in con5c
@@ -753,6 +779,13 @@ variable_name variable_value
PERFORMANCE_SCHEMA_ACCOUNTS_LOST 0
PERFORMANCE_SCHEMA_HOSTS_LOST 0
PERFORMANCE_SCHEMA_USERS_LOST 3
+connection default;
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
+disconnect con5a;
+disconnect con5b;
+disconnect con5c;
select "con 5a, 5b, 5c, 6a, 6b, 6c disconnected" as status;
status
con 5a, 5b, 5c, 6a, 6b, 6c disconnected
diff --git a/mysql-test/suite/perfschema/r/event_aggregate.result b/mysql-test/suite/perfschema/r/event_aggregate.result
index a5cfe97f98e..1f168cee431 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate.result
@@ -71,7 +71,8 @@ root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -175,6 +176,7 @@ user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -182,7 +184,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -293,7 +295,8 @@ user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -433,6 +436,7 @@ user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -440,7 +444,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -580,7 +584,8 @@ user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -749,6 +754,7 @@ user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -756,7 +762,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -925,7 +931,8 @@ user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -1123,6 +1130,7 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -1130,7 +1138,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -1328,7 +1336,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -1525,7 +1534,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 5
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -1719,7 +1729,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 5
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1910,7 +1921,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 5
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -2098,6 +2110,7 @@ user4 0 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 5
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
index 42945079ef4..7c9c3794d5f 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a.result
@@ -70,7 +70,8 @@ root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -160,6 +161,7 @@ user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -167,7 +169,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -264,7 +266,8 @@ user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -377,6 +380,7 @@ user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -384,7 +388,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -497,7 +501,8 @@ user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -626,6 +631,7 @@ user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -633,7 +639,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -762,7 +768,8 @@ user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -907,6 +914,7 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -914,7 +922,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -1059,7 +1067,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -1203,7 +1212,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 5
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -1344,7 +1354,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 5
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1482,7 +1493,8 @@ user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 5
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1617,6 +1629,7 @@ user4 0 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 5
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
index 12893a8cc2b..c8a9233e2a6 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_h.result
@@ -57,7 +57,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -134,6 +135,7 @@ root 1 1
user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -141,7 +143,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -225,7 +227,8 @@ root 1 1
user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -325,6 +328,7 @@ user1 1 1
user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -332,7 +336,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -432,7 +436,8 @@ user1 1 1
user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -548,6 +553,7 @@ user2 1 1
user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -555,7 +561,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -671,7 +677,8 @@ user2 1 1
user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -803,6 +810,7 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -810,7 +818,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -942,7 +950,8 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -1073,7 +1082,8 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -1201,7 +1211,8 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1326,7 +1337,8 @@ user3 0 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1448,6 +1460,7 @@ user3 0 1
user4 0 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
index bd9a52361a1..95b46de4b57 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u.result
@@ -69,7 +69,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -145,6 +146,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -152,7 +154,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -235,7 +237,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -321,6 +324,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -328,7 +332,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -414,7 +418,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -503,6 +508,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -510,7 +516,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -599,7 +605,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -691,6 +698,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -698,7 +706,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -790,7 +798,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -881,7 +890,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 5
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -969,7 +979,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 5
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1054,7 +1065,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 5
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1136,6 +1148,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 5
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
index bb14b14e291..2dda100704f 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_a_no_u_no_h.result
@@ -56,7 +56,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -119,6 +120,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -126,7 +128,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -196,7 +198,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -269,6 +272,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -276,7 +280,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -349,7 +353,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -425,6 +430,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -432,7 +438,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -508,7 +514,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -587,6 +594,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -594,7 +602,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -673,7 +681,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -751,7 +760,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -826,7 +836,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -898,7 +909,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -967,6 +979,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
index 0595c50e531..86edcf225c7 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_h.result
@@ -58,7 +58,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
root 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -149,6 +150,7 @@ root 1 1
user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -156,7 +158,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -254,7 +256,8 @@ root 1 1
user1 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -381,6 +384,7 @@ user1 1 1
user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -388,7 +392,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -515,7 +519,8 @@ user1 1 1
user2 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -671,6 +676,7 @@ user2 1 1
user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -678,7 +684,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -834,7 +840,8 @@ user2 1 1
user3 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -1019,6 +1026,7 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -1026,7 +1034,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -1211,7 +1219,8 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -1395,7 +1404,8 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -1576,7 +1586,8 @@ user3 1 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1754,7 +1765,8 @@ user3 0 1
user4 1 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1929,6 +1941,7 @@ user3 0 1
user4 0 1
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
index 532fd209e18..f5c4044f40f 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u.result
@@ -70,7 +70,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 1
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -160,6 +161,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -167,7 +169,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -264,7 +266,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 2
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -377,6 +380,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -384,7 +388,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -497,7 +501,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 3
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -626,6 +631,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -633,7 +639,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -762,7 +768,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 4
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -907,6 +914,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -914,7 +922,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -1059,7 +1067,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 5 5
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -1203,7 +1212,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 4 5
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -1344,7 +1354,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 3 5
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1482,7 +1493,8 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 2 5
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1617,6 +1629,7 @@ USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
localhost 1 5
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
index 76c7311f99c..5b40823e6ff 100644
--- a/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
+++ b/mysql-test/suite/perfschema/r/event_aggregate_no_u_no_h.result
@@ -57,7 +57,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -134,6 +135,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con1;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -141,7 +143,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -225,7 +227,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 connected =================="
+connect con2, localhost, user2, , ;
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -325,6 +328,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con2;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -332,7 +336,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -432,7 +436,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 connected =================="
+connect con3, localhost, user3, , ;
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -548,6 +553,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con3;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -555,7 +561,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -671,7 +677,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 connected =================="
+connect con4, localhost, user4, , ;
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -803,6 +810,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection con4;
select get_lock("marker", 10);
get_lock("marker", 10)
1
@@ -810,7 +818,7 @@ select release_lock("marker");
release_lock("marker")
1
insert into test.t1 values ("marker");
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -942,7 +950,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con1 disconnected =================="
+disconnect con1;
+connection default;
"================== Step 10 =================="
call dump_thread();
username status
@@ -1073,7 +1082,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con2 disconnected =================="
+disconnect con2;
+connection default;
"================== Step 11 =================="
call dump_thread();
username status
@@ -1201,7 +1211,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con3 disconnected =================="
+disconnect con3;
+connection default;
"================== Step 12 =================="
call dump_thread();
username status
@@ -1326,7 +1337,8 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
-"================== con4 disconnected =================="
+disconnect con4;
+connection default;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1448,6 +1460,7 @@ execute dump_users;
USER CURRENT_CONNECTIONS TOTAL_CONNECTIONS
execute dump_hosts;
HOST CURRENT_CONNECTIONS TOTAL_CONNECTIONS
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== WAITS_BY_THREAD truncated =================="
"================== Step 14 =================="
diff --git a/mysql-test/suite/perfschema/r/global_read_lock.result b/mysql-test/suite/perfschema/r/global_read_lock.result
index dab22c79100..6eed64f12d5 100644
--- a/mysql-test/suite/perfschema/r/global_read_lock.result
+++ b/mysql-test/suite/perfschema/r/global_read_lock.result
@@ -3,7 +3,7 @@ update performance_schema.setup_instruments set enabled='YES';
create user pfsuser@localhost;
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
-connect (con1, localhost, pfsuser, , test);
+connect con1, localhost, pfsuser, , test;
lock tables performance_schema.setup_instruments read;
select * from performance_schema.setup_instruments;
unlock tables;
@@ -29,9 +29,11 @@ where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
event_name short_source timer_end timer_wait operation
wait/synch/cond/sql/MDL_context::COND_wait_status mdl.cc: SET SET timed_wait
unlock tables;
+connection con1;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
unlock tables;
+disconnect con1;
connection default;
drop user pfsuser@localhost;
flush privileges;
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
index d146f5324d0..0abbc7326dc 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
+connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
index 08f280f30a9..c2ec1e1d1e4 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_again_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_again";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
index 6c1bce7c9a0..fd286dc4c24 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
+connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
index 924b66cf726..d4887df429d 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_bad_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_bad_ipv4";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
index d04a565508f..684897a3b38 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@santa.claus.ipv4.example.com
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
+connect con3,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@santa.claus.ipv4.example.com
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
index 1846dbe0719..7f6de0de46d 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_good_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
index ea5e91307c8..1f8345a8315 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_allow.result
@@ -27,19 +27,25 @@ create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
+connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -68,12 +74,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
index 618bcea553d..3f069d515be 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_addrinfo_noname_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_error_noname";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
index 6cc93cd4a7f..9a85430a6d7 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_auth_plugin.result
@@ -27,15 +27,19 @@ CREATE USER 'plug'@'santa.claus.ipv4.example.com'
CREATE USER 'plug_dest'@'santa.claus.ipv4.example.com'
IDENTIFIED BY 'plug_test_passwd';
GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv4.example.com';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
uninstall plugin test_plugin_server;
ERROR HY000: Plugin 'test_plugin_server' is not loaded
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -65,6 +69,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Plugin 'test_plugin_server' is not loaded
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -95,6 +100,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
install plugin test_plugin_server soname 'PLUGIN_AUTH';
ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -124,6 +130,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -154,6 +161,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
GRANT PROXY ON 'plug_dest'@'santa.claus.ipv4.example.com'
TO 'plug'@'santa.claus.ipv4.example.com';
+connect con4,"127.0.0.1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin;
select "Con4 is alive";
Con4 is alive
Con4 is alive
@@ -163,6 +171,8 @@ plug@santa.claus.ipv4.example.com
select current_user();
current_user()
plug_dest@santa.claus.ipv4.example.com
+disconnect con4;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
index 4eae65c4618..011af9b2eaa 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_blocked.result
@@ -28,14 +28,18 @@ create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
create user 'quota'@'santa.claus.ipv4.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4,native_password_bad_reply";
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -65,6 +69,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -94,6 +99,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -123,6 +129,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -152,6 +159,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -182,6 +190,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
flush hosts;
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -211,6 +220,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -239,10 +249,13 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connection default;
set global debug_dbug= "-d,native_password_bad_reply";
message
Valid connection should reset SUM_CONNECT_ERROR counter
+connection default;
set global debug_dbug= "+d,native_password_bad_reply";
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -272,6 +285,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -301,6 +315,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -330,6 +345,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -359,6 +375,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -388,6 +405,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
index baf9eae9f5c..cfc6c8e4f66 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_format.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_format_ipv4";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
index 31e4bc9f843..f294b441411 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_max_con.result
@@ -28,19 +28,25 @@ create user 'quota'@'santa.claus.ipv4.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv4.example.com';
grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
with max_connections_per_hour 3;
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+connect con2a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con2a is alive";
Con2a is alive
Con2a is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+disconnect con2a;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -69,12 +75,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
+connect con2b,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con2b is alive";
Con2b is alive
Con2b is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+disconnect con2b;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -103,12 +112,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
+connect con2c,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con2c is alive";
Con2c is alive
Con2c is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+disconnect con2c;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -138,6 +150,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -167,6 +180,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -200,12 +214,14 @@ grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
with max_user_connections 3;
flush user_resources;
+connect con3a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con7 is alive";
Con7 is alive
Con7 is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -234,12 +250,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3b,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con3b is alive";
Con3b is alive
Con3b is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -268,12 +286,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3c,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con3c is alive";
Con3c is alive
Con3c is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -303,6 +323,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -332,6 +353,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -360,16 +382,21 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+disconnect con3a;
+disconnect con3b;
+disconnect con3c;
grant usage on *.* to 'quota'@'santa.claus.ipv4.example.com'
with max_user_connections 0;
flush user_resources;
set global max_user_connections = 3;
+connect con4a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
Con4a is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -398,12 +425,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con4b,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con4b is alive";
Con4b is alive
Con4b is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -432,12 +461,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con4c,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con4c is alive";
Con4c is alive
Con4c is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -467,6 +498,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User quota already has more than 'max_user_connections' active connections
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -496,6 +528,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User quota already has more than 'max_user_connections' active connections
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -524,15 +557,20 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
set global max_user_connections = 0;
set global max_connections = 3;
flush user_resources;
+connect con5a,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
Con4a is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -561,12 +599,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con5b,"127.0.0.1",quota,,test,$MASTER_MYPORT,;
select "Con5b is alive";
Con5b is alive
Con5b is alive
select current_user();
current_user()
quota@santa.claus.ipv4.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -596,6 +636,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
Got one of the listed errors
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -625,6 +666,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
Got one of the listed errors
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -653,6 +695,8 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+disconnect con5a;
+disconnect con5b;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv4.example.com';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
index 1c893320340..a172dff7935 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_allow.result
@@ -27,19 +27,25 @@ create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
create user 'root'@'santa.claus.ipv4.example.com';
grant select on test.* to 'root'@'santa.claus.ipv4.example.com';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
+connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -68,12 +74,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -103,12 +112,15 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
+connect con4,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con4 is alive";
Con4 is alive
Con4 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con4;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -137,12 +149,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con5,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con5 is alive";
Con5 is alive
Con5 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con5;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
index 2976f8c9e16..3852a675f81 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_again_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_again";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -90,6 +95,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -119,6 +125,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host 'santa.claus.ipv4.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
index 68855bbc0ce..f42a300e6ea 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'192.0.2.4';
grant select on test.* to 'root'@'192.0.2.4';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
+connect con2,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@192.0.2.4
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
index f27bda9ada1..d1ce2ac0c25 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_nameinfo_noname_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_error_noname";
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '192.0.2.4' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
index 69f68de8d90..683376fb088 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_passwd.result
@@ -27,14 +27,18 @@ create user 'user_with'@'santa.claus.ipv4.example.com'
identified by 'good_password';
grant select on test.* to 'user_without'@'santa.claus.ipv4.example.com';
grant select on test.* to 'user_with'@'santa.claus.ipv4.example.com';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -64,6 +68,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -93,6 +98,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -122,6 +128,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -151,6 +158,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -180,6 +188,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
index a3d2b1d273f..353c4a55772 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv4_ssl.result
@@ -31,14 +31,18 @@ grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv4.example.com'
REQUIRE SUBJECT '/C=??/ST=??/L=??/
O=No such thing/
CN=Santa Claus/emailAddress=santa.claus@example.com';
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv4,getnameinfo_fake_ipv4,getaddrinfo_fake_good_ipv4";
ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -68,6 +72,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv4.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -97,6 +102,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
@@ -126,6 +132,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv4.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 192.0.2.4
HOST santa.claus.ipv4.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
index 36d7692f824..93bcca91300 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
+connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"::1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
index d241bede905..d386d30c2d7 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_again_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_again";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
index 37470bdc0bb..41006170ab4 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
+connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"::1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
index b14fb2f955e..d67f8cce707 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_bad_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_bad_ipv6";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
index 410f116f4d0..ccb3c7564f2 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@santa.claus.ipv6.example.com
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
+connect con3,"::1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@santa.claus.ipv6.example.com
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
index b88bb94343f..01a70fd2183 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_good_deny.result
@@ -22,14 +22,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -59,6 +63,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
index 6ccb3b66f22..b4f1a39fcce 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_allow.result
@@ -27,19 +27,25 @@ create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
+connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -68,12 +74,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"::1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
index 73741cf42ed..22271f4ba5f 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_addrinfo_noname_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_error_noname";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
index 8042071c68f..dea4d07f593 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_auth_plugin.result
@@ -27,15 +27,19 @@ CREATE USER 'plug'@'santa.claus.ipv6.example.com'
CREATE USER 'plug_dest'@'santa.claus.ipv6.example.com'
IDENTIFIED BY 'plug_test_passwd';
GRANT SELECT ON test.* TO 'plug_dest'@'santa.claus.ipv6.example.com';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
uninstall plugin test_plugin_server;
ERROR HY000: Plugin 'test_plugin_server' is not loaded
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -65,6 +69,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Plugin 'test_plugin_server' is not loaded
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -95,6 +100,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
install plugin test_plugin_server soname 'PLUGIN_AUTH';
ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -124,6 +130,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'plug'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -154,6 +161,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
GRANT PROXY ON 'plug_dest'@'santa.claus.ipv6.example.com'
TO 'plug'@'santa.claus.ipv6.example.com';
+connect con4,"::1",plug,plug_dest,test,$MASTER_MYPORT,,,auth_test_plugin;
select "Con4 is alive";
Con4 is alive
Con4 is alive
@@ -163,6 +171,8 @@ plug@santa.claus.ipv6.example.com
select current_user();
current_user()
plug_dest@santa.claus.ipv6.example.com
+disconnect con4;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
index a0c2d8bdfa6..5f9f47fc8da 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_blocked.result
@@ -28,14 +28,18 @@ create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
create user 'quota'@'santa.claus.ipv6.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6,native_password_bad_reply";
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -65,6 +69,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -94,6 +99,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -123,6 +129,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -152,6 +159,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -182,6 +190,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
flush hosts;
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -211,6 +220,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -239,10 +249,13 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connection default;
set global debug_dbug= "-d,native_password_bad_reply";
message
Valid connection should reset SUM_CONNECT_ERROR counter
+connection default;
set global debug_dbug= "+d,native_password_bad_reply";
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -272,6 +285,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -301,6 +315,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -330,6 +345,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 08S01: Bad handshake
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -359,6 +375,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -388,6 +405,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
index 4416b78d009..d97fe0a82ff 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_max_con.result
@@ -28,19 +28,25 @@ create user 'quota'@'santa.claus.ipv6.example.com';
grant select on test.* to 'quota'@'santa.claus.ipv6.example.com';
grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
with max_connections_per_hour 3;
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+connect con2a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con2a is alive";
Con2a is alive
Con2a is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+disconnect con2a;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -69,12 +75,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
+connect con2b,"::1",quota,,test,$MASTER_MYPORT,;
select "Con2b is alive";
Con2b is alive
Con2b is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+disconnect con2b;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -103,12 +112,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
+connect con2c,"::1",quota,,test,$MASTER_MYPORT,;
select "Con2c is alive";
Con2c is alive
Con2c is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+disconnect con2c;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -138,6 +150,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN null
LAST_ERROR_SEEN null
ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -167,6 +180,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User 'quota' has exceeded the 'max_connections_per_hour' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -200,12 +214,14 @@ grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
with max_user_connections 3;
flush user_resources;
+connect con3a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con7 is alive";
Con7 is alive
Con7 is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -234,12 +250,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3b,"::1",quota,,test,$MASTER_MYPORT,;
select "Con3b is alive";
Con3b is alive
Con3b is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -268,12 +286,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3c,"::1",quota,,test,$MASTER_MYPORT,;
select "Con3c is alive";
Con3c is alive
Con3c is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -303,6 +323,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -332,6 +353,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User 'quota' has exceeded the 'max_user_connections' resource (current value: 3)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -360,16 +382,21 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+disconnect con3a;
+disconnect con3b;
+disconnect con3c;
grant usage on *.* to 'quota'@'santa.claus.ipv6.example.com'
with max_user_connections 0;
flush user_resources;
set global max_user_connections = 3;
+connect con4a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
Con4a is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -398,12 +425,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con4b,"::1",quota,,test,$MASTER_MYPORT,;
select "Con4b is alive";
Con4b is alive
Con4b is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -432,12 +461,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con4c,"::1",quota,,test,$MASTER_MYPORT,;
select "Con4c is alive";
Con4c is alive
Con4c is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -467,6 +498,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User quota already has more than 'max_user_connections' active connections
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -496,6 +528,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 42000: User quota already has more than 'max_user_connections' active connections
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -524,15 +557,20 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+disconnect con4a;
+disconnect con4b;
+disconnect con4c;
set global max_user_connections = 0;
set global max_connections = 3;
flush user_resources;
+connect con5a,"::1",quota,,test,$MASTER_MYPORT,;
select "Con4a is alive";
Con4a is alive
Con4a is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -561,12 +599,14 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con5b,"::1",quota,,test,$MASTER_MYPORT,;
select "Con5b is alive";
Con5b is alive
Con5b is alive
select current_user();
current_user()
quota@santa.claus.ipv6.example.com
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -596,6 +636,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
Got one of the listed errors
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -625,6 +666,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
Got one of the listed errors
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -653,6 +695,8 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+disconnect con5a;
+disconnect con5b;
set global max_connections = @saved_max_connections;
set global max_user_connections = @saved_max_user_connections;
drop user 'quota'@'santa.claus.ipv6.example.com';
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
index a2b9a32c764..4fdc6ef1b4c 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_allow.result
@@ -27,19 +27,25 @@ create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
create user 'root'@'santa.claus.ipv6.example.com';
grant select on test.* to 'root'@'santa.claus.ipv6.example.com';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
+connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -68,12 +74,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"::1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -103,12 +112,15 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
+connect con4,"::1",root,,test,$MASTER_MYPORT,;
select "Con4 is alive";
Con4 is alive
Con4 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con4;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -137,12 +149,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con5,"::1",root,,test,$MASTER_MYPORT,;
select "Con5 is alive";
Con5 is alive
Con5 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con5;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
index 373ed10677a..59891d359ff 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_again_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_again";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -90,6 +95,7 @@ FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -119,6 +125,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host 'santa.claus.ipv6.example.com' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
index 99b47be724f..9e88dcf66b3 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_allow.result
@@ -25,19 +25,25 @@ select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
create user 'root'@'2001:db8::6:6';
grant select on test.* to 'root'@'2001:db8::6:6';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
+connect con2,"::1",root,,test,$MASTER_MYPORT,;
select "Con2 is alive";
Con2 is alive
Con2 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con2;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -66,12 +72,15 @@ COUNT_LOCAL_ERRORS 0
COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
+connect con3,"::1",root,,test,$MASTER_MYPORT,;
select "Con3 is alive";
Con3 is alive
Con3 is alive
select current_user();
current_user()
root@2001:db8::6:6
+disconnect con3;
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
index 32a06e8105f..7bbff5f30db 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_nameinfo_noname_deny.result
@@ -23,14 +23,18 @@ select `User`, `Host` from mysql.`user` where `user` like '2001:%';
User Host
select `User`, `Host` from mysql.`user` where `user` like 'santa.claus.%';
User Host
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_error_noname";
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
@@ -60,6 +64,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR HY000: Host '2001:db8::6:6' is not allowed to connect to this MariaDB server
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST NULL
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
index 5c3b363c5cd..d35dc133015 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_passwd.result
@@ -27,14 +27,18 @@ create user 'user_with'@'santa.claus.ipv6.example.com'
identified by 'good_password';
grant select on test.* to 'user_without'@'santa.claus.ipv6.example.com';
grant select on test.* to 'user_with'@'santa.claus.ipv6.example.com';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -64,6 +68,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_without'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -93,6 +98,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -122,6 +128,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -151,6 +158,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -180,6 +188,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_with'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
index 422db77b5ae..03be70e1553 100644
--- a/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
+++ b/mysql-test/suite/perfschema/r/hostcache_ipv6_ssl.result
@@ -31,14 +31,18 @@ grant select on test.* to 'user_ssl_x509'@'santa.claus.ipv6.example.com'
REQUIRE SUBJECT '/C=??/ST=??/L=??/
O=No such thing/
CN=Santa Claus/emailAddress=santa.claus@example.com';
+connect con1,"::1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_fake_ipv6,getnameinfo_fake_ipv6,getaddrinfo_fake_good_ipv6";
ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -68,6 +72,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_ssl'@'santa.claus.ipv6.example.com' (using password: NO)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -97,6 +102,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
@@ -126,6 +132,7 @@ COUNT_UNKNOWN_ERRORS 0
FIRST_ERROR_SEEN set
LAST_ERROR_SEEN set
ERROR 28000: Access denied for user 'user_ssl_x509'@'santa.claus.ipv6.example.com' (using password: YES)
+connection default;
"Dumping performance_schema.host_cache"
IP 2001:db8::6:6
HOST santa.claus.ipv6.example.com
diff --git a/mysql-test/suite/perfschema/r/hostcache_peer_addr.result b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
index 70618be6145..35b11567252 100644
--- a/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
+++ b/mysql-test/suite/perfschema/r/hostcache_peer_addr.result
@@ -30,14 +30,18 @@ Connection_errors_max_connections 0
Connection_errors_peer_address 0
Connection_errors_select 0
Connection_errors_tcpwrap 0
+connect con1,"127.0.0.1",root,,test,$MASTER_MYPORT,;
select "Con1 is alive";
Con1 is alive
Con1 is alive
select current_user();
current_user()
root@localhost
+disconnect con1;
+connection default;
set global debug_dbug= "+d,vio_peer_addr_error";
ERROR HY000: Can't get hostname for your address
+connection default;
show global status like "connection_errors_%";
Variable_name Value
Connection_errors_accept 0
@@ -48,6 +52,7 @@ Connection_errors_select 0
Connection_errors_tcpwrap 0
"Dumping performance_schema.host_cache"
ERROR HY000: Can't get hostname for your address
+connection default;
show global status like "connection_errors_%";
Variable_name Value
Connection_errors_accept 0
diff --git a/mysql-test/suite/perfschema/r/nesting.result b/mysql-test/suite/perfschema/r/nesting.result
index 2bf65c30e4a..6a4233d2e42 100644
--- a/mysql-test/suite/perfschema/r/nesting.result
+++ b/mysql-test/suite/perfschema/r/nesting.result
@@ -1,4 +1,4 @@
-"================== con1 connected =================="
+connect con1, localhost, user1, , ;
select "MARKER_BEGIN" as marker;
marker
MARKER_BEGIN
@@ -24,7 +24,7 @@ MARKER_END
select "Con1 is done with payload" as status;
status
Con1 is done with payload
-"================== con1 done =================="
+connection default;
set @con1_tid = (select thread_id from performance_schema.threads
where processlist_user = 'user1');
select (@con1_tid is not null) as expected;
@@ -239,3 +239,4 @@ select "With a third part to make things complete" as payload NULL NULL
126 126 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 110
127 128 stage/sql/cleaning up (stage) STATEMENT 110
128 128 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 127
+disconnect con1;
diff --git a/mysql-test/suite/perfschema/r/one_thread_per_con.result b/mysql-test/suite/perfschema/r/one_thread_per_con.result
index 998aba6281c..03966ad8556 100644
--- a/mysql-test/suite/perfschema/r/one_thread_per_con.result
+++ b/mysql-test/suite/perfschema/r/one_thread_per_con.result
@@ -1,3 +1,7 @@
+connect con1, localhost, root, , ;
+connect con2, localhost, root, , ;
+connect con3, localhost, root, , ;
+connection default;
update performance_schema.setup_instruments set enabled='YES'
where name like "wait/synch/mutex/mysys/THR_LOCK_myisam";
drop table if exists test.t1;
@@ -7,13 +11,13 @@ truncate table performance_schema.events_waits_history_long;
show variables like "thread_handling";
Variable_name Value
thread_handling one-thread-per-connection
-"----------------- Connection 1"
+connection con1;
create table test.t1(a int) engine=MYISAM;
-"----------------- Connection 2"
+connection con2;
create table test.t2(a int) engine=MYISAM;
-"----------------- Connection 3"
+connection con3;
create table test.t3(a int) engine=MYISAM;
-"----------------- Connection default"
+connection default;
execute stmt_dump_events using @tid;
event_name short_source operation number_of_bytes
wait/synch/mutex/mysys/THR_LOCK_myisam mi_create.c: lock NULL
@@ -36,3 +40,10 @@ drop table test.t1;
drop table test.t2;
drop table test.t3;
update performance_schema.setup_instruments set enabled='YES';
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
diff --git a/mysql-test/suite/perfschema/r/privilege.result b/mysql-test/suite/perfschema/r/privilege.result
index 1f806d94991..09d32a177fd 100644
--- a/mysql-test/suite/perfschema/r/privilege.result
+++ b/mysql-test/suite/perfschema/r/privilege.result
@@ -214,6 +214,7 @@ can select
SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
can select
can select
+connect con1, localhost, pfs_user_1, , ;
drop table if exists test.t1;
rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'pfs_user_1'@'localhost' to database 'performance_schema'
@@ -312,6 +313,8 @@ can select
SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
can select
can select
+disconnect con1;
+connect con2, localhost, pfs_user_2, , ;
drop table if exists test.t1;
rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'pfs_user_2'@'localhost' to database 'performance_schema'
@@ -410,6 +413,8 @@ can select
SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
can select
can select
+disconnect con2;
+connect con3, localhost, pfs_user_3, , ;
drop table if exists test.t1;
rename table performance_schema.setup_instruments to test.t1;
ERROR 42000: Access denied for user 'pfs_user_3'@'localhost' to database 'performance_schema'
@@ -504,6 +509,8 @@ SELECT "can select" FROM performance_schema.events_waits_summary_by_instance LIM
ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'events_waits_summary_by_instance'
SELECT "can select" FROM performance_schema.file_summary_by_instance LIMIT 1;
ERROR 42000: SELECT command denied to user 'pfs_user_3'@'localhost' for table 'file_summary_by_instance'
+disconnect con3;
+connection default;
revoke all privileges, grant option from 'pfs_user_1'@localhost;
revoke all privileges, grant option from 'pfs_user_2'@localhost;
revoke all privileges, grant option from 'pfs_user_3'@localhost;
@@ -514,10 +521,12 @@ flush privileges;
# Test cases from WL#4818
# Setup user
CREATE user pfs_user_4;
+connect pfs_user_4, localhost, pfs_user_4, , ;
#
# WL#4818, NFS4: Normal user does not have access to view data
# without grants
#
+connection pfs_user_4;
# Select as pfs_user_4 should fail without grant
SELECT event_id FROM performance_schema.events_waits_history;
ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'events_waits_history'
@@ -533,6 +542,7 @@ ERROR 42000: SELECT command denied to user 'pfs_user_4'@'localhost' for table 'f
# WL#4818, NFS3: Normal user does not have access to change what is
# instrumented without grants
#
+connection pfs_user_4;
# User pfs_user_4 should not be allowed to tweak instrumentation without
# explicit grant
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
@@ -555,6 +565,7 @@ ERROR 42000: DROP command denied to user 'pfs_user_4'@'localhost' for table 'eve
# WL#4814, NFS1: Can use grants to give normal user access
# to turn on and off instrumentation
#
+connection default;
# Grant access to change tables with the root account
GRANT UPDATE ON performance_schema.setup_consumers TO pfs_user_4;
GRANT UPDATE, SELECT ON performance_schema.setup_timers TO pfs_user_4;
@@ -562,6 +573,7 @@ GRANT UPDATE, SELECT ON performance_schema.setup_instruments TO pfs_user_4;
GRANT DROP ON performance_schema.events_waits_current TO pfs_user_4;
GRANT DROP ON performance_schema.events_waits_history TO pfs_user_4;
GRANT DROP ON performance_schema.events_waits_history_long TO pfs_user_4;
+connection pfs_user_4;
# User pfs_user_4 should now be allowed to tweak instrumentation
UPDATE performance_schema.setup_instruments SET enabled = 'NO', timed = 'YES';
UPDATE performance_schema.setup_instruments SET enabled = 'YES'
@@ -573,6 +585,8 @@ TRUNCATE TABLE performance_schema.events_waits_history_long;
TRUNCATE TABLE performance_schema.events_waits_history;
TRUNCATE TABLE performance_schema.events_waits_current;
# Clean up
+disconnect pfs_user_4;
+connection default;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM pfs_user_4;
DROP USER pfs_user_4;
flush privileges;
diff --git a/mysql-test/suite/perfschema/r/read_only.result b/mysql-test/suite/perfschema/r/read_only.result
index b2502808821..045e3232fda 100644
--- a/mysql-test/suite/perfschema/r/read_only.result
+++ b/mysql-test/suite/perfschema/r/read_only.result
@@ -3,7 +3,7 @@ set @start_read_only= @@global.read_only;
create user pfsuser@localhost;
grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost;
flush privileges;
-connect (con1, localhost, pfsuser, , test);
+connect con1, localhost, pfsuser, , test;
connection default;
set global read_only=0;
connection con1;
@@ -33,7 +33,8 @@ update performance_schema.setup_instruments set enabled='YES';
connection default;
grant super on *.* to pfsuser@localhost;
flush privileges;
-connect (con1, localhost, pfsuser, , test);
+disconnect con1;
+connect con1, localhost, pfsuser, , test;
select @@global.read_only;
@@global.read_only
1
@@ -44,6 +45,7 @@ GRANT SELECT, UPDATE ON `performance_schema`.* TO 'pfsuser'@'localhost'
select * from performance_schema.setup_instruments;
update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
+disconnect con1;
connection default;
set global read_only= @start_read_only;
drop user pfsuser@localhost;
diff --git a/mysql-test/suite/perfschema/r/relaylog.result b/mysql-test/suite/perfschema/r/relaylog.result
index 284b36e722f..8dcecf0dc9c 100644
--- a/mysql-test/suite/perfschema/r/relaylog.result
+++ b/mysql-test/suite/perfschema/r/relaylog.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
drop table if exists test.t1;
+connection slave;
reset master;
create table test.t1(a int);
drop table test.t1;
@@ -10,7 +11,7 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table test.t1(a int)
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
-"============ Performance schema on master ============"
+connection master;
select
substring(file_name, locate("master-", file_name)) as FILE_NAME,
EVENT_NAME,
@@ -82,6 +83,7 @@ where event_name like "%MYSQL_RELAY_LOG%"
EVENT_NAME COUNT_STAR SUM_TIMER_WAIT MIN_TIMER_WAIT AVG_TIMER_WAIT MAX_TIMER_WAIT
wait/synch/cond/sql/MYSQL_RELAY_LOG::COND_queue_busy 0 0 0 0 0
wait/synch/mutex/sql/MYSQL_RELAY_LOG::LOCK_index 0 0 0 0 0
+connection slave;
"============ Performance schema on slave ============"
select * from performance_schema.file_summary_by_instance
where file_name like "%master-%" order by file_name;
diff --git a/mysql-test/suite/perfschema/r/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
index d5f764013df..b07c29a054c 100644
--- a/mysql-test/suite/perfschema/r/rpl_gtid_func.result
+++ b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-**** On Master ****
+connection master;
drop table if exists test.marker;
create table test.marker(a int) engine=innodb;
insert into test.marker values (1);
@@ -11,12 +11,12 @@ truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
update performance_schema.setup_instruments
set enabled='YES', timed='YES';
-**** On Slave ****
+connection slave;
truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
update performance_schema.setup_instruments
set enabled='YES', timed='NO';
-**** On Master ****
+connection master;
select * from performance_schema.setup_instruments
where timed='NO';
NAME ENABLED TIMED
@@ -39,7 +39,7 @@ where digest_text like "%in_%_digest%";
digest_text count_star
SELECT ? AS `in_master_digest` 1
insert into test.marker values (2);
-**** On Slave ****
+connection slave;
select * from test.marker;
a
1
@@ -65,10 +65,10 @@ from performance_schema.events_statements_summary_by_digest
where digest_text like "%in_%_digest%";
digest_text count_star
SELECT ? AS `in_slave_digest` 1
-**** On Master ****
+connection master;
delete from performance_schema.setup_objects
where object_schema='master';
-**** On Slave ****
+connection slave;
delete from performance_schema.setup_objects
where object_schema='slave';
select * from performance_schema.setup_objects;
diff --git a/mysql-test/suite/perfschema/r/rpl_statements.result b/mysql-test/suite/perfschema/r/rpl_statements.result
index 081710f1d54..431b8445309 100644
--- a/mysql-test/suite/perfschema/r/rpl_statements.result
+++ b/mysql-test/suite/perfschema/r/rpl_statements.result
@@ -4,10 +4,7 @@ include/master-slave.inc
#
# STEP 1 - CREATE AND REPLICATE TEST TABLES
#
-
-**************
-*** MASTER ***
-**************
+connection master;
*** Create test tables
@@ -19,24 +16,18 @@ select thread_id into @my_thread_id
from performance_schema.threads
where processlist_id = connection_id();
create table test.marker(s1 int) engine=innodb;
-**************
-*** SLAVE ***
-**************
+connection slave;
*** Clear statement events
#
# STEP 2 - REPLICATE ONE ROW ON MASTER TO GET REPLICATION THREAD ID ON SLAVE
#
-**************
-*** MASTER ***
-**************
+connection master;
insert into test.marker values (0);
-**************
-*** SLAVE ***
-**************
+connection slave;
*** Verify row, get replication thread id, clear statement events
@@ -51,9 +42,7 @@ Expect 1
#
# STEP 3 - PERFORM DML STATEMENTS ON MASTER
#
-**************
-*** MASTER ***
-**************
+connection master;
show variables like 'binlog_format%';
Variable_name Value
@@ -130,9 +119,7 @@ where (thread_id=@my_thread_id and digest_text like '%marker%'));
#
# STEP 5 - VERIFY DML AND DDL STATEMENT EVENTS ON SLAVE
#
-**************
-*** SLAVE ***
-**************
+connection slave;
*** List statement events from master
@@ -203,9 +190,7 @@ statement/abstract/relay_log NO NO
#
# STEP 7 - UPDATE TABLES ON MASTER, REPLICATE
#
-**************
-*** MASTER ***
-**************
+connection master;
*** Clear statement events
*** Update some tables, then replicate
@@ -215,9 +200,7 @@ insert into marker1_db.table1 values (999, '999'), (998, '998'), (997, '997');
#
# STEP 8 - VERIFY TABLE UPDATES FROM MASTER, EXPECT NO STATEMENT EVENTS ON SLAVE
#
-**************
-*** SLAVE ***
-**************
+connection slave;
*** Confirm rows were replicated
diff --git a/mysql-test/suite/perfschema/r/setup_actors.result b/mysql-test/suite/perfschema/r/setup_actors.result
index 187b558e827..3474b678321 100644
--- a/mysql-test/suite/perfschema/r/setup_actors.result
+++ b/mysql-test/suite/perfschema/r/setup_actors.result
@@ -28,34 +28,34 @@ grant ALL on *.* to user4@localhost;
create user user5@localhost;
grant select on test.* to user5@localhost;
flush privileges;
-# Switch to (con1, localhost, user1, , )
+connect con1, localhost, user1, , ;
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
thread/sql/one_connection FOREGROUND NO user1 localhost
-# Switch to connection default
+connection default;
insert into performance_schema.setup_actors
values ('%', 'user1', '%');
-# Switch to connection con1
+connection con1;
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
thread/sql/one_connection FOREGROUND NO user1 localhost
-# Disconnect con1
-# Switch to (con2, localhost, user2, , )
+disconnect con1;
+connect con2, localhost, user2, , ;
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID=connection_id();
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
thread/sql/one_connection FOREGROUND YES user2 localhost
-# Disconnect con2
-# Switch to connection default
+disconnect con2;
+connection default;
drop table if exists test.t1;
create table test.t1 (col1 bigint);
lock table test.t1 write;
-# Switch to (con3, localhost, user3, , )
+connect con3, localhost, user3, , ;
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
@@ -64,7 +64,7 @@ thread/sql/one_connection FOREGROUND YES user3 localhost
# Send a statement to the server, but do not wait till the result
# comes back. We will pull this later.
insert into test.t1 set col1 = 1;
-# Switch to (con4, localhost, user4, , )
+connect con4, localhost, user4, , ;
# Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
select count(*) = 1
from performance_schema.threads T inner join information_schema.PROCESSLIST P
@@ -74,20 +74,21 @@ T.PROCESSLIST_COMMAND = P.COMMAND and T.PROCESSLIST_INFO = P.INFO
where T.PROCESSLIST_USER = 'user3' and T.NAME = 'thread/sql/one_connection';
count(*) = 1
1
-# Switch to connection default
+connection default;
unlock tables;
-# Switch to connection con3 and reap the result of the no more blocked insert
-# Switch to connection default
+connection con3;
+# Reap the result of the no more blocked insert
+connection default;
drop table test.t1;
-# Disconnect con3
-# Switch to connection con4
+disconnect con3;
+connection con4;
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
thread/sql/one_connection FOREGROUND NO user4 localhost
-# Disconnect con4
-# Switch to connection default
+disconnect con4;
+connection default;
insert into performance_schema.setup_actors
values ('localhost', '%', '%');
select * from performance_schema.setup_actors
@@ -99,27 +100,27 @@ localhost % %
hosta user1 %
% user2 %
localhost user3 %
-# Switch to (con4b, localhost, user4, , )
+connect con4b, localhost, user4, , ;
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
thread/sql/one_connection FOREGROUND YES user4 localhost
-# Disconnect con4b
-# Switch to connection default
+disconnect con4b;
+connection default;
insert into performance_schema.setup_actors
values ('%', 'user5', '%');
create sql security definer view test.v1 as select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
-# Switch to (con5, localhost, user5, , )
+connect con5, localhost, user5, , ;
select * from performance_schema.threads;
ERROR 42000: SELECT command denied to user 'user5'@'localhost' for table 'threads'
select * from test.v1;
NAME TYPE INSTRUMENTED PROCESSLIST_USER PROCESSLIST_HOST
thread/sql/one_connection FOREGROUND YES user5 localhost
-# Disconnect con5
-# Switch to connection default and cleanup
+disconnect con5;
+connection default;
drop view test.v1;
revoke all privileges, grant option from user1@localhost;
revoke all privileges, grant option from user2@localhost;
diff --git a/mysql-test/suite/perfschema/r/socket_connect.result b/mysql-test/suite/perfschema/r/socket_connect.result
index 10540fd3071..1ac22f6ca34 100644
--- a/mysql-test/suite/perfschema/r/socket_connect.result
+++ b/mysql-test/suite/perfschema/r/socket_connect.result
@@ -1,6 +1,7 @@
#==============================================================================
# Establish the level of IPV6 support
#==============================================================================
+connection default;
#==============================================================================
# Get hostname, port number
#==============================================================================
@@ -73,6 +74,7 @@ Expect 1
# Switch to connection default
+connection default;
#==============================================================================
# 3.0 ESTABLISH TCP/IP CONNECTION 2
# Connect with IP = localhost (127.0.0.1 or ::1)
@@ -129,6 +131,7 @@ Expect 1
#==============================================================================
# 4.0 Verify both connections exist in the instance tables
#==============================================================================
+connection default;
# 4.1 Verify that there are two TCP/IP connections in the socket instance table
@@ -152,7 +155,12 @@ Expect 1
# 5.0 Drop the client connections
#==============================================================================
# 5.1 Disconnect con1
+connection con1;
+disconnect con1;
# 5.2 Disconnect con2
+connection con2;
+disconnect con2;
+connection default;
#==============================================================================
# 6.0 Verify sockets were removed from the instance tables
#==============================================================================
diff --git a/mysql-test/suite/perfschema/r/socket_instances_func.result b/mysql-test/suite/perfschema/r/socket_instances_func.result
index ee1eac73879..8792730fa29 100644
--- a/mysql-test/suite/perfschema/r/socket_instances_func.result
+++ b/mysql-test/suite/perfschema/r/socket_instances_func.result
@@ -5,7 +5,7 @@ SELECT * FROM performance_schema.socket_instances;
SELECT THREAD_ID INTO @thread_id
FROM performance_schema.threads
WHERE PROCESSLIST_ID = CONNECTION_ID();
-# Establish local TCP/IP connection (con1,localhost,root,,test,,)
+connect con1,$my_localhost,root,,test,,$MASTER_MYPORT;
# Store the thread id of connection 1 (tcp/ip)
SELECT THREAD_ID INTO @thread_id
FROM performance_schema.threads
@@ -14,8 +14,8 @@ WHERE PROCESSLIST_ID = CONNECTION_ID();
SELECT PORT INTO @port
FROM performance_schema.socket_instances
WHERE THREAD_ID = @thread_id;
-# Switch to connection default
-# Establish second local TCP/IP connection (con1,localhost,root,,test,,)
+connection default;
+connect con2,$my_localhost,root,,test,,$MASTER_MYPORT;
# Store the thread_id of connection 2 (tcp/ip)
SELECT THREAD_ID INTO @thread_id
FROM performance_schema.threads
@@ -24,8 +24,8 @@ WHERE PROCESSLIST_ID = CONNECTION_ID();
SELECT PORT INTO @port
FROM performance_schema.socket_instances
WHERE THREAD_ID = @thread_id;
-# Switch to connection default
-# Establish local unix domain connection (con3,localhost,root,,test,,)
+connection default;
+connect con3,localhost,root,,test,,;
# Store the thread id of connection 3 (unix domain)
SELECT THREAD_ID INTO @thread_id
FROM performance_schema.threads
@@ -34,7 +34,7 @@ WHERE PROCESSLIST_ID = CONNECTION_ID();
SELECT PORT INTO @port
FROM performance_schema.socket_instances
WHERE THREAD_ID = @thread_id;
-# Switch to connection default
+connection default;
# EVENT_NAME is the "wait/io/socket/*" instrument identifier.
SELECT COUNT(*) = 0 AS "Expect 1"
FROM performance_schema.socket_instances
@@ -196,7 +196,14 @@ EVENT_NAME IP
wait/io/socket/sql/client_connection <LOCALHOST>
wait/io/socket/sql/client_connection <LOCALHOST>
wait/io/socket/sql/client_connection
-# Disconnect con1, con2 and con3
+connection default;
+connection con1;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection con3;
+disconnect con3;
+connection default;
# After waiting a bit we should have no differences to socket_instances
# before con1, con2, con3 connecting.
SELECT *
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result
index 9cd668c8e7a..455b6a2ad00 100644
--- a/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_event_name_func.result
@@ -1,6 +1,7 @@
#==============================================================================
# Establish the level of IPV6 support
#==============================================================================
+connection default;
#==============================================================================
# Get hostname, port number
#==============================================================================
@@ -12,6 +13,7 @@ SELECT @@port INTO @MY_MASTER_PORT;
# 1.1 Disable instrumentation of the default (this) connection
+connection default;
UPDATE performance_schema.threads
SET INSTRUMENTED='NO' WHERE PROCESSLIST_ID = CONNECTION_ID();
@@ -74,23 +76,27 @@ TRUNCATE performance_schema.socket_summary_by_event_name;
for later comparison to the 'after' byte count as a simple confirmation
that the table was updated.
+connection default;
SELECT sum(SUM_NUMBER_OF_BYTES_WRITE) INTO @my_write_count
FROM performance_schema.socket_summary_by_instance;
# 3.3 From connection 1, insert one a 1K row of data into t1
+connection con1;
USE mysqltest;
INSERT INTO t1 (s1) VALUES (REPEAT('a', 1024));
INSERT INTO t1 (s1) SELECT s1 FROM t1;
# 3.4 From connection 2, insert one a 1K row of data into t2
+connection con2;
USE mysqltest;
INSERT INTO t2 (s1) VALUES (REPEAT('a', 1024));
INSERT INTO t2 (s1) SELECT s1 FROM t2;
# 3.5 Get the 'after' sum of bytes written from socket_summary_by_instance
+connection default;
SELECT sum(SUM_NUMBER_OF_BYTES_WRITE) INTO @my_write_count
FROM performance_schema.socket_summary_by_instance;
@@ -112,10 +118,15 @@ consistent with totals in socket_summary_by_instance
# 5.1 Disconnect con1
+connection con1;
+disconnect con1;
# 5.2 Disconnect con2
+connection con2;
+disconnect con2;
# 5.3 Drop mysqltest
+connection default;
DROP DATABASE mysqltest;
diff --git a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
index 21b99360e64..bf515500c2f 100644
--- a/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
+++ b/mysql-test/suite/perfschema/r/socket_summary_by_instance_func.result
@@ -46,51 +46,63 @@ DROP USER 'root0123456789'@'localhost';
# length of user name = 4 character
# length of default db = 9 character
# connection runs through server_tcpip_socket !
+connect con1,localhost,root,,mysqltest,,;
DO 1;
+connection default;
# 3 Variations on SELECT
# 3.1 Check a SELECT ending with server sending an error message.
# Error message is short (unknown table).
SELECT col2 FROM does_not_exist;
ERROR 42S02: Table 'mysqltest.does_not_exist' doesn't exist
+connection default;
# 3.2 SELECT ending with server sending an error message.
# Now the statement is a bit longer but the error message
# length does again not depend on statement.
SELECT col2 FROM does_not_exist WHERE col1 = 0;
ERROR 42S02: Table 'mysqltest.does_not_exist' doesn't exist
+connection default;
# 3.3 SELECT ending with server sending an error message.
# The statement has the same length like in 3.2 but the error
# message is now different and much longer.
SELECT col2 FROM does_not_exist WHERE col1 A 0;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'A 0' at line 1
+connection default;
# 3.4 SELECT ending with server sending an error message.
# Statement and error message are a bit longer than in 3.1
# because the table name is longer.
SELECT col2 FROM does_not_exist0123;
ERROR 42S02: Table 'mysqltest.does_not_exist0123' doesn't exist
+connection default;
# 3.5 SELECT earning an empty result set.
SELECT col2 FROM mysqltest.my_aux WHERE col1 = -1;
col2
+connection default;
# 3.6 SELECT earning an empty result set.
# Short column name is replaced by longer alias.
SELECT col2 AS my_super_col FROM mysqltest.my_aux WHERE col1 = -1;
my_super_col
+connection default;
# 3.7 SELECT earning one row with an empty string.
SELECT col2 FROM mysqltest.my_aux WHERE col1 = 1;
col2
+connection default;
# 3.8 SELECT earning one row with one string one char long.
SELECT col2 FROM mysqltest.my_aux WHERE col1 = 2;
col2
a
+connection default;
# 3.9 SELECT earning one row with one string 1024 char long.
SELECT col2 FROM mysqltest.my_aux WHERE col1 = 3;
col2
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+connection default;
# 3.10 SELECT earning two rows with an empty string
SELECT col2 FROM mysqltest.my_aux WHERE col1 < 2;
col2
+connection default;
# 3.11 Check that the preceding Connects/SQL command runs have not
# caused some unexpected state.
# 4. Check delta (value_after_action - value_before_action) details
@@ -205,3 +217,4 @@ col2
# It must reset all counters.
TRUNCATE TABLE performance_schema.socket_summary_by_instance;
# 6. Cleanup
+connection default;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_function.result b/mysql-test/suite/perfschema/r/stage_mdl_function.result
index 098ff4f2132..eb72fa338aa 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_function.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_function.result
@@ -1,3 +1,4 @@
+connect con1, localhost, user1, , ;
drop function if exists test.f1;
create function test.f1() returns int
return 1;
@@ -5,7 +6,9 @@ begin;
select test.f1();
test.f1()
1
+connect con2, localhost, user2, , ;
drop function test.f1;
+connection default;
call dump_one_thread('user1');
username event_name sql_text
user1 statement/sql/select select test.f1()
@@ -28,7 +31,12 @@ username event_name nesting_event_type
user2 stage/sql/Waiting for stored function metadata lock STATEMENT
username event_name nesting_event_type
user2 stage/sql/init STATEMENT
+connection con1;
select f1();
f1()
1
commit;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_global.result b/mysql-test/suite/perfschema/r/stage_mdl_global.result
index b476689338e..f82874bef74 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_global.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_global.result
@@ -1,5 +1,8 @@
+connect con1, localhost, user1, , ;
flush tables with read lock;
+connect con2, localhost, user2, , ;
insert into test.t1 values (1), (2), (3);
+connection default;
call dump_one_thread('user1');
username event_name sql_text
user1 statement/sql/flush flush tables with read lock
@@ -22,4 +25,9 @@ username event_name nesting_event_type
user2 stage/sql/init STATEMENT
user2 stage/sql/checking permissions STATEMENT
user2 stage/sql/Opening tables STATEMENT
+connection con1;
unlock tables;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
index 1eeae4fc4fa..8f7e70bc740 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_procedure.result
@@ -1,3 +1,4 @@
+connect con1, localhost, user1, , ;
drop function if exists test.f1;
drop procedure if exists test.p1;
create function test.f1() returns int
@@ -12,7 +13,9 @@ begin;
select test.f1();
test.f1()
1
+connect con2, localhost, user2, , ;
drop procedure test.p1;
+connection default;
call dump_one_thread('user1');
username event_name sql_text
user1 statement/sql/select select test.f1()
@@ -35,8 +38,13 @@ username event_name nesting_event_type
user2 stage/sql/Waiting for stored procedure metadata lock STATEMENT
username event_name nesting_event_type
user2 stage/sql/init STATEMENT
+connection con1;
select test.f1();
test.f1()
1
commit;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
drop function test.f1;
diff --git a/mysql-test/suite/perfschema/r/stage_mdl_table.result b/mysql-test/suite/perfschema/r/stage_mdl_table.result
index 0699c28ac47..f7d519bedeb 100644
--- a/mysql-test/suite/perfschema/r/stage_mdl_table.result
+++ b/mysql-test/suite/perfschema/r/stage_mdl_table.result
@@ -1,3 +1,4 @@
+connect con1, localhost, user1, , ;
begin;
insert into test.t1 values (1), (2), (3);
commit;
@@ -7,7 +8,9 @@ a
1
2
3
+connect con2, localhost, user2, , ;
alter table test.t1 add column (b int);
+connection default;
call dump_one_thread('user1');
username event_name sql_text
user1 statement/sql/select select * from test.t1 for update
@@ -38,4 +41,9 @@ user2 stage/sql/After opening tables STATEMENT
user2 stage/sql/setup STATEMENT
user2 stage/sql/creating table STATEMENT
user2 stage/sql/After create STATEMENT
+connection con1;
commit;
+disconnect con1;
+connection con2;
+disconnect con2;
+connection default;
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
index 189a3200a91..73a4696070d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -303,9 +306,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -369,6 +374,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -407,7 +413,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -471,9 +477,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -542,6 +550,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -587,7 +596,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -656,9 +665,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -732,6 +743,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -784,7 +796,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -858,11 +870,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 0
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -936,6 +949,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1087,7 +1101,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1160,7 +1174,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1232,7 +1246,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1303,7 +1317,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1373,6 +1387,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
index b4fbf37265a..bb7cfdc92c7 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -302,9 +305,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -368,6 +373,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -406,7 +412,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -470,9 +476,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -541,6 +549,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -586,7 +595,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -655,9 +664,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -731,6 +742,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -783,7 +795,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -857,11 +869,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 132
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -935,6 +948,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1086,7 +1100,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1159,7 +1173,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1231,7 +1245,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1302,7 +1316,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1372,6 +1386,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
index d20378236f5..816df3de09a 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -303,9 +306,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -369,6 +374,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -407,7 +413,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -471,9 +477,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -542,6 +550,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -587,7 +596,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -656,9 +665,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -732,6 +743,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -784,7 +796,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -858,11 +870,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 0
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -936,6 +949,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1087,7 +1101,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1160,7 +1174,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1232,7 +1246,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1303,7 +1317,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1373,6 +1387,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
index 087ed9e63ab..d44488d75f9 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -302,9 +305,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -368,6 +373,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -406,7 +412,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -470,9 +476,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -541,6 +549,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -586,7 +595,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -655,9 +664,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -731,6 +742,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -783,7 +795,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -857,11 +869,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 132
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -935,6 +948,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1086,7 +1100,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1159,7 +1173,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1231,7 +1245,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1302,7 +1316,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1372,6 +1386,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
index 860059fe0eb..a70e6ee1df5 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result
@@ -150,9 +150,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -211,6 +213,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -242,7 +245,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -375,6 +380,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -413,7 +419,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -481,9 +487,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -556,6 +564,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -601,7 +610,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -674,9 +683,11 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 0
TABLE test t3 82
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -754,6 +765,7 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 0
TABLE test t3 82
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -806,7 +818,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -884,11 +896,12 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 0
TABLE test t3 82
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -966,6 +979,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1125,7 +1139,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1202,7 +1216,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1278,7 +1292,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1353,7 +1367,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1427,6 +1441,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
index 50bc51b8da6..d4d19f5db05 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result
@@ -149,9 +149,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -210,6 +212,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -241,7 +244,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -306,9 +309,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -378,6 +383,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -416,7 +422,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -486,9 +492,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -563,6 +571,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -608,7 +617,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -683,9 +692,11 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 60
TABLE test t3 82
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -765,6 +776,7 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 60
TABLE test t3 82
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -817,7 +829,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -897,11 +909,12 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 60
TABLE test t3 82
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -981,6 +994,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1144,7 +1158,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1223,7 +1237,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1301,7 +1315,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1378,7 +1392,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1454,6 +1468,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
index 9340014985e..7fa8781ad49 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result
@@ -150,9 +150,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -211,6 +213,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -242,7 +245,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -375,6 +380,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -413,7 +419,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -481,9 +487,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -556,6 +564,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -601,7 +610,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -674,9 +683,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -754,6 +765,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -806,7 +818,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -884,11 +896,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 0
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -966,6 +979,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1125,7 +1139,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1202,7 +1216,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1278,7 +1292,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1353,7 +1367,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1427,6 +1441,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
index 53ec7343676..e138ad6542a 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result
@@ -149,9 +149,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -210,6 +212,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -241,7 +244,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -306,9 +309,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -378,6 +383,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -416,7 +422,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -486,9 +492,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -563,6 +571,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -608,7 +617,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -683,9 +692,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -765,6 +776,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -817,7 +829,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -897,11 +909,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 132
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -981,6 +994,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1144,7 +1158,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1223,7 +1237,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1301,7 +1315,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1378,7 +1392,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1454,6 +1468,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_off.result b/mysql-test/suite/perfschema/r/table_aggregate_off.result
index 029a5d53861..9384f07f0f0 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_off.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_off.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -302,9 +305,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -368,6 +373,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -406,7 +412,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -470,9 +476,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -541,6 +549,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -586,7 +595,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -655,9 +664,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -731,6 +742,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -783,7 +795,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -857,11 +869,12 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -935,6 +948,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1086,7 +1100,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1159,7 +1173,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1231,7 +1245,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1302,7 +1316,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1372,6 +1386,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
index d5c58d478bb..42785a22c32 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -303,9 +306,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -369,6 +374,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -407,7 +413,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -471,9 +477,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -542,6 +550,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -587,7 +596,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -656,9 +665,11 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 0
TABLE test t3 82
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -732,6 +743,7 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 0
TABLE test t3 82
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -784,7 +796,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -858,11 +870,12 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 0
TABLE test t3 82
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -936,6 +949,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1087,7 +1101,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1160,7 +1174,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1232,7 +1246,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1303,7 +1317,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1373,6 +1387,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 0
TABLE test t3 86
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
index ae08a9749ef..1066228199d 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -302,9 +305,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -368,6 +373,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -406,7 +412,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -470,9 +476,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -541,6 +549,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -586,7 +595,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -655,9 +664,11 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 60
TABLE test t3 82
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -731,6 +742,7 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 60
TABLE test t3 82
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -783,7 +795,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -857,11 +869,12 @@ object_type object_schema object_name count_star
TABLE test t1 43
TABLE test t2 60
TABLE test t3 82
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -935,6 +948,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1086,7 +1100,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1159,7 +1173,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1231,7 +1245,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1302,7 +1316,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1372,6 +1386,7 @@ object_type object_schema object_name count_star
TABLE test t1 47
TABLE test t2 64
TABLE test t3 86
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
index c3849107bd4..4e36b9d75a6 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -303,9 +306,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -369,6 +374,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 0
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -407,7 +413,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -471,9 +477,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -542,6 +550,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -587,7 +596,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -656,9 +665,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -732,6 +743,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 0
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -784,7 +796,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -858,11 +870,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 0
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -936,6 +949,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1087,7 +1101,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1160,7 +1174,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1232,7 +1246,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1303,7 +1317,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1373,6 +1387,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 0
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
index f8f17d400ae..ee32194b651 100644
--- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -302,9 +305,11 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -368,6 +373,7 @@ object_type object_schema object_name count_star
TABLE test t1 18
TABLE test t2 24
TABLE test t3 31
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -406,7 +412,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -470,9 +476,11 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -541,6 +549,7 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 54
TABLE test t3 72
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -586,7 +595,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -655,9 +664,11 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -731,6 +742,7 @@ object_type object_schema object_name count_star
TABLE test t1 65
TABLE test t2 90
TABLE test t3 123
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -783,7 +795,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -857,11 +869,12 @@ object_type object_schema object_name count_star
TABLE test t1 93
TABLE test t2 132
TABLE test t3 184
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -935,6 +948,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1086,7 +1100,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1159,7 +1173,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1231,7 +1245,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1302,7 +1316,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1372,6 +1386,7 @@ object_type object_schema object_name count_star
TABLE test t1 97
TABLE test t2 136
TABLE test t3 188
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
index 2aeeffdedcc..2d3d2d38079 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
index 43088cd3cfd..b47bf2dbe1e 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
index f65e0494ebd..92c12d84f0f 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
index 2ab94084bb7..9b78d257e0e 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
index 7aec1bba281..c5481451fd3 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -373,6 +378,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -411,7 +417,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -477,9 +483,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -550,6 +558,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -595,7 +604,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -666,9 +675,11 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -744,6 +755,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -796,7 +808,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -872,11 +884,12 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -952,6 +965,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1107,7 +1121,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1182,7 +1196,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1256,7 +1270,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1329,7 +1343,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1401,6 +1415,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
index ddfc5e373dd..81f424800d6 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -374,6 +379,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -412,7 +418,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -479,9 +485,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -553,6 +561,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -598,7 +607,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -670,9 +679,11 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -749,6 +760,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -801,7 +813,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -878,11 +890,12 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -959,6 +972,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1116,7 +1130,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1192,7 +1206,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1267,7 +1281,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1341,7 +1355,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1414,6 +1428,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
index 01b1d61877f..15e62be4b22 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -373,6 +378,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -411,7 +417,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -477,9 +483,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -550,6 +558,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -595,7 +604,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -666,9 +675,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -744,6 +755,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -796,7 +808,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -872,11 +884,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -952,6 +965,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1107,7 +1121,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1182,7 +1196,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1256,7 +1270,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1329,7 +1343,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1401,6 +1415,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
index 7b2554a4b64..dbcf7aca9a4 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -374,6 +379,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -412,7 +418,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -479,9 +485,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -553,6 +561,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -598,7 +607,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -670,9 +679,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -749,6 +760,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -801,7 +813,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -878,11 +890,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -959,6 +972,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1116,7 +1130,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1192,7 +1206,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1267,7 +1281,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1341,7 +1355,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1414,6 +1428,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
index 7a950643800..1230f1e91fe 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 0
TABLE test t3 54
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
index 8f9e6278ba8..1b04e9fe898 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 23
TABLE test t2 36
TABLE test t3 54
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
index eb83349f11e..f376160939d 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 0
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 0
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 0
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
index 8c3b6a0549f..aae2c54e25c 100644
--- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 8
TABLE test t2 12
TABLE test t3 17
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 30
TABLE test t3 44
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 35
TABLE test t2 54
TABLE test t3 81
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 53
TABLE test t2 84
TABLE test t3 128
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
index f2c79374583..23f800e81d9 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
index 66a917412a9..99734474536 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_2u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 48
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
index 3b6326fd2df..fe63232cf52 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
index 85e1bbeb332..376333fc794 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_global_4u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 48
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
index 725770f2b3c..191bd161d92 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -373,6 +378,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -411,7 +417,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -477,9 +483,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -550,6 +558,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -595,7 +604,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -666,9 +675,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -744,6 +755,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -796,7 +808,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -872,11 +884,12 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -952,6 +965,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1107,7 +1121,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1182,7 +1196,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1256,7 +1270,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1329,7 +1343,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1401,6 +1415,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
index d92ec0a1997..80590d5e468 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_2u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -374,6 +379,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -412,7 +418,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -479,9 +485,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -553,6 +561,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -598,7 +607,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -670,9 +679,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -749,6 +760,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -801,7 +813,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -878,11 +890,12 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -959,6 +972,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1116,7 +1130,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1192,7 +1206,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1267,7 +1281,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1341,7 +1355,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1414,6 +1428,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
index b03a26f4694..e9b39c5db14 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_2t.result
@@ -152,9 +152,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -213,6 +215,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -244,7 +247,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -373,6 +378,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -411,7 +417,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -477,9 +483,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -550,6 +558,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -595,7 +604,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -666,9 +675,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -744,6 +755,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -796,7 +808,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -872,11 +884,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -952,6 +965,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1107,7 +1121,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1182,7 +1196,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1256,7 +1270,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1329,7 +1343,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1401,6 +1415,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
index ca62861bedb..92a020f1984 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_hist_4u_3t.result
@@ -151,9 +151,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -212,6 +214,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -243,7 +246,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -374,6 +379,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -412,7 +418,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -479,9 +485,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -553,6 +561,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -598,7 +607,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -670,9 +679,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -749,6 +760,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -801,7 +813,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -878,11 +890,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 48
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -959,6 +972,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1116,7 +1130,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1192,7 +1206,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1267,7 +1281,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1341,7 +1355,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1414,6 +1428,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
index 7c1bbd2ddb0..4cdcbc45d7d 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 0
TABLE test t3 32
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
index 302563786d2..038335c22cb 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_2u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 24
TABLE test t2 28
TABLE test t3 32
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
index 390a3523421..ac5cde25522 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_2t.result
@@ -154,9 +154,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -215,6 +217,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -246,7 +249,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -305,9 +308,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -371,6 +376,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 0
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -409,7 +415,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -473,9 +479,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -544,6 +552,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 0
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -589,7 +598,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -658,9 +667,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -734,6 +745,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 0
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -786,7 +798,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -860,11 +872,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 0
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -938,6 +951,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1089,7 +1103,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1162,7 +1176,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1234,7 +1248,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1305,7 +1319,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1375,6 +1389,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 0
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
index 123075896aa..faaf925dacd 100644
--- a/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
+++ b/mysql-test/suite/perfschema/r/table_lock_aggregate_thread_4u_3t.result
@@ -153,9 +153,11 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connect con1, localhost, user1, , ;
select concat(current_user(), " is connected") as status;
status
user1@localhost is connected
+connection default;
"================== Step 2 =================="
call dump_thread();
username event_name count_star
@@ -214,6 +216,7 @@ object_type object_schema object_name count_star
TABLE test t1 0
TABLE test t2 0
TABLE test t3 0
+connection con1;
insert into test.t1 set a=101, b=1, c=1;
insert into test.t2 set a=102, b=2, c=2;
insert into test.t2 set a=103, b=3, c=3;
@@ -245,7 +248,7 @@ a b c d
select * from test.t3 where b=5;
a b c d
105 5 5 1
-"================== con1 marker =================="
+connection default;
"================== Step 3 =================="
call dump_thread();
username event_name count_star
@@ -304,9 +307,11 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connect con2, localhost, user2, , ;
select concat(current_user(), " is connected") as status;
status
user2@localhost is connected
+connection default;
"================== Step 4 =================="
call dump_thread();
username event_name count_star
@@ -370,6 +375,7 @@ object_type object_schema object_name count_star
TABLE test t1 10
TABLE test t2 12
TABLE test t3 14
+connection con2;
insert into test.t1 set a=201, b=1, c=1;
insert into test.t2 set a=202, b=2, c=2;
insert into test.t2 set a=203, b=3, c=3;
@@ -408,7 +414,7 @@ select * from test.t3 where b=5;
a b c d
105 5 5 2
205 5 5 1
-"================== con2 marker =================="
+connection default;
"================== Step 5 =================="
call dump_thread();
username event_name count_star
@@ -472,9 +478,11 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connect con3, localhost, user3, , ;
select concat(current_user(), " is connected") as status;
status
user3@localhost is connected
+connection default;
"================== Step 6 =================="
call dump_thread();
username event_name count_star
@@ -543,6 +551,7 @@ object_type object_schema object_name count_star
TABLE test t1 20
TABLE test t2 24
TABLE test t3 28
+connection con3;
insert into test.t1 set a=301, b=1, c=1;
insert into test.t2 set a=302, b=2, c=2;
insert into test.t2 set a=303, b=3, c=3;
@@ -588,7 +597,7 @@ a b c d
105 5 5 3
205 5 5 2
305 5 5 1
-"================== con3 marker =================="
+connection default;
"================== Step 7 =================="
call dump_thread();
username event_name count_star
@@ -657,9 +666,11 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connect con4, localhost, user4, , ;
select concat(current_user(), " is connected") as status;
status
user4@localhost is connected
+connection default;
"================== Step 8 =================="
call dump_thread();
username event_name count_star
@@ -733,6 +744,7 @@ object_type object_schema object_name count_star
TABLE test t1 30
TABLE test t2 36
TABLE test t3 42
+connection con4;
insert into test.t1 set a=401, b=1, c=1;
insert into test.t2 set a=402, b=2, c=2;
insert into test.t2 set a=403, b=3, c=3;
@@ -785,7 +797,7 @@ a b c d
205 5 5 3
305 5 5 2
405 5 5 1
-"================== con4 marker =================="
+connection default;
"================== Step 9 =================="
call dump_thread();
username event_name count_star
@@ -859,11 +871,12 @@ object_type object_schema object_name count_star
TABLE test t1 40
TABLE test t2 48
TABLE test t3 56
+connection con1;
lock tables test.t1 read, test.t2 read, test.t3 read;
unlock tables;
lock tables test.t1 write, test.t2 write, test.t3 write;
unlock tables;
-"================== con1 marker =================="
+connection default;
"================== Step 10 =================="
call dump_thread();
username event_name count_star
@@ -937,6 +950,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
flush tables;
"================== flush marker =================="
"================== Step 11 =================="
@@ -1088,7 +1102,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con1 disconnected =================="
+disconnect con1;
"================== Step 13 =================="
call dump_thread();
username status
@@ -1161,7 +1175,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con2 disconnected =================="
+disconnect con2;
"================== Step 14 =================="
call dump_thread();
username status
@@ -1233,7 +1247,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con3 disconnected =================="
+disconnect con3;
"================== Step 15 =================="
call dump_thread();
username status
@@ -1304,7 +1318,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
-"================== con4 disconnected =================="
+disconnect con4;
"================== Step 16 =================="
call dump_thread();
username status
@@ -1374,6 +1388,7 @@ object_type object_schema object_name count_star
TABLE test t1 44
TABLE test t2 52
TABLE test t3 60
+connection default;
truncate performance_schema.events_waits_summary_by_thread_by_event_name;
"================== BY_THREAD truncated =================="
"================== Step 17 =================="
diff --git a/mysql-test/suite/perfschema/r/thread_cache.result b/mysql-test/suite/perfschema/r/thread_cache.result
index f64cadc2705..daa9f318e7b 100644
--- a/mysql-test/suite/perfschema/r/thread_cache.result
+++ b/mysql-test/suite/perfschema/r/thread_cache.result
@@ -4,12 +4,21 @@ set global thread_cache_size = 0;
show variables like "thread_cache_size";
Variable_name Value
thread_cache_size 0
+connect con1, localhost, root, , ;
+connect con2, localhost, root, , ;
+connection default;
select @id_increment;
@id_increment
1
select @thread_id_increment;
@thread_id_increment
1
+disconnect con2;
+connection default;
+connect con3, localhost, root, , ;
+disconnect con3;
+disconnect con1;
+connection default;
select @id_increment;
@id_increment
1
@@ -20,12 +29,21 @@ set global thread_cache_size = 100;
show variables like "thread_cache_size";
Variable_name Value
thread_cache_size 100
+connect con1, localhost, root, , ;
+connect con2, localhost, root, , ;
+connection default;
select @id_increment;
@id_increment
1
select @thread_id_increment;
@thread_id_increment
1
+disconnect con2;
+connection default;
+connect con3, localhost, root, , ;
+disconnect con3;
+disconnect con1;
+connection default;
select @id_increment;
@id_increment
1
diff --git a/mysql-test/suite/perfschema/t/global_read_lock.test b/mysql-test/suite/perfschema/t/global_read_lock.test
index 0883ed1ed42..4217de0d723 100644
--- a/mysql-test/suite/perfschema/t/global_read_lock.test
+++ b/mysql-test/suite/perfschema/t/global_read_lock.test
@@ -15,7 +15,6 @@ create user pfsuser@localhost;
grant SELECT, UPDATE, LOCK TABLES on performance_schema.* to pfsuser@localhost;
flush privileges;
---echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
lock tables performance_schema.setup_instruments read;
@@ -29,12 +28,10 @@ update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
unlock tables;
---echo connection default;
connection default;
flush tables with read lock;
---echo connection con1;
connection con1;
lock tables performance_schema.setup_instruments read;
@@ -47,7 +44,6 @@ unlock tables;
--send
lock tables performance_schema.setup_instruments write;
---echo connection default;
connection default;
let $wait_condition= select 1 from performance_schema.events_waits_current where event_name like "wait/synch/cond/sql/MDL_context::COND_wait_status";
@@ -75,7 +71,6 @@ unlock tables;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo connection default;
connection default;
drop user pfsuser@localhost;
diff --git a/mysql-test/suite/perfschema/t/nesting.test b/mysql-test/suite/perfschema/t/nesting.test
index 7f1c0b570ad..9ab59157f50 100644
--- a/mysql-test/suite/perfschema/t/nesting.test
+++ b/mysql-test/suite/perfschema/t/nesting.test
@@ -69,8 +69,6 @@ truncate performance_schema.events_statements_history_long;
connect (con1, localhost, user1, , );
-echo "================== con1 connected ==================";
-
select "MARKER_BEGIN" as marker;
select "This is simple statement one" as payload;
@@ -88,8 +86,6 @@ select "MARKER_END" as marker;
select "Con1 is done with payload" as status;
-echo "================== con1 done ==================";
-
--connection default
set @con1_tid = (select thread_id from performance_schema.threads
diff --git a/mysql-test/suite/perfschema/t/one_thread_per_con.test b/mysql-test/suite/perfschema/t/one_thread_per_con.test
index d295f2e658c..6aeec55dbb5 100644
--- a/mysql-test/suite/perfschema/t/one_thread_per_con.test
+++ b/mysql-test/suite/perfschema/t/one_thread_per_con.test
@@ -29,26 +29,17 @@ show variables like "thread_handling";
# Code to test
connection con1;
-
--- echo "----------------- Connection 1"
create table test.t1(a int) engine=MYISAM;
connection con2;
-
--- echo "----------------- Connection 2"
create table test.t2(a int) engine=MYISAM;
connection con3;
-
--- echo "----------------- Connection 3"
create table test.t3(a int) engine=MYISAM;
# Verification
connection default;
-
--- echo "----------------- Connection default"
-
--disable_query_log
eval set @tid= $con1_THREAD_ID;
--enable_query_log
diff --git a/mysql-test/suite/perfschema/t/read_only.test b/mysql-test/suite/perfschema/t/read_only.test
index 7b0284a7a48..0020c64937b 100644
--- a/mysql-test/suite/perfschema/t/read_only.test
+++ b/mysql-test/suite/perfschema/t/read_only.test
@@ -15,15 +15,12 @@ create user pfsuser@localhost;
grant SELECT, UPDATE on performance_schema.* to pfsuser@localhost;
flush privileges;
---echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
---echo connection default;
connection default;
set global read_only=0;
---echo connection con1;
connection con1;
select @@global.read_only;
@@ -34,12 +31,10 @@ update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
--enable_result_log
---echo connection default;
connection default;
set global read_only=1;
---echo connection con1;
connection con1;
select @@global.read_only;
@@ -52,14 +47,12 @@ update performance_schema.setup_instruments set enabled='NO';
update performance_schema.setup_instruments set enabled='YES';
--enable_result_log
---echo connection default;
connection default;
grant super on *.* to pfsuser@localhost;
flush privileges;
disconnect con1;
---echo connect (con1, localhost, pfsuser, , test);
connect (con1, localhost, pfsuser, , test);
select @@global.read_only;
@@ -73,7 +66,6 @@ update performance_schema.setup_instruments set enabled='YES';
disconnect con1;
--source include/wait_until_disconnected.inc
---echo connection default;
connection default;
set global read_only= @start_read_only;
diff --git a/mysql-test/suite/perfschema/t/relaylog.test b/mysql-test/suite/perfschema/t/relaylog.test
index 1455d1297e2..12fc96a8b27 100644
--- a/mysql-test/suite/perfschema/t/relaylog.test
+++ b/mysql-test/suite/perfschema/t/relaylog.test
@@ -34,7 +34,6 @@ drop table test.t1;
#
connection master;
--- echo "============ Performance schema on master ============"
select
substring(file_name, locate("master-", file_name)) as FILE_NAME,
diff --git a/mysql-test/suite/perfschema/t/rpl_gtid_func.test b/mysql-test/suite/perfschema/t/rpl_gtid_func.test
index 6373d4284dc..048dbca0576 100644
--- a/mysql-test/suite/perfschema/t/rpl_gtid_func.test
+++ b/mysql-test/suite/perfschema/t/rpl_gtid_func.test
@@ -6,7 +6,6 @@
-- source include/master-slave.inc
connection master;
---echo **** On Master ****
--disable_warnings
drop table if exists test.marker;
@@ -23,7 +22,6 @@ update performance_schema.setup_instruments
set enabled='YES', timed='YES';
sync_slave_with_master;
---echo **** On Slave ****
truncate table performance_schema.events_waits_history_long;
truncate table performance_schema.events_statements_summary_by_digest;
@@ -32,7 +30,6 @@ update performance_schema.setup_instruments
set enabled='YES', timed='NO';
connection master;
---echo **** On Master ****
select * from performance_schema.setup_instruments
where timed='NO';
@@ -52,7 +49,6 @@ select digest_text, count_star
insert into test.marker values (2);
sync_slave_with_master;
---echo **** On Slave ****
select * from test.marker;
@@ -72,11 +68,9 @@ select digest_text, count_star
where digest_text like "%in_%_digest%";
connection master;
---echo **** On Master ****
delete from performance_schema.setup_objects
where object_schema='master';
sync_slave_with_master;
---echo **** On Slave ****
delete from performance_schema.setup_objects
where object_schema='slave';
diff --git a/mysql-test/suite/perfschema/t/rpl_statements.test b/mysql-test/suite/perfschema/t/rpl_statements.test
index 4f65cdcbd7b..a4604e7904c 100644
--- a/mysql-test/suite/perfschema/t/rpl_statements.test
+++ b/mysql-test/suite/perfschema/t/rpl_statements.test
@@ -57,10 +57,6 @@ let $pfs_instrument='%statement/%';
connection master;
--echo
---echo **************
---echo *** MASTER ***
---echo **************
---echo
--echo *** Create test tables
--echo
@@ -76,9 +72,6 @@ create table test.marker(s1 int) engine=innodb;
sync_slave_with_master;
---echo **************
---echo *** SLAVE ***
---echo **************
--echo
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
@@ -90,18 +83,12 @@ sync_slave_with_master;
connection master;
---echo **************
---echo *** MASTER ***
---echo **************
--echo
insert into test.marker values (0);
--echo
sync_slave_with_master;
---echo **************
---echo *** SLAVE ***
---echo **************
--echo
--echo *** Verify row, get replication thread id, clear statement events
--echo
@@ -125,9 +112,6 @@ select count(*) = 1 as 'Expect 1' from test.marker;
connection master;
---echo **************
---echo *** MASTER ***
---echo **************
--echo
show variables like 'binlog_format%';
@@ -212,10 +196,6 @@ create table test.master_events_statements_history_long as
sync_slave_with_master;
---echo **************
---echo *** SLAVE ***
---echo **************
-
--source ../include/disable_instruments.inc
--echo
@@ -282,9 +262,6 @@ select * from performance_schema.setup_instruments where name like '%statement/a
connection master;
---echo **************
---echo *** MASTER ***
---echo **************
--echo
--echo *** Clear statement events
--source ../include/rpl_statements_truncate.inc
@@ -301,9 +278,6 @@ insert into marker1_db.table1 values (999, '999'), (998, '998'), (997, '997');
sync_slave_with_master;
---echo **************
---echo *** SLAVE ***
---echo **************
--echo
--echo *** Confirm rows were replicated
--echo
diff --git a/mysql-test/suite/perfschema/t/setup_actors.test b/mysql-test/suite/perfschema/t/setup_actors.test
index 39d60b0ab03..1d4a86b6517 100644
--- a/mysql-test/suite/perfschema/t/setup_actors.test
+++ b/mysql-test/suite/perfschema/t/setup_actors.test
@@ -46,7 +46,6 @@ grant select on test.* to user5@localhost;
flush privileges;
---echo # Switch to (con1, localhost, user1, , )
connect (con1, localhost, user1, , );
# INSTRUMENTED must be NO because there is no match in performance_schema.setup_actors
@@ -56,12 +55,10 @@ where PROCESSLIST_ID = connection_id();
let $con1_thread_id= `select THREAD_ID from performance_schema.threads
where PROCESSLIST_ID = connection_id()`;
---echo # Switch to connection default
--connection default
insert into performance_schema.setup_actors
values ('%', 'user1', '%');
---echo # Switch to connection con1
--connection con1
# INSTRUMENTED must be NO because there was no match in performance_schema.setup_actors
# when our current session made its connect. Later changes in setup_actors have no
@@ -70,10 +67,8 @@ select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
---echo # Disconnect con1
--disconnect con1
---echo # Switch to (con2, localhost, user2, , )
connect (con2, localhost, user2, , );
# INSTRUMENTED must be YES because there is a match via
@@ -84,10 +79,8 @@ where PROCESSLIST_ID=connection_id();
let $con2_thread_id= `select THREAD_ID from performance_schema.threads
where PROCESSLIST_ID = connection_id()`;
---echo # Disconnect con2
--disconnect con2
---echo # Switch to connection default
--connection default
# If a thread dies, we don't expect its THREAD_ID value will be re-used.
if ($con2_thread_id <= $con1_thread_id)
@@ -102,7 +95,6 @@ drop table if exists test.t1;
create table test.t1 (col1 bigint);
lock table test.t1 write;
---echo # Switch to (con3, localhost, user3, , )
connect (con3, localhost, user3, , );
# INSTRUMENTED must be YES because there is a match via
@@ -138,7 +130,6 @@ where PROCESSLIST_ID = connection_id();
--echo # comes back. We will pull this later.
send
insert into test.t1 set col1 = 1;
---echo # Switch to (con4, localhost, user4, , )
connect (con4, localhost, user4, , );
--echo # Poll till INFO is no more NULL and State = 'Waiting for table metadata lock'.
let $wait_condition= select count(*) from information_schema.processlist
@@ -154,29 +145,23 @@ from performance_schema.threads T inner join information_schema.PROCESSLIST P
where T.PROCESSLIST_USER = 'user3' and T.NAME = 'thread/sql/one_connection';
# Resolve the situation + some cleanup
---echo # Switch to connection default
--connection default
unlock tables;
---echo # Switch to connection con3 and reap the result of the no more blocked insert
--connection con3
+--echo # Reap the result of the no more blocked insert
--reap
---echo # Switch to connection default
--connection default
drop table test.t1;
---echo # Disconnect con3
--disconnect con3
---echo # Switch to connection con4
--connection con4
# INSTRUMENTED must be NO because there is no match in performance_schema.setup_actors
select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
---echo # Disconnect con4
--disconnect con4
---echo # Switch to connection default
--connection default
insert into performance_schema.setup_actors
@@ -185,7 +170,6 @@ values ('localhost', '%', '%');
select * from performance_schema.setup_actors
order by USER, HOST, ROLE;
---echo # Switch to (con4b, localhost, user4, , )
connect (con4b, localhost, user4, , );
# INSTRUMENTED must be YES because there is a match via
@@ -194,10 +178,8 @@ select NAME, TYPE, INSTRUMENTED, PROCESSLIST_USER, PROCESSLIST_HOST
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
---echo # Disconnect con4b
--disconnect con4b
---echo # Switch to connection default
--connection default
insert into performance_schema.setup_actors
values ('%', 'user5', '%');
@@ -206,7 +188,6 @@ create sql security definer view test.v1 as select NAME, TYPE, INSTRUMENTED, PRO
from performance_schema.threads
where PROCESSLIST_ID = connection_id();
---echo # Switch to (con5, localhost, user5, , )
connect (con5, localhost, user5, , );
--error ER_TABLEACCESS_DENIED_ERROR
@@ -221,12 +202,10 @@ select * from performance_schema.threads;
# Therefore PROCESSLIST_USER must be 'user5' though we run with right's of definer 'root'
select * from test.v1;
---echo # Disconnect con5
--disconnect con5
--source include/wait_until_disconnected.inc
---echo # Switch to connection default and cleanup
--connection default
drop view test.v1;
diff --git a/mysql-test/suite/perfschema/t/socket_instances_func.test b/mysql-test/suite/perfschema/t/socket_instances_func.test
index 12411103579..4cf58d42185 100644
--- a/mysql-test/suite/perfschema/t/socket_instances_func.test
+++ b/mysql-test/suite/perfschema/t/socket_instances_func.test
@@ -58,8 +58,6 @@ let $con0_thread_id= `SELECT @thread_id`;
#
# Start connection with IP = localhost (127.0.0.1 or ::1)
---echo # Establish local TCP/IP connection (con1,localhost,root,,test,,)
---disable_query_log ONCE
--connect (con1,$my_localhost,root,,test,,$MASTER_MYPORT)
if($my_socket_debug)
@@ -81,7 +79,6 @@ WHERE THREAD_ID = @thread_id;
let $con1_thread_id= `SELECT @thread_id`;
let $con1_port= `SELECT @port`;
---echo # Switch to connection default
--connection default
#
@@ -89,8 +86,6 @@ let $con1_port= `SELECT @port`;
#
# Start a second connection with IP = localhost (127.0.0.1 or ::1)
---echo # Establish second local TCP/IP connection (con1,localhost,root,,test,,)
---disable_query_log ONCE
--connect (con2,$my_localhost,root,,test,,$MASTER_MYPORT)
if($my_socket_debug)
@@ -112,7 +107,6 @@ WHERE THREAD_ID = @thread_id;
let $con2_thread_id= `SELECT @thread_id`;
let $con2_port= `SELECT @port`;
---echo # Switch to connection default
--connection default
#
@@ -120,7 +114,6 @@ let $con2_port= `SELECT @port`;
#
# Connect via mysql sock file
---echo # Establish local unix domain connection (con3,localhost,root,,test,,)
--connect(con3,localhost,root,,test,,)
if($my_socket_debug)
@@ -142,7 +135,6 @@ WHERE THREAD_ID = @thread_id;
let $con3_port= `SELECT @port`;
let $con3_thread_id= `SELECT @thread_id`;
---echo # Switch to connection default
--connection default
#
@@ -419,7 +411,6 @@ $part;
# DROP CLIENT CONNECTIONS
#
---echo # Disconnect con1, con2 and con3
--connection con1
--disconnect con1
--source include/wait_until_disconnected.inc
diff --git a/mysql-test/suite/plugins/r/auth_v0100.result b/mysql-test/suite/plugins/r/auth_v0100.result
index 325d3dd882c..da3cce7440e 100644
--- a/mysql-test/suite/plugins/r/auth_v0100.result
+++ b/mysql-test/suite/plugins/r/auth_v0100.result
@@ -7,12 +7,16 @@ create user tt identified via auth_0x0100;
create user zzzzzzzzzzzzzzzz;
grant select on test.* to zzzzzzzzzzzzzzzz;
connect(localhost,tt,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect c0,localhost,tt;
ERROR 28000: Access denied for user 'tt'@'localhost' (using password: YES)
grant proxy on zzzzzzzzzzzzzzzz to tt;
+connect c1,localhost,tt;
+connection c1;
select user(), current_user(), @@external_user;
user() tt@localhost
current_user() zzzzzzzzzzzzzzzz@%
@@external_user oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo.
+connection default;
drop user tt;
drop user zzzzzzzzzzzzzzzz;
uninstall plugin auth_0x0100;
diff --git a/mysql-test/suite/plugins/r/qc_info_priv.result b/mysql-test/suite/plugins/r/qc_info_priv.result
index 9ac01ac31ad..83a84bb76e9 100644
--- a/mysql-test/suite/plugins/r/qc_info_priv.result
+++ b/mysql-test/suite/plugins/r/qc_info_priv.result
@@ -30,6 +30,8 @@ STATEMENT_SCHEMA STATEMENT_TEXT RESULT_BLOCKS_COUNT RESULT_BLOCKS_SIZE RESULT_BL
test select * from t1 1 512 # -1 1011 513 binary utf32 utf32_bin Europe/Moscow 4 7 STRICT_ALL_TABLES ar_SD 1 1 # 0 0 0 #
test select * from t1 1 512 # -1 1024 1024 latin1 latin1 latin1_swedish_ci SYSTEM 0 4 NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION en_US 1 1 # 0 0 1 #
create user mysqltest;
+connect conn1,localhost,mysqltest,,;
+connection conn1;
select a from t1;
a
1
@@ -38,6 +40,7 @@ a
select count(*) from information_schema.query_cache_info;
count(*)
0
+connection default;
drop user mysqltest;
drop table t1;
set global query_cache_size= default;
diff --git a/mysql-test/suite/plugins/r/server_audit.result b/mysql-test/suite/plugins/r/server_audit.result
index 2577a36cad4..26a7d1b872c 100644
--- a/mysql-test/suite/plugins/r/server_audit.result
+++ b/mysql-test/suite/plugins/r/server_audit.result
@@ -22,8 +22,13 @@ set global server_audit_incl_users=null;
set global server_audit_file_path='server_audit.log';
set global server_audit_output_type=file;
set global server_audit_logging=on;
+connect con1,localhost,root,,mysql;
+connection default;
+disconnect con1;
connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,no_such_user,,mysql;
ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO)
+connection default;
set global server_audit_incl_users='odin, dva, tri';
create table t1 (id int);
set global server_audit_incl_users='odin, root, dva, tri';
@@ -84,6 +89,8 @@ server_audit_syslog_priority LOG_INFO
set global server_audit_mode=1;
set global server_audit_events='';
create database sa_db;
+connect con1,localhost,root,,test;
+connection con1;
create table t1 (id2 int);
insert into t1 values (1), (2);
select * from t1;
@@ -96,6 +103,8 @@ create table sa_t1(id int);
insert into sa_t1 values (1), (2);
drop table sa_t1;
drop database sa_db;
+connection default;
+disconnect con1;
create database sa_db;
use sa_db;
CREATE USER u1 IDENTIFIED BY 'pwd-123';
diff --git a/mysql-test/suite/plugins/r/thread_pool_server_audit.result b/mysql-test/suite/plugins/r/thread_pool_server_audit.result
index 2577a36cad4..26a7d1b872c 100644
--- a/mysql-test/suite/plugins/r/thread_pool_server_audit.result
+++ b/mysql-test/suite/plugins/r/thread_pool_server_audit.result
@@ -22,8 +22,13 @@ set global server_audit_incl_users=null;
set global server_audit_file_path='server_audit.log';
set global server_audit_output_type=file;
set global server_audit_logging=on;
+connect con1,localhost,root,,mysql;
+connection default;
+disconnect con1;
connect(localhost,no_such_user,,mysql,MASTER_PORT,MASTER_SOCKET);
+connect con1,localhost,no_such_user,,mysql;
ERROR 28000: Access denied for user 'no_such_user'@'localhost' (using password: NO)
+connection default;
set global server_audit_incl_users='odin, dva, tri';
create table t1 (id int);
set global server_audit_incl_users='odin, root, dva, tri';
@@ -84,6 +89,8 @@ server_audit_syslog_priority LOG_INFO
set global server_audit_mode=1;
set global server_audit_events='';
create database sa_db;
+connect con1,localhost,root,,test;
+connection con1;
create table t1 (id2 int);
insert into t1 values (1), (2);
select * from t1;
@@ -96,6 +103,8 @@ create table sa_t1(id int);
insert into sa_t1 values (1), (2);
drop table sa_t1;
drop database sa_db;
+connection default;
+disconnect con1;
create database sa_db;
use sa_db;
CREATE USER u1 IDENTIFIED BY 'pwd-123';
diff --git a/mysql-test/suite/roles/admin.result b/mysql-test/suite/roles/admin.result
index 838f2ea165d..87d2888b47c 100644
--- a/mysql-test/suite/roles/admin.result
+++ b/mysql-test/suite/roles/admin.result
@@ -6,11 +6,13 @@ create role role3 with admin current_role;
ERROR 0L000: Invalid definer
create role role3 with admin role1;
create role role4 with admin root@localhost;
+connect c1, localhost, foo,,;
create role role5 with admin root@localhost;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
create role role5 with admin role3;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
create role role5 with admin foo@localhost;
+connection default;
call mtr.add_suppression("Invalid roles_mapping table entry user:'foo@bar', rolename:'role6'");
create role role6 with admin foo@bar;
Warnings:
diff --git a/mysql-test/suite/roles/create_and_drop_role.result b/mysql-test/suite/roles/create_and_drop_role.result
index d565b888c5f..66c5551ef43 100644
--- a/mysql-test/suite/roles/create_and_drop_role.result
+++ b/mysql-test/suite/roles/create_and_drop_role.result
@@ -1,3 +1,4 @@
+connect mysql, localhost, root,,;
use mysql;
create role test_role1@host1;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@host1' at line 1
@@ -34,6 +35,8 @@ ERROR HY000: Operation DROP ROLE failed for 'dummy'
drop user dummy@'';
select user, host, is_role from user where user like 'test%';
user host is_role
+disconnect mysql;
+connection default;
create role '';
ERROR OP000: Invalid role specification ``.
create role ' ';
diff --git a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
index 27149c4bf17..e18149975ad 100644
--- a/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
+++ b/mysql-test/suite/roles/create_and_drop_role_invalid_user_table.result
@@ -1,3 +1,4 @@
+connect mysql, localhost, root,,;
use mysql;
alter table user drop column is_role;
alter table user drop column default_role;
diff --git a/mysql-test/suite/roles/default_create_user_not_role.result b/mysql-test/suite/roles/default_create_user_not_role.result
index 1ddb054c092..171015f6e82 100644
--- a/mysql-test/suite/roles/default_create_user_not_role.result
+++ b/mysql-test/suite/roles/default_create_user_not_role.result
@@ -1,6 +1,8 @@
+connect mysql, localhost, root,,;
use mysql;
create user 'test'@'localhost';
select user, host, is_role from user where user='test' and host='localhost';
user host is_role
test localhost N
drop user 'test'@'localhost';
+disconnect mysql;
diff --git a/mysql-test/suite/roles/definer.result b/mysql-test/suite/roles/definer.result
index 7ced6255629..293e5e539bc 100644
--- a/mysql-test/suite/roles/definer.result
+++ b/mysql-test/suite/roles/definer.result
@@ -34,6 +34,8 @@ View Create View character_set_client collation_connection
v3 CREATE ALGORITHM=UNDEFINED DEFINER=`role3`@`%` SQL SECURITY DEFINER VIEW `test`.`v3` AS select (`mysqltest1`.`t1`.`a` + `mysqltest1`.`t1`.`b`) AS `a+b`,`mysqltest1`.`t1`.`c` AS `c` from `mysqltest1`.`t1` latin1 latin1_swedish_ci
Warnings:
Note 1449 The user specified as a definer ('role3'@'%') does not exist
+connect c1, localhost, foo,,mysqltest1;
+connection c1;
show grants;
Grants for foo@localhost
GRANT role4 TO 'foo'@'localhost'
@@ -71,6 +73,7 @@ select * from test.v5;
a+b c
11 100
22 200
+connection default;
drop role role4;
show create view test.v5;
View Create View character_set_client collation_connection
diff --git a/mysql-test/suite/roles/drop_current_user-5176.result b/mysql-test/suite/roles/drop_current_user-5176.result
index ea9f4fa4f92..9c4041a0d1e 100644
--- a/mysql-test/suite/roles/drop_current_user-5176.result
+++ b/mysql-test/suite/roles/drop_current_user-5176.result
@@ -1,5 +1,6 @@
create user foo@localhost;
grant create user on *.* to foo@localhost;
+connect foo,localhost,foo,,;
drop user foo@localhost;
select * from information_schema.applicable_roles;
GRANTEE ROLE_NAME IS_GRANTABLE IS_DEFAULT
diff --git a/mysql-test/suite/roles/drop_routines.result b/mysql-test/suite/roles/drop_routines.result
index ad2a82c37c5..11eda3a290f 100644
--- a/mysql-test/suite/roles/drop_routines.result
+++ b/mysql-test/suite/roles/drop_routines.result
@@ -69,11 +69,13 @@ GRANT UPDATE ON `mysql`.`user` TO 'r3'
GRANT USAGE ON *.* TO 'r2'
GRANT USAGE ON *.* TO 'r3'
GRANT r3 TO 'r2'
+connect u1,localhost,u1,,;
select mysql.test_func("none");
ERROR 42000: execute command denied to user 'u1'@'%' for routine 'mysql.test_func'
set role r1;
select mysql.test_func("r1");
ERROR 42000: execute command denied to user 'u1'@'%' for routine 'mysql.test_func'
+connection default;
drop function mysql.test_func;
drop role r1, r2, r3;
drop user u1;
diff --git a/mysql-test/suite/roles/grant-5771.result b/mysql-test/suite/roles/grant-5771.result
index 5d79820e7a0..87797d8b9a4 100644
--- a/mysql-test/suite/roles/grant-5771.result
+++ b/mysql-test/suite/roles/grant-5771.result
@@ -6,6 +6,7 @@ grant all on mysqltest1.* to r1;
grant all on mysqltest2.* to r2;
grant r1 to r2;
grant r2 to foo@localhost;
+connect foo,localhost,foo,,;
select current_user;
current_user
foo@localhost
@@ -27,6 +28,7 @@ GRANT USAGE ON *.* TO 'r2'
GRANT ALL PRIVILEGES ON `mysqltest2`.* TO 'r2'
GRANT USAGE ON *.* TO 'r1'
GRANT ALL PRIVILEGES ON `mysqltest1`.* TO 'r1'
+connection default;
drop user foo@localhost;
drop role r1;
drop role r2;
diff --git a/mysql-test/suite/roles/grant_empty.result b/mysql-test/suite/roles/grant_empty.result
index dfc0f513396..cfe74fa7aa3 100644
--- a/mysql-test/suite/roles/grant_empty.result
+++ b/mysql-test/suite/roles/grant_empty.result
@@ -3,6 +3,7 @@ ERROR OP000: Invalid role specification ``.
create user ''@localhost;
create role r1;
grant r1 to ''@localhost;
+connect con1,localhost,nonexisting_user,,;
select current_user;
current_user
@localhost
@@ -10,5 +11,6 @@ show grants;
Grants for @localhost
GRANT r1 TO ''@'localhost'
GRANT USAGE ON *.* TO ''@'localhost'
+connection default;
drop role r1;
drop user ''@localhost;
diff --git a/mysql-test/suite/roles/grant_role_auto_create_user.result b/mysql-test/suite/roles/grant_role_auto_create_user.result
index dee07aa6b3c..3f6139e84d0 100644
--- a/mysql-test/suite/roles/grant_role_auto_create_user.result
+++ b/mysql-test/suite/roles/grant_role_auto_create_user.result
@@ -6,12 +6,17 @@ create user foo@localhost;
grant auto_create to foo@localhost;
create user bar@localhost identified by 'baz';
grant auto_create to bar@localhost;
+connect con1,localhost,foo,,;
set role 'auto_create';
use db;
create table t1 (i int);
+disconnect con1;
+connect con1,localhost,bar,baz,;
set role auto_create;
use db;
insert into t1 values (1);
+disconnect con1;
+connection default;
drop user foo@localhost, bar@localhost;
set sql_mode = 'no_auto_create_user';
grant auto_create to foo@localhost;
@@ -21,10 +26,14 @@ select user, host from mysql.user where user = 'bar';
user host
bar localhost
set sql_mode = '';
+connect con1,localhost,bar,baz,;
set role auto_create;
use db;
drop table t1;
+disconnect con1;
+connection default;
create user foo@localhost;
+connect con1, localhost, foo,,;
set sql_mode = '';
grant auto_create to bar2@localhost;
ERROR 28000: Access denied for user 'foo'@'localhost'
@@ -35,7 +44,10 @@ grant auto_create to bar2@localhost;
ERROR 28000: Access denied for user 'foo'@'localhost'
grant auto_create to foo2@localhost identified by 'pass';
ERROR 28000: Access denied for user 'foo'@'localhost'
+disconnect con1;
+connection default;
grant auto_create to foo@localhost;
+connect con1, localhost, foo,,;
set sql_mode = '';
grant auto_create to bar@localhost;
ERROR 28000: Access denied for user 'foo'@'localhost'
@@ -48,7 +60,10 @@ grant auto_create to bar2@localhost;
ERROR 28000: Access denied for user 'foo'@'localhost'
grant auto_create to foo2@localhost identified by 'pass';
ERROR 28000: Access denied for user 'foo'@'localhost'
+connection default;
grant auto_create to foo@localhost with admin option;
+disconnect con1;
+connect con1, localhost, foo,,;
set sql_mode = '';
grant auto_create to bar@localhost;
grant auto_create to bar2@localhost;
@@ -60,6 +75,7 @@ grant auto_create to bar2@localhost;
ERROR 28000: Can't find any matching row in the user table
grant auto_create to foo2@localhost identified by 'pass';
ERROR 42000: You are not allowed to create a user with GRANT
+connection default;
drop user foo@localhost;
drop user bar@localhost;
drop role auto_create;
diff --git a/mysql-test/suite/roles/i_s_applicable_roles_is_default.test b/mysql-test/suite/roles/i_s_applicable_roles_is_default.test
index 4a844e39b87..59ba1f8bf75 100644
--- a/mysql-test/suite/roles/i_s_applicable_roles_is_default.test
+++ b/mysql-test/suite/roles/i_s_applicable_roles_is_default.test
@@ -1,5 +1,4 @@
--source include/not_embedded.inc
---enable_connect_log
create user foo;
create role role1;
create role role2;
diff --git a/mysql-test/suite/roles/ip-6401.result b/mysql-test/suite/roles/ip-6401.result
index a9876eb8273..1afd649636e 100644
--- a/mysql-test/suite/roles/ip-6401.result
+++ b/mysql-test/suite/roles/ip-6401.result
@@ -1,6 +1,7 @@
create role r1;
create user foo@'127.0.0.1';
grant r1 to foo@'127.0.0.1';
+connect con1,127.0.0.1,foo,,;
show grants;
Grants for foo@127.0.0.1
GRANT r1 TO 'foo'@'127.0.0.1'
@@ -9,5 +10,6 @@ set role r1;
select * from information_schema.enabled_roles;
ROLE_NAME
r1
+connection default;
drop user foo@'127.0.0.1';
drop role r1;
diff --git a/mysql-test/suite/roles/rebuild_role_grants.result b/mysql-test/suite/roles/rebuild_role_grants.result
index bc68d8ddc9f..1dd6f683340 100644
--- a/mysql-test/suite/roles/rebuild_role_grants.result
+++ b/mysql-test/suite/roles/rebuild_role_grants.result
@@ -58,7 +58,10 @@ drop role r1;
drop user u2;
create user foo@localhost;
grant create user on *.* to foo@localhost;
+connect con1, localhost, foo,,;
create role look, isp, xxx, ppp;
rename user current_user to nnnn@'%';
drop role look, isp, xxx, ppp;
+connection default;
+disconnect con1;
drop user nnnn@'%';
diff --git a/mysql-test/suite/roles/recursive.result b/mysql-test/suite/roles/recursive.result
index 7abbd01240e..ece3114747e 100644
--- a/mysql-test/suite/roles/recursive.result
+++ b/mysql-test/suite/roles/recursive.result
@@ -23,6 +23,7 @@ grant role9 to role10;
grant role10 to foo@localhost;
grant role10 to role2;
ERROR HY000: Cannot grant role 'role10' to: 'role2'.
+connect foo, localhost, foo;
show grants;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
@@ -42,9 +43,11 @@ role9 role6 NO NULL
role9 role7 NO NULL
show status like 'debug%';
Variable_name Value
+connection default;
grant select on *.* to role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -85,9 +88,11 @@ role5
role6
role7
role9
+connection default;
revoke select on *.* from role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
count(*)
22
@@ -96,9 +101,11 @@ set role role10;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
grant select on mysql.* to role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -129,15 +136,19 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
grant select on mysql.roles_mapping to role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -168,15 +179,19 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
grant select(User) on mysql.roles_mapping to role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -209,9 +224,11 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(concat(User,Host,Role)) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'Role' in table 'roles_mapping'
select count(concat(User,Host)) from mysql.roles_mapping;
@@ -242,25 +259,31 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(concat(User,Host)) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'User' in table 'roles_mapping'
select count(concat(Host)) from mysql.roles_mapping;
count(concat(Host))
22
+connection default;
revoke select(Host) on mysql.roles_mapping from role3;
show status like 'debug%';
Variable_name Value
+connection foo;
select count(concat(Host)) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
create procedure pr1() select "pr1";
create function fn1() returns char(10) return "fn1";
grant execute on procedure test.pr1 to role1;
show status like 'debug%';
Variable_name Value
+connection foo;
call pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.pr1'
set role role10;
@@ -269,26 +292,33 @@ pr1
pr1
select fn1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.fn1'
+connection default;
grant execute on function test.fn1 to role5;
show status like 'debug%';
Variable_name Value
+connection foo;
select fn1();
fn1()
fn1
+connection default;
revoke execute on procedure test.pr1 from role1;
show status like 'debug%';
Variable_name Value
+connection foo;
call pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.pr1'
select fn1();
fn1()
fn1
+connection default;
revoke execute on function test.fn1 from role5;
show status like 'debug%';
Variable_name Value
+connection foo;
select fn1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.fn1'
set role none;
+connection default;
drop procedure pr1;
drop function fn1;
grant select on mysql.roles_mapping to role3;
@@ -315,6 +345,7 @@ Variable_name Value
revoke select on test.* from role1;
show status like 'debug%';
Variable_name Value
+connection default;
drop user foo@localhost;
drop role role1;
drop role role2;
diff --git a/mysql-test/suite/roles/recursive_dbug.result b/mysql-test/suite/roles/recursive_dbug.result
index ea65a842eb0..64c0f3660e7 100644
--- a/mysql-test/suite/roles/recursive_dbug.result
+++ b/mysql-test/suite/roles/recursive_dbug.result
@@ -27,6 +27,7 @@ grant role9 to role10;
grant role10 to foo@localhost;
grant role10 to role2;
ERROR HY000: Cannot grant role 'role10' to: 'role2'.
+connect foo, localhost, foo;
show grants;
Grants for foo@localhost
GRANT USAGE ON *.* TO 'foo'@'localhost'
@@ -51,6 +52,7 @@ Debug_role_merges_db 0
Debug_role_merges_table 0
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection default;
grant select on *.* to role1;
show status like 'debug%';
Variable_name Value
@@ -59,6 +61,7 @@ Debug_role_merges_db 0
Debug_role_merges_table 0
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -99,6 +102,7 @@ role5
role6
role7
role9
+connection default;
revoke select on *.* from role1;
show status like 'debug%';
Variable_name Value
@@ -107,6 +111,7 @@ Debug_role_merges_db 0
Debug_role_merges_table 0
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
count(*)
22
@@ -115,6 +120,7 @@ set role role10;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
grant select on mysql.* to role1;
show status like 'debug%';
Variable_name Value
@@ -123,6 +129,7 @@ Debug_role_merges_db 8
Debug_role_merges_table 0
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -153,6 +160,7 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
revoke select on mysql.* from role1;
show status like 'debug%';
Variable_name Value
@@ -161,9 +169,11 @@ Debug_role_merges_db 16
Debug_role_merges_table 0
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
grant select on mysql.roles_mapping to role1;
show status like 'debug%';
Variable_name Value
@@ -172,6 +182,7 @@ Debug_role_merges_db 16
Debug_role_merges_table 8
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -202,6 +213,7 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
revoke select on mysql.roles_mapping from role1;
show status like 'debug%';
Variable_name Value
@@ -210,9 +222,11 @@ Debug_role_merges_db 16
Debug_role_merges_table 16
Debug_role_merges_column 0
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
grant select(User) on mysql.roles_mapping to role1;
show status like 'debug%';
Variable_name Value
@@ -221,6 +235,7 @@ Debug_role_merges_db 16
Debug_role_merges_table 24
Debug_role_merges_column 8
Debug_role_merges_routine 0
+connection foo;
select count(*) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role role10;
@@ -253,6 +268,7 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
grant select(Host) on mysql.roles_mapping to role3;
show status like 'debug%';
Variable_name Value
@@ -261,6 +277,7 @@ Debug_role_merges_db 16
Debug_role_merges_table 30
Debug_role_merges_column 14
Debug_role_merges_routine 0
+connection foo;
select count(concat(User,Host,Role)) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'Role' in table 'roles_mapping'
select count(concat(User,Host)) from mysql.roles_mapping;
@@ -291,6 +308,7 @@ GRANT role5 TO 'role7'
GRANT role6 TO 'role9'
GRANT role7 TO 'role9'
GRANT role9 TO 'role10'
+connection default;
revoke select(User) on mysql.roles_mapping from role1;
show status like 'debug%';
Variable_name Value
@@ -299,11 +317,13 @@ Debug_role_merges_db 16
Debug_role_merges_table 38
Debug_role_merges_column 22
Debug_role_merges_routine 0
+connection foo;
select count(concat(User,Host)) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for column 'User' in table 'roles_mapping'
select count(concat(Host)) from mysql.roles_mapping;
count(concat(Host))
22
+connection default;
revoke select(Host) on mysql.roles_mapping from role3;
show status like 'debug%';
Variable_name Value
@@ -312,9 +332,11 @@ Debug_role_merges_db 16
Debug_role_merges_table 44
Debug_role_merges_column 28
Debug_role_merges_routine 0
+connection foo;
select count(concat(Host)) from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
set role none;
+connection default;
create procedure pr1() select "pr1";
create function fn1() returns char(10) return "fn1";
grant execute on procedure test.pr1 to role1;
@@ -325,6 +347,7 @@ Debug_role_merges_db 16
Debug_role_merges_table 44
Debug_role_merges_column 28
Debug_role_merges_routine 8
+connection foo;
call pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.pr1'
set role role10;
@@ -333,6 +356,7 @@ pr1
pr1
select fn1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.fn1'
+connection default;
grant execute on function test.fn1 to role5;
show status like 'debug%';
Variable_name Value
@@ -341,9 +365,11 @@ Debug_role_merges_db 16
Debug_role_merges_table 44
Debug_role_merges_column 28
Debug_role_merges_routine 13
+connection foo;
select fn1();
fn1()
fn1
+connection default;
revoke execute on procedure test.pr1 from role1;
show status like 'debug%';
Variable_name Value
@@ -352,11 +378,13 @@ Debug_role_merges_db 16
Debug_role_merges_table 44
Debug_role_merges_column 28
Debug_role_merges_routine 21
+connection foo;
call pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.pr1'
select fn1();
fn1()
fn1
+connection default;
revoke execute on function test.fn1 from role5;
show status like 'debug%';
Variable_name Value
@@ -365,9 +393,11 @@ Debug_role_merges_db 16
Debug_role_merges_table 44
Debug_role_merges_column 28
Debug_role_merges_routine 26
+connection foo;
select fn1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'test.fn1'
set role none;
+connection default;
drop procedure pr1;
drop function fn1;
grant select on mysql.roles_mapping to role3;
@@ -434,6 +464,7 @@ Debug_role_merges_db 48
Debug_role_merges_table 62
Debug_role_merges_column 28
Debug_role_merges_routine 26
+connection default;
drop user foo@localhost;
drop role role1;
drop role role2;
diff --git a/mysql-test/suite/roles/rpl_definer.result b/mysql-test/suite/roles/rpl_definer.result
index c9e4f66a267..f4cc5dad39e 100644
--- a/mysql-test/suite/roles/rpl_definer.result
+++ b/mysql-test/suite/roles/rpl_definer.result
@@ -35,7 +35,7 @@ show create procedure pr;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
pr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr`()
select "role1" latin1 latin1_swedish_ci latin1_swedish_ci
-[connection slave]
+connection slave;
set role role1;
show grants;
Grants for root@localhost
@@ -63,6 +63,7 @@ show create procedure pr;
Procedure sql_mode Create Procedure character_set_client collation_connection Database Collation
pr NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`role1` PROCEDURE `pr`()
select "role1" latin1 latin1_swedish_ci latin1_swedish_ci
+connection master;
drop procedure pcu;
drop procedure pu;
drop procedure pcr;
diff --git a/mysql-test/suite/roles/rpl_definer.test b/mysql-test/suite/roles/rpl_definer.test
index 86d69de86aa..8e19bd16705 100644
--- a/mysql-test/suite/roles/rpl_definer.test
+++ b/mysql-test/suite/roles/rpl_definer.test
@@ -23,8 +23,6 @@ show create procedure pcr;
show create procedure pr;
sync_slave_with_master;
-connection slave;
-echo [connection slave];
set role role1;
--sorted_result
diff --git a/mysql-test/suite/roles/set_and_drop.result b/mysql-test/suite/roles/set_and_drop.result
index 1814c19cc97..2d3e675ebd0 100644
--- a/mysql-test/suite/roles/set_and_drop.result
+++ b/mysql-test/suite/roles/set_and_drop.result
@@ -14,6 +14,7 @@ grant select on mysql.* to role2;
grant execute on procedure mysqltest1.pr1 to role2;
grant select on mysqltest1.t1 to role2;
grant select (a) on mysqltest1.t2 to role2;
+connect foo,localhost,foo;
flush tables;
ERROR 42000: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation
select * from mysql.roles_mapping;
@@ -45,10 +46,14 @@ a
call mysqltest1.pr1();
pr1
pr1
+connection default;
revoke execute on procedure mysqltest1.pr1 from role2;
+connection foo;
call mysqltest1.pr1();
ERROR 42000: execute command denied to user 'foo'@'localhost' for routine 'mysqltest1.pr1'
+connection default;
drop role role2;
+connection foo;
show grants;
Grants for foo@localhost
GRANT role1 TO 'foo'@'localhost'
@@ -65,11 +70,13 @@ ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't1'
select a from mysqltest1.t2;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 't2'
set role none;
+connection default;
grant reload on *.* to role1;
grant select on mysql.* to role1;
grant execute on procedure mysqltest1.pr1 to role1;
grant select on mysqltest1.t1 to role1;
grant select (a) on mysqltest1.t2 to role1;
+connection foo;
set role role1;
flush tables;
select * from mysql.roles_mapping;
@@ -93,7 +100,9 @@ a
call mysqltest1.pr1();
pr1
pr1
+connection default;
drop role role1;
+connection foo;
flush tables;
select * from mysql.roles_mapping;
ERROR 42000: SELECT command denied to user 'foo'@'localhost' for table 'roles_mapping'
@@ -113,5 +122,7 @@ NULL
select current_role();
current_role()
role1
+disconnect foo;
+connection default;
drop user foo@localhost;
drop database mysqltest1;
diff --git a/mysql-test/suite/roles/set_default_role_new_connection.result b/mysql-test/suite/roles/set_default_role_new_connection.result
index d88ead70038..a59ecbd75f7 100644
--- a/mysql-test/suite/roles/set_default_role_new_connection.result
+++ b/mysql-test/suite/roles/set_default_role_new_connection.result
@@ -2,6 +2,7 @@ create user test_user@localhost;
create role test_role;
grant select on *.* to test_role;
grant test_role to test_user@localhost;
+connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
GRANT test_role TO 'test_user'@'localhost'
@@ -11,9 +12,12 @@ ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'us
set default role test_role;
select user, host, default_role from mysql.user where user = 'test_user';
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+disconnect c1;
+connection default;
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
+connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
GRANT test_role TO 'test_user'@'localhost'
@@ -23,19 +27,25 @@ select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
set default role NONE;
+disconnect c1;
+connection default;
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost
+connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
GRANT test_role TO 'test_user'@'localhost'
GRANT USAGE ON *.* TO 'test_user'@'localhost'
select user, host, default_role from mysql.user where user = 'test_user';
ERROR 42000: SELECT command denied to user 'test_user'@'localhost' for table 'user'
+disconnect c1;
+connection default;
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost
set default role test_role for test_user@localhost;
+connect c1, localhost, test_user,,;
show grants;
Grants for test_user@localhost
GRANT test_role TO 'test_user'@'localhost'
@@ -44,5 +54,7 @@ GRANT SELECT ON *.* TO 'test_role'
select user, host, default_role from mysql.user where user = 'test_user';
user host default_role
test_user localhost test_role
+disconnect c1;
+connection default;
drop role test_role;
drop user test_user@localhost;
diff --git a/mysql-test/suite/roles/set_role-5232.result b/mysql-test/suite/roles/set_role-5232.result
index 888a5f10c3d..898e4b05304 100644
--- a/mysql-test/suite/roles/set_role-5232.result
+++ b/mysql-test/suite/roles/set_role-5232.result
@@ -3,6 +3,7 @@ create user c;
grant select on mysql.* to c;
create role r1;
grant r1 to c;
+connect c,localhost,c,,,,,;
select user(), current_user();
user() current_user()
c@localhost @localhost
@@ -10,6 +11,8 @@ select user from mysql.user group by user;
ERROR 42000: SELECT command denied to user ''@'localhost' for table 'user'
set role r1;
ERROR OP000: Invalid role specification `r1`.
+disconnect c;
+connection default;
drop role r1;
drop user c;
drop user ''@localhost;
diff --git a/mysql-test/suite/roles/show_grants_replicated.result b/mysql-test/suite/roles/show_grants_replicated.result
index 0b2e38d3630..cb9df65dbbd 100644
--- a/mysql-test/suite/roles/show_grants_replicated.result
+++ b/mysql-test/suite/roles/show_grants_replicated.result
@@ -54,4 +54,5 @@ GRANT USAGE ON *.* TO 'r1'
connection master;
drop role r1;
drop user u1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/roles/show_grants_replicated.test b/mysql-test/suite/roles/show_grants_replicated.test
index 1d4572bb297..91129c431cc 100644
--- a/mysql-test/suite/roles/show_grants_replicated.test
+++ b/mysql-test/suite/roles/show_grants_replicated.test
@@ -1,7 +1,5 @@
--source include/master-slave.inc
---enable_connect_log
-
create user u1;
create role r1;
--echo #
@@ -36,6 +34,5 @@ show grants for r1;
connection master;
drop role r1;
drop user u1;
---disable_connect_log
--sync_slave_with_master
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/include/rpl_innodb_rows_counters.inc b/mysql-test/suite/rpl/include/rpl_innodb_rows_counters.inc
index b624853cd37..cb51058f0ae 100644
--- a/mysql-test/suite/rpl/include/rpl_innodb_rows_counters.inc
+++ b/mysql-test/suite/rpl/include/rpl_innodb_rows_counters.inc
@@ -6,7 +6,6 @@
#########################################
--connection master
---echo ==========MASTER==========
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @master_rows_read;
@@ -27,7 +26,6 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @master_system_rows_inserted;
--sync_slave_with_master
---echo ==========SLAVE===========
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @slave_rows_read;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_db.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_db.inc
index 0443bba78df..403b34ae2b4 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_db.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_db.inc
@@ -5,9 +5,7 @@
# Requirements:
#########################################
---echo ==========MASTER==========
SHOW DATABASES LIKE 'test_rpl%';
sync_slave_with_master;
---echo ==========SLAVE===========
SHOW DATABASES LIKE 'test_rpl%';
connection master;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_event.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_event.inc
index 57bba47551e..6732f637759 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_event.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_event.inc
@@ -5,11 +5,9 @@
# Requirements:
#########################################
---echo ==========MASTER==========
--replace_column 8 # 9 #
SHOW EVENTS;
sync_slave_with_master;
---echo ==========SLAVE===========
USE test_rpl;
--replace_column 8 # 9 #
SHOW EVENTS;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc
index b3e0cefbbd7..d27021094f2 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_select.inc
@@ -5,13 +5,11 @@
# Requirements:
#########################################
---echo ==========MASTER==========
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY a;
SELECT COUNT(*) FROM t2;
SELECT * FROM t2 ORDER BY a;
sync_slave_with_master;
---echo ==========SLAVE===========
USE test_rpl;
SELECT COUNT(*) FROM t1;
SELECT * FROM t1 ORDER BY a;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_table.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_table.inc
index 22c3b8d74e5..80f40ea7121 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_table.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_table.inc
@@ -5,11 +5,9 @@
# Requirements:
#########################################
---echo ==========MASTER==========
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
sync_slave_with_master;
---echo ==========SLAVE===========
USE test_rpl;
SHOW CREATE TABLE t1;
SHOW CREATE TABLE t2;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc
index 694122d9a22..8bf5a4eea1e 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_user.inc
@@ -5,10 +5,8 @@
# Requirements:
#########################################
---echo ==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
sync_slave_with_master;
---echo ==========SLAVE===========
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
connection master;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc b/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc
index a9f7ad8cd68..2ad8c34dabd 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_check_view.inc
@@ -5,11 +5,9 @@
# Requirements:
#########################################
---echo ==========MASTER==========
SHOW CREATE VIEW v1;
SELECT * FROM v1 ORDER BY a;
sync_slave_with_master;
---echo ==========SLAVE===========
USE test_rpl;
SHOW CREATE VIEW v1;
SELECT * FROM v1 ORDER BY a;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
index 89db1c3545d..6e4aad56812 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_ddl.inc
@@ -8,10 +8,8 @@
# Check MIXED on both master and slave
connection master;
---echo ==========MASTER==========
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
connection slave;
---echo ==========SLAVE===========
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
connection master;
diff --git a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
index dc245b8d38c..114cd53d244 100644
--- a/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
+++ b/mysql-test/suite/rpl/include/rpl_mixed_dml.inc
@@ -8,10 +8,8 @@
# Check MIXED on both master and slave
connection master;
---echo ==========MASTER==========
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
connection slave;
---echo ==========SLAVE===========
--source suite/rpl/include/rpl_mixed_show_binlog_format.inc
connection master;
diff --git a/mysql-test/suite/rpl/include/rpl_set_statement.inc b/mysql-test/suite/rpl/include/rpl_set_statement.inc
index 6ab2d4e66c6..d1a1a6c0345 100644
--- a/mysql-test/suite/rpl/include/rpl_set_statement.inc
+++ b/mysql-test/suite/rpl/include/rpl_set_statement.inc
@@ -5,15 +5,12 @@
# $rpl_ssvt_table - the table name to insert values.
--connection master
---echo [connection master]
eval SELECT @@$rpl_ssvt_var_name;
--connection slave
---echo [connection slave]
eval SELECT @@$rpl_ssvt_var_name;
--connection master
---echo [connection master]
--disable_result_log
eval SET STATEMENT $rpl_ssvt_var_name=$rpl_ssvt_var_value FOR
INSERT INTO $rpl_ssvt_table VALUES(@@$rpl_ssvt_var_name);
@@ -21,11 +18,9 @@ eval SET STATEMENT $rpl_ssvt_var_name=$rpl_ssvt_var_value FOR
eval SELECT @@$rpl_ssvt_var_name;
--sync_slave_with_master
---echo [connection slave]
eval SELECT * FROM $rpl_ssvt_table;
eval SELECT @@$rpl_ssvt_var_name;
--connection master
---echo [connection master]
eval DELETE FROM $rpl_ssvt_table;
diff --git a/mysql-test/suite/rpl/r/create_or_replace_mix.result b/mysql-test/suite/rpl/r/create_or_replace_mix.result
index c5dd67ed65c..e90021f78fc 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_mix.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_mix.result
@@ -5,7 +5,9 @@ create temporary table t3 (a_in_temporary int) engine=myisam;
#
# Check how create table and create or replace table are logged
#
+connection server_2;
create table t1 (to_be_deleted int);
+connection server_1;
CREATE TABLE t1 AS SELECT 1 AS f1;
CREATE OR REPLACE TABLE t1 AS SELECT 2 AS f1;
CREATE OR REPLACE table t1 like t2;
@@ -31,6 +33,7 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t3
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -53,6 +56,7 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+connection server_1;
#
# Ensure that also failed create_or_replace are logged
#
@@ -84,9 +88,11 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
master-bin.000001 # Query # # ROLLBACK
+connection server_2;
show tables;
Tables_in_test
t2
+connection server_1;
create table t1 (a int);
create or replace table t1 (a int, a int) select * from t2;
ERROR 42S21: Duplicate column name 'a'
@@ -103,17 +109,22 @@ Note 1051 Unknown table 'test.t9'
#
# Ensure that CREATE are run as CREATE OR REPLACE on slave
#
+connection server_2;
create table t1 (server_2_to_be_delete int);
+connection server_1;
create table t1 (new_table int);
+connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`new_table` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection server_1;
drop table t1;
#
# Check how CREATE is logged on slave in case of conflicts
#
+connection server_2;
create table t1 (server_2_to_be_delete int);
create table t2 (server_2_to_be_delete int);
create table t4 (server_2_to_be_delete int);
@@ -123,12 +134,14 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection server_1;
create temporary table t9 (a int);
insert into t9 values(1);
create table t1 (new_table int);
create table t2 select * from t9;
create table t4 like t9;
create table t5 select * from t9;
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -163,15 +176,19 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection server_1;
drop table t1,t2,t4,t5,t9;
#
# Ensure that DROP TABLE is run as DROP IF NOT EXISTS
#
create table t1 (server_1_ver_1 int);
create table t4 (server_1_ver_2 int);
+connection server_2;
drop table t1;
+connection server_1;
drop table t1,t4;
create table t1 (server_2_ver_2 int);
+connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -186,14 +203,18 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t4` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t1 (server_2_ver_2 int)
+connection server_1;
drop table t1;
#
# Ensure that CREATE ... SELECT is recorded as one GTID on the slave
#
+connection server_2;
+connection server_1;
create table t1 (a int);
insert into t1 values (0),(1),(2);
create table t2 engine=myisam select * from t1;
create or replace table t2 engine=innodb select * from t1;
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -217,6 +238,7 @@ slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` (
slave-bin.000001 # Table_map # # table_id: # (test.t2)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Xid # # COMMIT /* XID */
+connection server_1;
drop table t1;
#
# Check logging of drop temporary table
diff --git a/mysql-test/suite/rpl/r/create_or_replace_row.result b/mysql-test/suite/rpl/r/create_or_replace_row.result
index 4a89a45354d..2f29b1c125b 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_row.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_row.result
@@ -5,7 +5,9 @@ create temporary table t3 (a_in_temporary int) engine=myisam;
#
# Check how create table and create or replace table are logged
#
+connection server_2;
create table t1 (to_be_deleted int);
+connection server_1;
CREATE TABLE t1 AS SELECT 1 AS f1;
CREATE OR REPLACE TABLE t1 AS SELECT 2 AS f1;
CREATE OR REPLACE table t1 like t2;
@@ -42,6 +44,7 @@ master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` (
)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -75,6 +78,7 @@ slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t1` (
)
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+connection server_1;
#
# Ensure that also failed create_or_replace are logged
#
@@ -106,9 +110,11 @@ master-bin.000001 # Query # # use `test`; create table t1 (a int)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `test`.`t1`/* Generated to handle failed CREATE OR REPLACE */
master-bin.000001 # Query # # ROLLBACK
+connection server_2;
show tables;
Tables_in_test
t2
+connection server_1;
create table t1 (a int);
create or replace table t1 (a int, a int) select * from t2;
ERROR 42S21: Duplicate column name 'a'
@@ -125,17 +131,22 @@ Note 1051 Unknown table 'test.t9'
#
# Ensure that CREATE are run as CREATE OR REPLACE on slave
#
+connection server_2;
create table t1 (server_2_to_be_delete int);
+connection server_1;
create table t1 (new_table int);
+connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`new_table` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection server_1;
drop table t1;
#
# Check how CREATE is logged on slave in case of conflicts
#
+connection server_2;
create table t1 (server_2_to_be_delete int);
create table t2 (server_2_to_be_delete int);
create table t4 (server_2_to_be_delete int);
@@ -145,12 +156,14 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection server_1;
create temporary table t9 (a int);
insert into t9 values(1);
create table t1 (new_table int);
create table t2 select * from t9;
create table t4 like t9;
create table t5 select * from t9;
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -185,15 +198,19 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection server_1;
drop table t1,t2,t4,t5,t9;
#
# Ensure that DROP TABLE is run as DROP IF NOT EXISTS
#
create table t1 (server_1_ver_1 int);
create table t4 (server_1_ver_2 int);
+connection server_2;
drop table t1;
+connection server_1;
drop table t1,t4;
create table t1 (server_2_ver_2 int);
+connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -208,14 +225,18 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t4` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t1 (server_2_ver_2 int)
+connection server_1;
drop table t1;
#
# Ensure that CREATE ... SELECT is recorded as one GTID on the slave
#
+connection server_2;
+connection server_1;
create table t1 (a int);
insert into t1 values (0),(1),(2);
create table t2 engine=myisam select * from t1;
create or replace table t2 engine=innodb select * from t1;
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -239,6 +260,7 @@ slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE TABLE `t2` (
slave-bin.000001 # Table_map # # table_id: # (test.t2)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Xid # # COMMIT /* XID */
+connection server_1;
drop table t1;
#
# Check logging of drop temporary table
diff --git a/mysql-test/suite/rpl/r/create_or_replace_statement.result b/mysql-test/suite/rpl/r/create_or_replace_statement.result
index 663557cc1f3..3b4525f82b6 100644
--- a/mysql-test/suite/rpl/r/create_or_replace_statement.result
+++ b/mysql-test/suite/rpl/r/create_or_replace_statement.result
@@ -5,7 +5,9 @@ create temporary table t3 (a_in_temporary int) engine=myisam;
#
# Check how create table and create or replace table are logged
#
+connection server_2;
create table t1 (to_be_deleted int);
+connection server_1;
CREATE TABLE t1 AS SELECT 1 AS f1;
CREATE OR REPLACE TABLE t1 AS SELECT 2 AS f1;
CREATE OR REPLACE table t1 like t2;
@@ -31,6 +33,7 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t3
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server */
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -53,6 +56,7 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; CREATE OR REPLACE table t1 like t3
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
+connection server_1;
#
# Ensure that also failed create_or_replace are logged
#
@@ -87,9 +91,11 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; create temporary table t9 (a int)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t9`/* Generated to handle failed CREATE OR REPLACE */
+connection server_2;
show tables;
Tables_in_test
t2
+connection server_1;
create table t1 (a int);
create or replace table t1 (a int, a int) select * from t2;
ERROR 42S21: Duplicate column name 'a'
@@ -106,17 +112,22 @@ Note 1051 Unknown table 'test.t9'
#
# Ensure that CREATE are run as CREATE OR REPLACE on slave
#
+connection server_2;
create table t1 (server_2_to_be_delete int);
+connection server_1;
create table t1 (new_table int);
+connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`new_table` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection server_1;
drop table t1;
#
# Check how CREATE is logged on slave in case of conflicts
#
+connection server_2;
create table t1 (server_2_to_be_delete int);
create table t2 (server_2_to_be_delete int);
create table t4 (server_2_to_be_delete int);
@@ -126,12 +137,14 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection server_1;
create temporary table t9 (a int);
insert into t9 values(1);
create table t1 (new_table int);
create table t2 select * from t9;
create table t4 like t9;
create table t5 select * from t9;
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -166,15 +179,19 @@ stop slave;
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection server_1;
drop table t1,t2,t4,t5,t9;
#
# Ensure that DROP TABLE is run as DROP IF NOT EXISTS
#
create table t1 (server_1_ver_1 int);
create table t4 (server_1_ver_2 int);
+connection server_2;
drop table t1;
+connection server_1;
drop table t1,t4;
create table t1 (server_2_ver_2 int);
+connection server_2;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -189,14 +206,18 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t1`,`t4` /* generated by server */
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t1 (server_2_ver_2 int)
+connection server_1;
drop table t1;
#
# Ensure that CREATE ... SELECT is recorded as one GTID on the slave
#
+connection server_2;
+connection server_1;
create table t1 (a int);
insert into t1 values (0),(1),(2);
create table t2 engine=myisam select * from t1;
create or replace table t2 engine=innodb select * from t1;
+connection server_2;
binlog from server 2
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -209,6 +230,7 @@ slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create table t2 engine=myisam select * from t1
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; create or replace table t2 engine=innodb select * from t1
+connection server_1;
drop table t1;
#
# Check logging of drop temporary table
diff --git a/mysql-test/suite/rpl/r/create_select.result b/mysql-test/suite/rpl/r/create_select.result
index ac222824e34..b3a2e5e6703 100644
--- a/mysql-test/suite/rpl/r/create_select.result
+++ b/mysql-test/suite/rpl/r/create_select.result
@@ -1,18 +1,18 @@
include/rpl_init.inc [topology=1->2->3]
-# On server_1
+connection server_1;
CREATE DATABASE test_8428;
USE test_8428;
CREATE TABLE t1(i INT) ENGINE=INNODB;
INSERT INTO t1 VALUES(1), (2), (3), (4), (5);
CREATE TABLE t2 AS SELECT * FROM t1;
CREATE TABLE t3 ENGINE=MyISAM AS SELECT * FROM t1;
-# On server_2
+connection server_2;
SHOW TABLES IN test_8428;
Tables_in_test_8428
t1
t2
t3
-# On server_3
+connection server_3;
SHOW TABLES IN test_8428;
Tables_in_test_8428
t1
@@ -25,6 +25,7 @@ i
3
4
5
+connection server_1;
DROP DATABASE test_8428;
include/rpl_end.inc
# End of test
diff --git a/mysql-test/suite/rpl/r/failed_create_view-6409.result b/mysql-test/suite/rpl/r/failed_create_view-6409.result
index 6b04f2960d1..3a1ea388a93 100644
--- a/mysql-test/suite/rpl/r/failed_create_view-6409.result
+++ b/mysql-test/suite/rpl/r/failed_create_view-6409.result
@@ -1,6 +1,7 @@
create table v1 (a int);
include/master-slave.inc
[connection master]
+connection master;
create table t1 (a int);
create view v1 as select * from t1;
ERROR 42S01: Table 'v1' already exists
@@ -8,8 +9,10 @@ show tables;
Tables_in_test
t1
v1
+connection slave;
show tables;
Tables_in_test
t1
+connection master;
drop table if exists t1, v1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result b/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
index b036bde349a..20400512385 100644
--- a/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
+++ b/mysql-test/suite/rpl/r/ignore_table_autoinc-9737.result
@@ -3,17 +3,21 @@ include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(id int auto_increment primary key);
create table t2(id int auto_increment primary key);
+connection slave;
create table slave_only(id int auto_increment primary key);
insert into slave_only values(NULL);
create trigger t1i after insert on t1 for each row insert into slave_only values(NULL);
stop slave;
set global replicate_ignore_table="test.t2";
start slave;
+connection master;
insert into t2 values(NULL);
insert into t1 values(NULL);
+connection slave;
drop table t1, t2, slave_only;
stop slave;
set global replicate_ignore_table="";
start slave;
+connection master;
drop table t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/kill_hard-6290.result b/mysql-test/suite/rpl/r/kill_hard-6290.result
index 27b62416368..a1500fedc36 100644
--- a/mysql-test/suite/rpl/r/kill_hard-6290.result
+++ b/mysql-test/suite/rpl/r/kill_hard-6290.result
@@ -1,4 +1,5 @@
include/master-slave.inc
[connection master]
+connection server_2;
kill user test2@nohost;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/last_insert_id.result b/mysql-test/suite/rpl/r/last_insert_id.result
index ce64e9df41e..b2c88254fd3 100644
--- a/mysql-test/suite/rpl/r/last_insert_id.result
+++ b/mysql-test/suite/rpl/r/last_insert_id.result
@@ -1,4 +1,5 @@
include/rpl_init.inc [topology=1->2->3]
+connection server_1;
create table t1 (id int not null auto_increment primary key, i int) engine=InnoDB;
insert into t1 (i) values (-1);
insert into t1 (i) values (LAST_INSERT_ID());
@@ -6,13 +7,16 @@ select * from t1;
id i
1 -1
2 1
+connection server_2;
select * from t1;
id i
1 -1
2 1
+connection server_3;
select * from t1;
id i
1 -1
2 1
+connection server_1;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/myisam_external_lock.result b/mysql-test/suite/rpl/r/myisam_external_lock.result
index ef24f8b4e3c..09cbffe9bfd 100644
--- a/mysql-test/suite/rpl/r/myisam_external_lock.result
+++ b/mysql-test/suite/rpl/r/myisam_external_lock.result
@@ -9,4 +9,6 @@ KEY `col2` (`col2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `t1` VALUES (2775,974),(2775,975),(2775,976),(2778,977),(2778,978),(2782,979),(2790,986),(2790,1139),(2792,840),(2792,984),(2792,989),(2793,982),(2793,992),(2793,993),(2793,994),(2795,323),(2795,332),(2797,980),(2797,997),(2797,998),(2798,1103),(2798,1104),(2799,841),(2799,985),(2799,988),(2833,983),(2833,990),(2833,991),(2834,981),(2834,995),(2834,996),(2835,316),(2835,317),(3007,854),(3007,856),(3008,855),(3008,857),(3009,823),(3009,824),(3014,1),(3015,1),(3016,2),(3017,2),(3018,3),(3019,3),(3024,842),(3024,843),(3024,844),(3025,845),(3025,846),(3025,847),(3040,31),(3041,32),(3042,52),(3042,55),(3043,53),(3043,54),(3044,278),(3044,279),(3044,280),(3044,281),(3044,282),(3044,283),(3044,284),(3044,285),(3045,1),(3046,1),(3049,220),(3050,221),(3050,222),(3051,2),(3052,2),(3053,223),(3054,224),(3055,225),(3056,226),(3057,227),(3058,228),(3059,229),(3060,327),(3066,236),(3067,237),(3068,238),(3069,239),(3070,240),(3080,241),(3081,242),(3082,247),(3083,248),(3084,249),(3085,250),(3086,251),(3087,252),(3088,253),(3089,254),(3090,255),(3091,256),(3092,257),(3093,258),(3094,259),(3096,263),(3097,264),(3100,273),(3100,302),(3101,266),(3102,267),(3103,268),(3104,269),(3105,270),(3111,275),(3112,238),(3113,272),(3115,286),(3116,318),(3116,319),(3117,290),(3117,292),(3118,238),(3119,291),(3119,293),(3120,304),(3121,305),(3122,306),(3123,307),(3124,308),(3125,309),(3126,310),(3127,311),(3128,312),(3128,336),(3129,313),(3129,350),(3130,314),(3131,315),(3131,351),(3132,325),(3132,328),(3134,502),(3138,334),(3139,338),(3139,339),(3140,340),(3140,341),(3141,344),(3141,345),(3142,346),(3142,347),(3149,351),(3149,354),(3150,351),(3150,356),(3152,358),(3152,359),(3153,361),(3153,370),(3154,363),(3154,369),(3156,350),(3156,371),(3159,376),(3160,377),(3160,379),(3160,384),(3161,378),(3161,380),(3161,383),(3162,388),(3162,389),(3162,390),(3169,392),(3169,393),(3169,394),(3170,395),(3170,396),(3170,397),(3171,398),(3171,399),(3171,400),(3172,401),(3172,402),(3172,403),(3173,404),(3173,405),(3173,406),(3178,351),(3178,421),(3190,411),(3190,412),(3191,413),(3191,414),(3192,415),(3192,416),(3193,417),(3193,418),(3194,419),(3194,420),(3195,353),(3195,424),(3196,425),(3196,426),(3197,427),(3197,428),(3198,429),(3198,430),(3199,431),(3199,432),(3200,433),(3200,434),(3201,435),(3201,436),(3202,437),(3202,438),(3203,439),(3203,440),(3204,441),(3204,442),(3205,443),(3205,444),(3206,445),(3206,446),(3207,447),(3207,448),(3208,449),(3208,450),(3209,451),(3209,452),(3210,453),(3210,454),(3211,455),(3211,456),(3212,457),(3212,458),(3213,459),(3213,460),(3214,461),(3214,462),(3215,463),(3215,464),(3218,466),(3218,467),(3218,468),(3219,469),(3219,470),(3219,471),(3220,474),(3220,475),(3220,476),(3221,477),(3221,478),(3221,479),(3222,480),(3222,481),(3223,482),(3223,483),(3224,484),(3224,485),(3225,486),(3225,487),(3227,503),(3227,505),(3228,506),(3228,507),(3230,508),(3230,509),(3231,510),(3231,511),(3232,512),(3232,513),(3233,514),(3233,515),(3234,516),(3234,517),(3235,518),(3235,519),(3237,521),(3237,522),(3239,524),(3239,525),(3240,526),(3240,527),(3241,528),(3241,529),(3242,530),(3242,531),(3243,532),(3243,533),(3244,534),(3244,535),(3245,536),(3245,537),(3246,538),(3246,539),(3252,540),(3252,541),(3254,543),(3254,544),(3254,545),(3255,547),(3255,548),(3255,571),(3256,550),(3256,551),(3256,572),(3257,553),(3257,554),(3257,573),(3258,556),(3258,557),(3258,574),(3259,559),(3259,560),(3259,575),(3260,561),(3260,562),(3260,563),(3261,565),(3261,576),(3262,566),(3262,567),(3263,568),(3263,569),(3263,570),(3264,577),(3264,578),(3265,579),(3265,580),(3266,581),(3266,582),(3266,591),(3267,583),(3267,584),(3267,592),(3268,585),(3268,586),(3268,593),(3269,587),(3269,588),(3269,594),(3270,589),(3270,590),(3271,595),(3271,596),(3271,597),(3272,598),(3272,599),(3273,600),(3273,601),(3273,602),(3274,603),(3274,604),(3274,605),(3275,606),(3275,607),(3275,608),(3276,609),(3276,610),(3276,611),(3277,612),(3277,613),(3277,614),(3278,615),(3278,616),(3279,617),(3279,618),(3279,619),(3279,628),(3279,629),(3280,620),(3280,621),(3280,622),(3281,623),(3281,624),(3281,625),(3282,626),(3282,825),(3283,630),(3283,631),(3284,632),(3284,633),(3284,634),(3285,635),(3285,940),(3286,638),(3286,639),(3286,640),(3287,641),(3287,642),(3287,643),(3288,644),(3288,645),(3288,646),(3289,647),(3289,648),(3289,649),(3290,650),(3290,651),(3290,652),(3291,653),(3291,654),(3291,655),(3292,656),(3292,657),(3292,658),(3293,659),(3293,660),(3293,661),(3294,662),(3294,663),(3294,664),(3295,665),(3295,666),(3295,667),(3296,668),(3296,669),(3296,670),(3297,671),(3297,672),(3297,673),(3298,674),(3298,675),(3298,676),(3299,677),(3299,678),(3299,679),(3300,680),(3300,681),(3300,682),(3301,683),(3301,684),(3301,685),(3302,686),(3302,687),(3302,688),(3303,689),(3303,690),(3303,691),(3304,692),(3304,693),(3304,694),(3305,695),(3305,696),(3305,697),(3306,698),(3306,699),(3306,700),(3307,701),(3307,702),(3307,703),(3308,704),(3308,705),(3308,706),(3309,707),(3309,708),(3310,709),(3310,710),(3311,711),(3311,712),(3311,713),(3312,714),(3312,715),(3312,716),(3313,717),(3313,1167),(3314,720),(3314,721),(3314,722),(3315,723),(3315,724),(3315,725),(3316,726),(3316,727),(3316,728),(3317,729),(3317,730),(3317,731),(3318,732),(3318,733),(3318,734),(3319,735),(3319,736),(3319,737),(3320,738),(3320,739),(3320,740),(3321,741),(3321,742),(3322,743),(3322,744),(3323,745),(3323,746),(3323,747),(3324,748),(3324,749),(3324,750),(3325,751),(3325,752),(3325,753),(3326,754),(3326,755),(3327,756),(3327,757),(3328,758),(3328,789),(3329,761),(3329,790),(3330,762),(3330,763),(3331,768),(3331,785),(3331,786),(3332,769),(3332,783),(3332,784),(3335,766),(3336,767),(3343,770),(3343,771),(3344,772),(3344,773),(3345,774),(3345,775),(3347,776),(3347,777),(3347,987),(3348,778),(3348,779),(3349,780),(3372,781),(3372,782),(3373,787),(3373,788),(3376,791),(3376,792),(3377,793),(3377,794),(3378,799),(3378,800),(3379,801),(3379,802),(3380,795),(3380,796),(3381,797),(3381,798),(3383,805),(3384,806),(3384,807),(3385,808),(3385,809),(3386,810),(3386,811),(3387,812),(3387,814),(3388,815),(3388,816),(3391,817),(3391,818),(3391,819),(3392,820),(3392,821),(3392,822),(3393,826),(3393,827),(3394,828),(3394,829),(3395,830),(3395,831),(3396,834),(3396,835),(3397,832),(3397,833),(3398,836),(3398,837),(3399,838),(3399,839),(3410,850),(3410,851),(3411,852),(3411,853),(3412,848),(3412,849),(3419,860),(3419,951),(3420,859),(3420,861),(3422,862),(3422,863),(3423,864),(3423,865),(3424,866),(3424,867),(3424,872),(3424,873),(3425,868),(3425,869),(3425,874),(3425,875),(3426,878),(3426,879),(3427,876),(3427,877),(3428,880),(3432,884),(3432,885),(3432,886),(3434,887),(3434,888),(3434,889),(3441,894),(3441,895),(3442,896),(3442,897),(3444,904),(3445,905),(3449,906),(3449,907),(3450,908),(3450,909),(3453,910),(3458,915),(3458,916),(3459,917),(3459,918),(3463,919),(3463,920),(3485,929),(3486,930),(3487,931),(3488,932),(3489,933),(3493,2),(3494,2),(3501,934),(3502,936),(3503,938),(3504,939),(3505,941),(3506,942),(3507,943),(3508,944),(3509,945),(3510,946),(3511,947),(3512,948),(3514,949),(3514,950),(3515,953),(3516,954),(3517,955),(3518,956),(3519,957),(3520,958),(3521,959),(3527,960),(3527,965),(3528,961),(3528,962),(3529,963),(3529,964),(3530,966),(3530,967),(3531,968),(3531,969),(3535,970),(3535,971),(3536,972),(3536,973),(3540,999),(3540,1000),(3541,1001),(8888,9999);
drop table t1;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result b/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result
index fd07dfce188..a72e197f5cc 100644
--- a/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result
+++ b/mysql-test/suite/rpl/r/mysql-wsrep#110-2.result
@@ -21,4 +21,5 @@ DROP TABLE t3;
DROP TABLE t2;
DROP TABLE t1;
DROP PROCEDURE p1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/replace.result b/mysql-test/suite/rpl/r/replace.result
index f6f73e8885e..1912fadf982 100644
--- a/mysql-test/suite/rpl/r/replace.result
+++ b/mysql-test/suite/rpl/r/replace.result
@@ -14,9 +14,12 @@ select * from t1;
pr_id pr_page pr_type test
138 1 one 2
137 2 two 0
+connection slave;
+connection slave;
select * from t1;
pr_id pr_page pr_type test
138 1 one 2
137 2 two 0
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000010.result b/mysql-test/suite/rpl/r/rpl_000010.result
index 4bb87a765cd..ae989f25e1b 100644
--- a/mysql-test/suite/rpl/r/rpl_000010.result
+++ b/mysql-test/suite/rpl/r/rpl_000010.result
@@ -3,9 +3,12 @@ include/master-slave.inc
create table t1 (n int not null auto_increment primary key);
insert into t1 values(NULL);
insert into t1 values(2);
+connection slave;
select n from t1;
n
1
2
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000011.result b/mysql-test/suite/rpl/r/rpl_000011.result
index 12859a17f95..136a6a3aacb 100644
--- a/mysql-test/suite/rpl/r/rpl_000011.result
+++ b/mysql-test/suite/rpl/r/rpl_000011.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
create table t1 (n int);
insert into t1 values(1);
+connection slave;
show global status like 'com_insert';
Variable_name Value
Com_insert 1
@@ -12,10 +13,14 @@ Com_insert 1
include/wait_for_slave_to_stop.inc
start slave;
include/wait_for_slave_to_start.inc
+connection master;
insert into t1 values(2);
+connection slave;
select * from t1;
n
1
2
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_000013.result b/mysql-test/suite/rpl/r/rpl_000013.result
index a45f11c4b5e..87103d7821f 100644
--- a/mysql-test/suite/rpl/r/rpl_000013.result
+++ b/mysql-test/suite/rpl/r/rpl_000013.result
@@ -4,10 +4,16 @@ create table t2(n int);
create temporary table t1 (n int);
insert into t1 values(1),(2),(3);
insert into t2 select * from t1;
+connection master1;
create temporary table t1 (n int);
insert into t1 values (4),(5);
insert into t2 select * from t1 as t10;
+disconnect master;
+connection slave;
+connection master1;
insert into t2 values(6);
+disconnect master1;
+connection slave;
select * from t2;
n
1
@@ -19,6 +25,8 @@ n
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connect master2,localhost,root,,;
+connection master2;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
diff --git a/mysql-test/suite/rpl/r/rpl_000017.result b/mysql-test/suite/rpl/r/rpl_000017.result
index 1b4f9f1e8a3..d1c453208c7 100644
--- a/mysql-test/suite/rpl/r/rpl_000017.result
+++ b/mysql-test/suite/rpl/r/rpl_000017.result
@@ -1,13 +1,19 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection 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;
include/start_slave.inc
+connection master;
create table t1(n int);
insert into t1 values(24);
+connection slave;
select * from t1;
n
24
+connection master;
drop table t1;
delete from mysql.user where user="replicate";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
index 3280d4bbaf7..7204122b669 100644
--- a/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
+++ b/mysql-test/suite/rpl/r/rpl_LD_INFILE.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
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;
@@ -58,6 +59,8 @@ abasements
abasement
abased
abase
+connection slave;
+connection slave;
SELECT * FROM test.t1 ORDER BY a DESC;
a
aberration
@@ -110,5 +113,7 @@ abasements
abasement
abased
abase
+connection master;
DROP TABLE test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter.result b/mysql-test/suite/rpl/r/rpl_alter.result
index 608526ea79f..4f709db9624 100644
--- a/mysql-test/suite/rpl/r/rpl_alter.result
+++ b/mysql-test/suite/rpl/r/rpl_alter.result
@@ -7,13 +7,17 @@ insert into mysqltest.t1 values (1,2);
create table mysqltest.t2 (n int);
insert into mysqltest.t2 values (45);
rename table mysqltest.t2 to mysqltest.t3, mysqltest.t1 to mysqltest.t2;
+connection slave;
select * from mysqltest.t2;
n m
1 2
select * from mysqltest.t3;
n
45
+connection master;
drop database mysqltest;
+connection slave;
+connection master;
use test;
#
# Test bug where ALTER TABLE MODIFY didn't replicate properly
@@ -67,6 +71,7 @@ select * from t1;
a b
1 NULL
4294967295 NULL
+connection slave;
use test;
select * from t1;
a b
@@ -79,6 +84,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection master;
create table t2 (a int unsigned auto_increment primary key, b int);
show create table t2;
Table Create Table
@@ -110,13 +116,17 @@ drop table t1,t2;
# Test replication when we have int on master and bigint on slave
#
create table t1 (a int unsigned primary key, b int);
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
alter table t1 modify a bigint unsigned;
+connection master;
insert into t1 (a) values (1),((1<<32)-1);
+connection slave;
select * from t1;
a b
1 NULL
4294967295 NULL
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_alter_db.result b/mysql-test/suite/rpl/r/rpl_alter_db.result
index 55adbfeda79..56e82712bec 100644
--- a/mysql-test/suite/rpl/r/rpl_alter_db.result
+++ b/mysql-test/suite/rpl/r/rpl_alter_db.result
@@ -4,6 +4,9 @@ include/master-slave.inc
create database temp_db;
use temp_db;
alter database collate latin1_bin;
+connection slave;
==== Clean up ====
+connection master;
drop database temp_db;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment.result b/mysql-test/suite/rpl/r/rpl_auto_increment.result
index 41bacd78f52..48617a0f713 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment.result
@@ -7,11 +7,13 @@ a b
12 1
22 2
32 3
+connection slave;
select * from t1;
a b
12 1
22 2
32 3
+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);
@@ -24,6 +26,7 @@ a b
3 3
22 5
32 6
+connection slave;
select * from t1;
a b
1 1
@@ -31,6 +34,7 @@ a b
3 3
22 5
32 6
+connection master;
drop table t1;
set @@session.auto_increment_increment=100, @@session.auto_increment_offset=10;
show variables like "auto_inc%";
@@ -60,6 +64,7 @@ a
400
410
1000
+connection slave;
select * from t1;
a
5
@@ -70,6 +75,7 @@ a
400
410
1000
+connection master;
drop table t1;
create table t1 (a int not null auto_increment, primary key (a)) engine=innodb;
insert into t1 values (NULL),(5),(NULL);
@@ -94,6 +100,7 @@ a
400
410
1000
+connection slave;
select * from t1;
a
5
@@ -104,6 +111,7 @@ a
400
410
1000
+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;
@@ -143,6 +151,7 @@ a
600
610
611
+connection slave;
select * from t1;
a
1
@@ -157,10 +166,13 @@ a
600
610
611
+connection master;
drop table t1;
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;
+connection slave;
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;
@@ -170,6 +182,7 @@ a
11
21
31
+connection slave;
select * from t1;
a
1
@@ -182,6 +195,7 @@ a
31
32
42
+connection master;
drop table t1;
create table t1 (a tinyint not null auto_increment primary key) engine=myisam;
insert into t1 values(103);
@@ -213,6 +227,7 @@ insert into t3 values(null);
ERROR 22003: Out of range value for column 'a' at row 1
select * from t3 order by a;
a
+connection slave;
select * from t1 order by a;
a
103
@@ -223,7 +238,10 @@ a
10
select * from t3 order by a;
a
+connection master;
drop table t1,t2,t3;
+connection slave;
+connection master;
set auto_increment_increment=1;
set auto_increment_offset=1;
CREATE TABLE t1 (id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
@@ -234,14 +252,17 @@ t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+connection slave;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1
+connection master;
drop table t1;
include/rpl_reset.inc
+connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY) ENGINE=innodb;
@@ -295,33 +316,52 @@ id
INSERT INTO t1 VALUES(4);
INSERT INTO t2 VALUES(4);
FLUSH LOGS;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
+connection slave;
+connection master;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
SET SQL_MODE='';
+connection slave;
+connection master;
CREATE TABLE t1(s VARCHAR(10)) ENGINE=myisam;
CREATE TABLE t_ignored1(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it invokes a trigger or a stored function that inserts into an AUTO_INCREMENT column");
+connection slave;
+connection slave;
CREATE TABLE test.slave_only(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
INSERT INTO slave_only VALUES(NULL);
CREATE TRIGGER t1_update AFTER UPDATE ON t1 FOR EACH ROW INSERT INTO slave_only VALUES(NULL);
+connection master;
INSERT INTO t_ignored1 VALUES(NULL);
INSERT INTO t1 VALUES('s');
UPDATE t1 SET s='s1';
+connection slave;
+connection slave;
SELECT * FROM t1;
s
s1
+connection master;
CREATE TABLE t_ignored2(id INT AUTO_INCREMENT PRIMARY KEY) ENGINE=myisam;
+connection slave;
+connection slave;
STOP SLAVE;
SET GLOBAL sql_slave_skip_counter = 2;
START SLAVE;
+connection master;
INSERT INTO t_ignored2 VALUES(NULL);
UPDATE t1 SET s='s2';
+connection slave;
+connection slave;
SELECT * FROM t1;
s
s2
@@ -331,9 +371,11 @@ t_ignored2
SELECT * FROM t_ignored2;
id
DROP TABLE slave_only;
+connection master;
DROP TABLE t1;
DROP TABLE t_ignored1;
DROP TABLE t_ignored2;
+connection master;
CREATE TABLE t1 (id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, data INT) ENGINE=innodb;
BEGIN;
# Set sql_mode with NO_AUTO_VALUE_ON_ZERO for allowing
@@ -347,8 +389,11 @@ COMMIT;
SELECT * FROM t1;
id data
0 2
+connection slave;
SELECT * FROM t1;
id data
0 2
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
index 1d378e2d864..6d8a37f0e7f 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_11932.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
+connection master;
drop database if exists test1;
create database test1;
use test1;
@@ -35,10 +36,12 @@ select * from t1;
id fname
1 testtest 1
2 test
+connection slave;
use test1;
select * from t1;
id fname
1 testtest 1
2 test
+connection master;
drop database test1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
index 71c6ff57f80..c75e65ebb6f 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_bug33029.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialize ====
+connection slave;
SET @old_relay_log_purge= @@global.relay_log_purge;
include/setup_fake_relay_log.inc
Setting up fake replication from MYSQL_TEST_DIR/std_data/bug33029-slave-relay-bin.000001
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result b/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result
index 198ecfb6724..3e633d11927 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_bug45679.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.');
+connection master;
create table tm (b int auto_increment, a int, primary key (a,b)) engine= myisam;
create table ti (b int auto_increment, a int, primary key (a,b)) engine= innodb;
ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a key
@@ -36,6 +37,9 @@ Note 1592 Unsafe statement written to the binary log using statement format sinc
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT into autoincrement field which is not the first part in the composed primary key is unsafe.
set @@binlog_format=mixed;
insert into tm set b=null, a=2;
+connection slave;
+connection master;
drop table tm, ti;
drop function multi_part_pk_with_autoinc;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result b/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
index 6cc95fc0743..14286aa5aa0 100644
--- a/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
+++ b/mysql-test/suite/rpl/r/rpl_auto_increment_update_failure.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
# Test case1: INVOKES A TRIGGER with after insert action
+connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 after insert on t1 for each row insert into t2(a) values(6);
@@ -25,8 +26,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
+connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
+connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -104,11 +107,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -116,7 +122,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
+connection slave;
# Test case2: INVOKES A TRIGGER with before insert action
+connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 before insert on t1 for each row insert into t2(a) values(6);
@@ -141,8 +149,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
+connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
+connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -220,11 +230,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -232,7 +245,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
+connection slave;
# Test case3: INVOKES A TRIGGER with after update action
+connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 after update on t1 for each row insert into t2(a) values(6);
@@ -257,8 +272,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
+connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
+connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -336,11 +353,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after update action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -348,7 +368,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
+connection slave;
# Test case4: INVOKES A TRIGGER with before update action
+connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 before update on t1 for each row insert into t2(a) values(6);
@@ -373,8 +395,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
+connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
+connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -452,11 +476,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; delete from t3 where b = 2
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before update action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -464,7 +491,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
+connection slave;
# Test case5: INVOKES A TRIGGER with after delete action
+connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 after delete on t1 for each row insert into t2(a) values(6);
@@ -489,8 +518,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
+connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
+connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -568,11 +599,14 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with after delete action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -580,7 +614,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
+connection slave;
# Test case6: INVOKES A TRIGGER with before delete action
+connection master;
create table t1(a int, b int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create trigger tr1 before delete on t1 for each row insert into t2(a) values(6);
@@ -605,8 +641,10 @@ update t1 set a = a + 5 where b = 1;
update t3 set a = a + 5 where b = 1;
delete from t1 where b = 1;
delete from t3 where b = 1;
+connection master1;
insert into t2(a) values(3);
insert into t4(a) values(3);
+connection master;
commit;
insert into t1(a,b) values(4,2);
insert into t3(a,b) values(4,2);
@@ -684,11 +722,14 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Delete_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INVOKES A TRIGGER with before delete action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t4, slave:t4]
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
@@ -696,7 +737,9 @@ DROP TABLE t4;
DROP TABLE t5;
DROP TABLE t6;
DROP FUNCTION f1_insert_triggered;
+connection slave;
# Test case7: CALLS A FUNCTION which INVOKES A TRIGGER with after insert action
+connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create table t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -712,7 +755,9 @@ insert into t3(a) values(new.a);
end |
begin;
insert into t1(a) values(f1_two_inserts_trigger());
+connection master1;
insert into t2(a) values(4),(5);
+connection master;
commit;
insert into t1(a) values(f1_two_inserts_trigger());
# To verify if insert/update in an autoinc column causes statement to be logged in row format
@@ -755,15 +800,20 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with after insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t3, slave:t3]
+connection master;
drop table t1;
drop table t2;
drop table t3;
drop function f1_two_inserts_trigger;
+connection slave;
# Test case8: CALLS A FUNCTION which INVOKES A TRIGGER with before insert action
+connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
create table t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -779,7 +829,9 @@ insert into t3(a) values(new.a);
end |
begin;
insert into t1(a) values(f1_two_inserts_trigger());
+connection master1;
insert into t2(a) values(4),(5);
+connection master;
commit;
insert into t1(a) values(f1_two_inserts_trigger());
# To verify if insert/update in an autoinc column causes statement to be logged in row format
@@ -822,15 +874,20 @@ master-bin.000001 # Write_rows_v1 # # table_id: #
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
commit;
+connection master;
+connection slave;
#Test if the results are consistent on master and slave
#for 'CALLS A FUNCTION which INVOKES A TRIGGER with before insert action'
include/diff_tables.inc [master:t2, slave:t2]
include/diff_tables.inc [master:t3, slave:t3]
+connection master;
drop table t1;
drop table t2;
drop table t3;
drop function f1_two_inserts_trigger;
+connection slave;
# Test case9: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with after insert action
+connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
CREATE TABLE t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -842,19 +899,25 @@ INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v16 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v16(c1) VALUES (15),(16);
INSERT INTO v16(c2) VALUES (17),(18);
+connection master1;
INSERT INTO v16(c1) VALUES (19),(20);
INSERT INTO v16(c2) VALUES (21),(22);
+connection master;
INSERT INTO v16(c1) VALUES (23), (24);
INSERT INTO v16(c1) VALUES (25), (26);
commit;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
include/diff_tables.inc [master:t3, slave:t3]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP VIEW v16;
+connection slave;
# Test case10: INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS with before insert action
+connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
CREATE TABLE t3(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
@@ -866,19 +929,25 @@ INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v16 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v16(c1) VALUES (15),(16);
INSERT INTO v16(c2) VALUES (17),(18);
+connection master1;
INSERT INTO v16(c1) VALUES (19),(20);
INSERT INTO v16(c2) VALUES (21),(22);
+connection master;
INSERT INTO v16(c1) VALUES (23), (24);
INSERT INTO v16(c1) VALUES (25), (26);
commit;
+connection slave;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOKES TRIGGERS'
include/diff_tables.inc [master:t3, slave:t3]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP VIEW v16;
+connection slave;
# Test case11: INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES INTO A TABLE WITH AUTOINC COLUMN
+connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, primary key(i1)) engine=innodb;
CREATE FUNCTION f1_two_inserts() RETURNS INTEGER
@@ -889,10 +958,13 @@ RETURN 1;
END//
begin;
insert into t1(a) values(f1_two_inserts());
+connection master1;
insert into t2(a) values(4),(5);
+connection master;
commit;
insert into t1(a) values(f1_two_inserts());
commit;
+connection master;
#Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on master
select * from t2 ORDER BY i1;
i1 a
@@ -902,6 +974,8 @@ i1 a
4 5
5 2
6 2
+connection slave;
+connection slave;
#Test result for INVOKES A FUNCTION TO INSERT TWO OR MORE VALUES on slave
select * from t2 ORDER BY i1;
i1 a
@@ -911,10 +985,13 @@ i1 a
4 5
5 2
6 2
+connection master;
drop table t1;
drop table t2;
drop function f1_two_inserts;
+connection slave;
# Test case12: INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES OF A TABLE WITH AUTOINC COLUMN
+connection master;
create table t1(a int) engine=innodb;
create table t2(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb;
CREATE FUNCTION f1_two_updates() RETURNS INTEGER
@@ -925,14 +1002,17 @@ update t2 set a = a + 5 where b = 3;
update t2 set a = a + 5 where b = 4;
RETURN 1;
END//
+connection master1;
insert into t2(a,b) values(1,1);
insert into t2(a,b) values(2,2);
insert into t2(a,b) values(3,3);
insert into t2(a,b) values(4,4);
insert into t1(a) values(f1_two_updates());
+connection master;
begin;
insert into t1(a) values(f1_two_updates());
commit;
+connection master;
#Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on master
select * from t2 ORDER BY i1;
i1 a b
@@ -940,6 +1020,8 @@ i1 a b
2 12 2
3 13 3
4 14 4
+connection slave;
+connection slave;
#Test result for INVOKES A FUNCTION TO UPDATE TWO OR MORE VALUES on slave
select * from t2 ORDER BY i1;
i1 a b
@@ -947,10 +1029,13 @@ i1 a b
2 12 2
3 13 3
4 14 4
+connection master;
drop table t1;
drop table t2;
drop function f1_two_updates;
+connection slave;
# Test case13: UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT
+connection master;
create table t1(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb;
create table t2(i1 int not null auto_increment, a int, b int, primary key(i1)) engine=innodb;
begin;
@@ -974,13 +1059,17 @@ master-bin.000001 # Query # # use `test`; insert into t1(a,b) values(3,3)
master-bin.000001 # Intvar # # INSERT_ID=3
master-bin.000001 # Query # # use `test`; insert into t2(a,b) values(3,3)
master-bin.000001 # Xid # # COMMIT /* XID */
+connection slave;
#Test if the results are consistent on master and slave
#for 'UPDATE MORE THAN ONE TABLES ON TOP-STATEMENT'
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
drop table t1;
drop table t2;
+connection slave;
# Test case14: INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES
+connection master;
CREATE TABLE t1(i1 int not null auto_increment, c1 INT, primary key(i1)) engine=innodb;
CREATE TABLE t2(i1 int not null auto_increment, c2 INT, primary key(i1)) engine=innodb;
begin;
@@ -989,8 +1078,10 @@ INSERT INTO t2(c2) VALUES (13), (14);
CREATE VIEW v15 AS SELECT c1, c2 FROM t1, t2;
INSERT INTO v15(c1) VALUES (15),(16);
INSERT INTO v15(c2) VALUES (17),(18);
+connection master1;
INSERT INTO v15(c1) VALUES (19),(20);
INSERT INTO v15(c2) VALUES (21),(22);
+connection master;
INSERT INTO v15(c1) VALUES (23), (24);
INSERT INTO v15(c2) VALUES (25), (26);
commit;
@@ -1029,11 +1120,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Intvar # # INSERT_ID=7
master-bin.000001 # Query # # use `test`; INSERT INTO v15(c2) VALUES (25), (26)
master-bin.000001 # Xid # # COMMIT /* XID */
+connection slave;
#Test if the results are consistent on master and slave
#for 'INSERT DATA INTO VIEW WHICH INVOLVED MORE THAN ONE TABLES'
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
drop table t1;
drop table t2;
drop view v15;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result b/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result
index b03c0057a69..ff7680c30d5 100644
--- a/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result
+++ b/mysql-test/suite/rpl/r/rpl_autogen_query_multi_byte_char.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
Test case 1:- table name with one character latin name.
SET @s:=CONCAT("CREATE TABLE `",REPEAT(CHAR(131),1),"` (a INT)");
PREPARE STMT FROM @s;
@@ -10,6 +11,8 @@ EXECUTE stmt;
SET @s:=CONCAT("DROP TABLE `",REPEAT(CHAR(131),1), "`");
PREPARE STMT FROM @s;
EXECUTE stmt;
+connection slave;
+connection master;
Test case 2:- table name and database names with one character latin name.
SET @s:=CONCAT("CREATE DATABASE `",REPEAT(CHAR(131),1),"`");
PREPARE STMT FROM @s;
@@ -26,4 +29,5 @@ EXECUTE stmt;
SET @s:=CONCAT("DROP DATABASE `",REPEAT(CHAR(131),1),"`");
PREPARE STMT FROM @s;
EXECUTE stmt;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
index d305be4d4e7..5e16befa87d 100644
--- a/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
+++ b/mysql-test/suite/rpl/r/rpl_begin_commit_rollback.result
@@ -1,6 +1,8 @@
include/master-slave.inc
[connection master]
+connection slave;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection master;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
SET @@session.binlog_direct_non_transactional_updates= FALSE;
DROP DATABASE IF EXISTS db1;
@@ -10,8 +12,9 @@ CREATE DATABASE db2;
use db1;
CREATE TABLE db1.t1 (a INT) ENGINE=InnoDB;
CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM;
+connection slave;
include/stop_slave.inc
-[on master]
+connection master;
CREATE PROCEDURE db1.p1 ()
BEGIN
INSERT INTO t1 VALUES (1);
@@ -46,7 +49,7 @@ SELECT * FROM db1.t2;
s
before call db1.p1()
after call db1.p1()
-[on slave]
+connection slave;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_POS;
include/wait_for_slave_sql_to_stop.inc
#
@@ -65,7 +68,7 @@ a
SELECT * from db1.t2;
s
before call db1.p1()
-[on master]
+connection master;
INSERT INTO db1.t2 VALUES ('before call db1.p2()');
BEGIN;
CALL db1.p2();
@@ -87,7 +90,7 @@ after call db1.p1()
before call db1.p2()
executed db1.p2()
after call db1.p2()
-[on slave]
+connection slave;
start slave until master_log_file='master-bin.000001', master_log_pos=MASTER_POS;
include/wait_for_slave_sql_to_stop.inc
#
@@ -112,7 +115,7 @@ include/wait_for_slave_sql_to_start.inc
#
# SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263
# This was reported by BUG#50407
-[on master]
+connection master;
SET SESSION AUTOCOMMIT=0
BEGIN;
INSERT INTO db1.t1 VALUES(20);
@@ -160,6 +163,7 @@ master-bin.000001 # Query # # ROLLBACK TO `has_comment`
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t2 VALUES("after rollback to")
master-bin.000001 # Query # # use `db1`; INSERT INTO db1.t1 VALUES(50)
master-bin.000001 # Xid # # COMMIT /* XID */
+connection slave;
[on slave]
#
# Verify INSERT statements in savepoints are executed, for MyISAM table
@@ -175,6 +179,7 @@ a
#
# Clean up
#
+connection master;
DROP DATABASE db1;
DROP DATABASE db2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
index a2a065e0a4f..8cd06acc49e 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_corruption.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
call mtr.add_suppression('Found invalid event in binary log');
call mtr.add_suppression('Slave SQL.*Relay log read failure: Could not parse relay log event entry.* 1594');
==== Initialize ====
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_errors.result b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
index 9fcfa35204b..6c111eeaa3b 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_errors.result
@@ -3,7 +3,9 @@ include/master-slave.inc
#######################################################################
####################### PART 1: MASTER TESTS ##########################
#######################################################################
+connection slave;
include/stop_slave.inc
+connection master;
call mtr.add_suppression("Can't generate a unique log-filename");
call mtr.add_suppression("Writing one row to the row-based binary log failed.*");
call mtr.add_suppression("Error writing file .*");
@@ -217,11 +219,14 @@ DROP TABLE t5;
include/rpl_restart_server.inc [server_number=1]
DROP TABLE t1, t2, t4;
RESET MASTER;
+connection slave;
include/start_slave.inc
+connection master;
#######################################################################
####################### PART 2: SLAVE TESTS ###########################
#######################################################################
include/rpl_reset.inc
+connection slave;
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
call mtr.add_suppression("Error writing file .*");
call mtr.add_suppression("Could not open .*");
diff --git a/mysql-test/suite/rpl/r/rpl_binlog_index.result b/mysql-test/suite/rpl/r/rpl_binlog_index.result
index 6611a9ef2c0..4257dbde57a 100644
--- a/mysql-test/suite/rpl/r/rpl_binlog_index.result
+++ b/mysql-test/suite/rpl/r/rpl_binlog_index.result
@@ -1,8 +1,13 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT);
FLUSH BINARY LOGS;
INSERT INTO t1 VALUES (1);
+connection slave;
+connection master;
# Shutdown master
include/rpl_stop_server.inc [server_number=1]
# Move the master binlog files and the index file to a new place
@@ -15,28 +20,40 @@ include/rpl_stop_server.inc [server_number=1]
# Remove the unneeded master-bin.index file
# Restart master with log-bin option set to default
# Master has restarted successfully
+connection slave;
# stop slave
include/stop_slave.inc
include/rpl_stop_server.inc [server_number=2]
+connection master;
# relocate binlogs
# relocate relay logs
# Restart slave with options log-bin, relay-log set to the new paths
+connection slave;
# Slave server has restarted successfully
include/start_slave.inc
include/stop_slave.inc
+connection master;
FLUSH LOGS;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (2);
FLUSH LOGS;
+connection slave;
FLUSH LOGS;
include/start_slave.inc
+connection master;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/stop_slave.inc
include/rpl_stop_server.inc [server_number=2]
+connection master;
# remove tmpdir
# restarted with previous slave settings
+connection slave;
include/start_slave.inc
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bit.result b/mysql-test/suite/rpl/r/rpl_bit.result
index fa935cd9e56..b83faa4a28a 100644
--- a/mysql-test/suite/rpl/r/rpl_bit.result
+++ b/mysql-test/suite/rpl/r/rpl_bit.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@@ -91,6 +92,7 @@ hex(bit3)
15
24
35
+connection slave;
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
oSupp sSuppD GSuppDf VNotSupp x034
5 5 3 2 1
@@ -131,5 +133,7 @@ hex(bit3)
15
24
35
+connection master;
DROP TABLE IF EXISTS test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bit_npk.result b/mysql-test/suite/rpl/r/rpl_bit_npk.result
index 13c9985614e..5c7e6fc55b6 100644
--- a/mysql-test/suite/rpl/r/rpl_bit_npk.result
+++ b/mysql-test/suite/rpl/r/rpl_bit_npk.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (
dummyKey INTEGER NOT NULL,
@@ -94,6 +95,7 @@ hex(bit3)
15
24
35
+connection slave;
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034
FROM test.t1
ORDER BY oSupp, sSuppD, GSuppDf, VNotSupp, x034;
@@ -136,6 +138,7 @@ hex(bit3)
15
24
35
+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');
@@ -152,6 +155,7 @@ SELECT * FROM test.t3 ORDER BY a,b;
a b
1 NULL
2 0
+connection slave;
SELECT a, hex(b) FROM test.t2 ORDER BY a,b;
a hex(b)
1 0
@@ -160,7 +164,9 @@ SELECT * FROM test.t3 ORDER BY a,b;
a b
1 NULL
2 0
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_blackhole.result b/mysql-test/suite/rpl/r/rpl_blackhole.result
index 1fb8dd6d125..b61e857fd3f 100644
--- a/mysql-test/suite/rpl/r/rpl_blackhole.result
+++ b/mysql-test/suite/rpl/r/rpl_blackhole.result
@@ -3,89 +3,105 @@ include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE t1 (a INT, b INT, c INT);
CREATE TABLE t2 (a INT, b INT, c INT);
+connection slave;
ALTER TABLE t1 ENGINE=BLACKHOLE;
+connection master;
INSERT INTO t2 VALUES (1,9,1), (2,9,2), (3,9,3), (4,9,4);
-[on master]
+connection slave;
+connection slave;
+connection master;
INSERT INTO t1 VALUES (1,1,1),(2,1,2),(3,1,3),(4,1,4);
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 1;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
DELETE FROM t1 WHERE a % 2 = 0 AND b = 1;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
INSERT INTO t1 SELECT * FROM t2;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
+connection master;
ALTER TABLE t1 ADD PRIMARY KEY pk_t1 (a,b);
-[on master]
+connection slave;
+connection master;
INSERT INTO t1 VALUES (1,2,1),(2,2,2),(3,2,3),(4,2,4);
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 2;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
DELETE FROM t1 WHERE a % 2 = 0 AND b = 2;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
+connection master;
ALTER TABLE t1 DROP PRIMARY KEY, ADD KEY key_t1 (a);
-[on master]
+connection slave;
+connection master;
INSERT INTO t1 VALUES (1,3,1),(2,3,2),(3,3,3),(4,3,4);
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
UPDATE t1 SET c = 2*c WHERE a % 2 = 0 AND b = 3;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
-[on master]
+connection slave;
+connection master;
DELETE FROM t1 WHERE a % 2 = 0 AND b = 3;
-[on slave]
+connection slave;
# Expect 0
SELECT COUNT(*) FROM t1;
COUNT(*)
0
>>> Something was written to binary log <<<
+connection master;
DROP TABLE t1,t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug26395.result b/mysql-test/suite/rpl/r/rpl_bug26395.result
index 37ad6705106..2eec488b3af 100644
--- a/mysql-test/suite/rpl/r/rpl_bug26395.result
+++ b/mysql-test/suite/rpl/r/rpl_bug26395.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialize ====
-[on master]
+connection master;
CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
SHOW CREATE TABLE tinnodb;
Table Create Table
@@ -31,9 +31,9 @@ Last_IO_Error
SELECT * FROM tinnodb ORDER BY a;
a
==== Clean up ====
-[on master]
+connection master;
DROP TABLE tinnodb;
set @@debug_dbug= @old_debug;
-[on slave]
+connection slave;
DROP TABLE tinnodb;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug31076.result b/mysql-test/suite/rpl/r/rpl_bug31076.result
index e09960e848e..c163cc552ab 100644
--- a/mysql-test/suite/rpl/r/rpl_bug31076.result
+++ b/mysql-test/suite/rpl/r/rpl_bug31076.result
@@ -67,5 +67,6 @@ event_id visit_id timestamp src data visits_events_id
20000 21231038 2007-09-18 03:59:02 Downloads/MySQL-4.1/mysql-4.1.12a-win32.zip 33712207
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
DROP DATABASE track;
+connection slave;
End of 5.1 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug33931.result b/mysql-test/suite/rpl/r/rpl_bug33931.result
index e72b966ef6a..74ba945b027 100644
--- a/mysql-test/suite/rpl/r/rpl_bug33931.result
+++ b/mysql-test/suite/rpl/r/rpl_bug33931.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
call mtr.add_suppression("Failed during slave I/O thread initialization");
call mtr.add_suppression("Slave SQL.*Failed during slave thread initialization.* 1593");
include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug37426.result b/mysql-test/suite/rpl/r/rpl_bug37426.result
index bf96255c7b4..403e1469399 100644
--- a/mysql-test/suite/rpl/r/rpl_bug37426.result
+++ b/mysql-test/suite/rpl/r/rpl_bug37426.result
@@ -1,12 +1,16 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE char128_utf8 (i1 INT NOT NULL, c CHAR(128) CHARACTER SET utf8 NOT NULL, i2 INT NOT NULL);
INSERT INTO char128_utf8 VALUES ( 1, "123", 1 );
SELECT * FROM char128_utf8;
i1 c i2
1 123 1
+connection slave;
SELECT * FROM char128_utf8;
i1 c i2
1 123 1
+connection master;
DROP TABLE char128_utf8;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_bug41902.result b/mysql-test/suite/rpl/r/rpl_bug41902.result
index 026a92d854b..8667795bd77 100644
--- a/mysql-test/suite/rpl/r/rpl_bug41902.result
+++ b/mysql-test/suite/rpl/r/rpl_bug41902.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
stop slave;
SET @@debug_dbug="d,simulate_find_log_pos_error";
reset slave;
@@ -17,6 +18,7 @@ ERROR HY000: Target log not found in binlog index
SET @@debug_dbug="";
reset slave;
change master to master_host='dummy';
+connection master;
SET @@debug_dbug="d,simulate_find_log_pos_error";
reset master;
ERROR HY000: Target log not found in binlog index
diff --git a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
index 0cc1e4b5057..5aff978538f 100644
--- a/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_cant_read_event_incident.result
@@ -1,18 +1,23 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
+connection master;
call mtr.add_suppression("Error in Log_event::read_log_event()");
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
show binlog events;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
+connection slave;
call mtr.add_suppression("Slave I/O: Got fatal error 1236 from master when reading data from binary log");
reset slave;
start slave;
include/wait_for_slave_param.inc [Last_IO_Errno]
Last_IO_Errno = '1236'
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event '.' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
+connection master;
reset master;
+connection slave;
stop slave;
reset slave;
drop table if exists t;
diff --git a/mysql-test/suite/rpl/r/rpl_change_master.result b/mysql-test/suite/rpl/r/rpl_change_master.result
index 1b1f040b726..5439bdef72c 100644
--- a/mysql-test/suite/rpl/r/rpl_change_master.result
+++ b/mysql-test/suite/rpl/r/rpl_change_master.result
@@ -1,12 +1,16 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression("Slave I/O: The slave I/O thread stops because a fatal error is encountered when it tried to SET @master_binlog_checksum");
+connection master;
create table t1(n int);
+connection slave;
select * from t1;
n
stop slave sql_thread;
+connection master;
insert into t1 values(1);
insert into t1 values(2);
+connection slave;
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
include/stop_slave.inc
change master to master_user='root';
@@ -15,5 +19,7 @@ select * from t1;
n
1
2
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_charset.result b/mysql-test/suite/rpl/r/rpl_charset.result
index 221eb16176d..a96cb26dd9d 100644
--- a/mysql-test/suite/rpl/r/rpl_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_charset.result
@@ -4,35 +4,31 @@ set timestamp=1000000000;
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--
+connection 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 */
+connection master;
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--
+connection slave;
show create database mysqltest3;
Database Create Database
mysqltest3 CREATE DATABASE `mysqltest3` /*!40100 DEFAULT CHARACTER SET armscii8 COLLATE armscii8_bin */
+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;
@@ -41,7 +37,6 @@ 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
@@ -49,7 +44,7 @@ a b
3 cp850
4 latin2
5 latin2_croatian_ci
---- --slave--
+connection slave;
select * from mysqltest2.t1 order by a;
a b
1 armscii8
@@ -57,6 +52,7 @@ a b
3 cp850
4 latin2
5 latin2_croatian_ci
+connection master;
set character_set_client=latin1, collation_connection=latin1_german1_ci;
truncate table t1;
insert into t1 (b) values(@@collation_connection);
@@ -64,35 +60,37 @@ 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--
+connection slave;
select * from mysqltest2.t1 order by a;
a b
1 latin1_german1_ci
2 Muffler
3 latin1_german2_ci
4 Müller
+connection master;
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--
+connection slave;
select * from mysqltest2.t1 order by a;
a b
1 cp850_general_ci
+connection master;
drop database mysqltest2;
drop database mysqltest3;
+connection slave;
set global character_set_server=latin2;
set global character_set_server=latin1;
+connection master;
set global character_set_server=latin2;
set global character_set_server=latin1;
set character_set_client=9999999;
@@ -108,10 +106,14 @@ INSERT INTO t1 (c1, c2) VALUES ('îÕ, ÚÁ ÒÙÂÁÌËÕ','îÕ, ÚÁ ÒÙÂÁÌËÕ');
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
+connection slave;
select hex(c1), hex(c2) from t1;
hex(c1) hex(c2)
CDF32C20E7E020F0FBE1E0EBEAF3 CDF32C20E7E020F0FBE1E0EBEAF3
+connection master;
drop table t1;
+connection slave;
+connection master;
create table `t1` (
`pk` varchar(10) not null default '',
primary key (`pk`)
diff --git a/mysql-test/suite/rpl/r/rpl_charset_sjis.result b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
index ff6296987f8..844142ccd72 100644
--- a/mysql-test/suite/rpl/r/rpl_charset_sjis.result
+++ b/mysql-test/suite/rpl/r/rpl_charset_sjis.result
@@ -6,27 +6,26 @@ create table t1 (a varchar(255) character set sjis);
create procedure p1 (in a varchar(255) character set sjis) insert into t1 values (a);
SET NAMES binary;
CALL p1 ('–\\');
-select "--- on master ---";
---- on master ---
---- on master ---
select hex(a) from t1 ;
hex(a)
965C
-select "--- on slave ---";
---- on slave ---
---- on slave ---
+connection slave;
+connection slave;
select hex(a) from t1;
hex(a)
965C
+connection master;
drop table t1;
drop procedure p1;
+connection slave;
+connection master;
#
# Start of 5.5 tests
#
#
# Bug#MDEV-4489 Replication of big5, cp932, gbk, sjis strings makes wrong values on slave
#
---- on master ---
+connection master;
SET NAMES sjis;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0x31),(X'31'),('1');
@@ -40,15 +39,18 @@ a
1
1
1
---- on slave ---
+connection slave;
+connection slave;
SELECT * FROM t1;
a
49
1
1
1
---- on master ---
+connection master;
DROP TABLE t1;
+connection slave;
+connection master;
#
# End of 5.5 tests
#
diff --git a/mysql-test/suite/rpl/r/rpl_checksum.result b/mysql-test/suite/rpl/r/rpl_checksum.result
index bd5b23c2228..c63ef7e1d10 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum.result
@@ -4,6 +4,7 @@ call mtr.add_suppression('Slave can not handle replication events with the check
call mtr.add_suppression('Replication event checksum verification failed');
call mtr.add_suppression('Relay log write failure: could not queue event from master');
call mtr.add_suppression('Master is configured to log replication events with checksum, but will not send such events to slaves that cannot process them');
+connection master;
set @master_save_binlog_checksum= @@global.binlog_checksum;
set @save_master_verify_checksum = @@global.master_verify_checksum;
select @@global.binlog_checksum as 'must be CRC32 because of the command line option';
@@ -16,6 +17,7 @@ must be zero because of default
0
select @@session.master_verify_checksum as 'no session var';
ERROR HY000: Variable 'master_verify_checksum' is a GLOBAL variable
+connection slave;
set @slave_save_binlog_checksum= @@global.binlog_checksum;
set @save_slave_sql_verify_checksum = @@global.slave_sql_verify_checksum;
select @@global.slave_sql_verify_checksum as 'must be one because of default';
@@ -23,6 +25,7 @@ must be one because of default
1
select @@session.slave_sql_verify_checksum as 'no session var';
ERROR HY000: Variable 'slave_sql_verify_checksum' is a GLOBAL variable
+connection master;
show binary logs;
Log_name File_size
master-bin.000001 #
@@ -50,15 +53,18 @@ set @@global.binlog_checksum = ADLER32;
ERROR 42000: Variable 'binlog_checksum' can't be set to the value of 'ADLER32'
set @@global.master_verify_checksum = 2;
ERROR 42000: Variable 'master_verify_checksum' can't be set to the value of '2'
+connection slave;
set @@global.slave_sql_verify_checksum = 0;
set @@global.slave_sql_verify_checksum = default;
set @@global.slave_sql_verify_checksum = 2;
ERROR 42000: Variable 'slave_sql_verify_checksum' can't be set to the value of '2'
+connection master;
set @@global.binlog_checksum = NONE;
create table t1 (a int);
flush logs;
flush logs;
flush logs;
+connection slave;
flush logs;
flush logs;
flush logs;
@@ -66,8 +72,10 @@ select count(*) as zero from t1;
zero
0
include/stop_slave.inc
+connection master;
set @@global.binlog_checksum = CRC32;
insert into t1 values (1) /* will not be applied on slave due to simulation */;
+connection slave;
set @@global.debug_dbug='d,simulate_slave_unaware_checksum';
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
@@ -76,15 +84,21 @@ select count(*) as zero from t1;
zero
0
set @@global.debug_dbug='';
+connection slave;
include/start_slave.inc
+connection master;
set @@global.master_verify_checksum = 1;
set @@session.debug_dbug='d,simulate_checksum_test_failure';
show binlog events;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/O error
set @@session.debug_dbug='';
set @@global.master_verify_checksum = default;
+connection slave;
+connection slave;
include/stop_slave.inc
+connection master;
create table t2 (a int);
+connection slave;
set @@global.debug_dbug='d,simulate_checksum_test_failure';
start slave io_thread;
include/wait_for_slave_io_error.inc [errno=1595,1913]
@@ -98,37 +112,53 @@ include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Error initializing relay log position: I/O error reading event at position 4'
set @@global.debug_dbug='';
include/start_slave.inc
+connection master;
+connection slave;
select count(*) as 'must be zero' from t2;
must be zero
0
+connection slave;
stop slave;
reset slave;
set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
flush logs;
+connection master;
set @@global.binlog_checksum= CRC32;
reset master;
flush logs;
create table t3 (a int, b char(5));
+connection slave;
include/start_slave.inc
+connection master;
+connection slave;
select count(*) as 'must be zero' from t3;
must be zero
0
include/stop_slave.inc
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+connection master;
flush logs;
reset master;
insert into t3 value (1, @@global.binlog_checksum);
+connection slave;
include/start_slave.inc
flush logs;
+connection master;
+connection slave;
select count(*) as 'must be one' from t3;
must be one
1
+connection master;
set @@global.binlog_checksum= IF(floor((rand()*1000)%2), "CRC32", "NONE");
insert into t3 value (1, @@global.binlog_checksum);
+connection slave;
+connection master;
drop table t1, t2, t3;
set @@global.binlog_checksum = @master_save_binlog_checksum;
set @@global.master_verify_checksum = @save_master_verify_checksum;
+connection slave;
*** Bug#59123 / MDEV-5799: INCIDENT_EVENT checksum written to error log as garbage characters ***
+connection master;
CREATE TABLE t4 (a INT PRIMARY KEY);
INSERT INTO t4 VALUES (1);
SET sql_log_bin=0;
@@ -141,6 +171,7 @@ ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
SET debug_dbug= @old_dbug;
INSERT INTO t4 VALUES (2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1590]
Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log'
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: error writing to the binary log, Internal MariaDB error code: 1590/ in mysqld.2.err
@@ -150,12 +181,16 @@ a
STOP SLAVE IO_THREAD;
SET sql_slave_skip_counter= 1;
include/start_slave.inc
+connection master;
+connection slave;
SELECT * FROM t4 ORDER BY a;
a
1
2
+connection slave;
set @@global.binlog_checksum = @slave_save_binlog_checksum;
set @@global.slave_sql_verify_checksum = @save_slave_sql_verify_checksum;
End of tests
+connection master;
DROP TABLE t4;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_checksum_cache.result b/mysql-test/suite/rpl/r/rpl_checksum_cache.result
index 9508e94e7f2..d3167496249 100644
--- a/mysql-test/suite/rpl/r/rpl_checksum_cache.result
+++ b/mysql-test/suite/rpl/r/rpl_checksum_cache.result
@@ -2,14 +2,17 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
+connection master;
set @save_binlog_cache_size = @@global.binlog_cache_size;
set @save_binlog_checksum = @@global.binlog_checksum;
set @save_master_verify_checksum = @@global.master_verify_checksum;
set @@global.binlog_cache_size = 4096;
set @@global.binlog_checksum = CRC32;
set @@global.master_verify_checksum = 1;
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+connection master;
flush status;
show status like "binlog_cache_use";
Variable_name Value
@@ -38,10 +41,14 @@ Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
+connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
+connection master;
begin;
delete from t1;
commit;
+connection slave;
+connection master;
flush status;
create table t2(a int auto_increment primary key, data VARCHAR(12288)) ENGINE=Innodb;
show status like "binlog_cache_use";
@@ -51,10 +58,14 @@ Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
+connection slave;
include/diff_tables.inc [master:test.t2, slave:test.t2]
+connection master;
begin;
delete from t2;
commit;
+connection slave;
+connection master;
flush status;
create table t3(a int auto_increment primary key, data VARCHAR(8192)) engine=innodb;
show status like "binlog_cache_use";
@@ -64,10 +75,14 @@ Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
+connection slave;
include/diff_tables.inc [master:test.t3, slave:test.t3]
+connection master;
begin;
delete from t3;
commit;
+connection slave;
+connection master;
flush status;
create procedure test.p1 (n int)
begin
@@ -102,9 +117,11 @@ Binlog_cache_use 1
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
+connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
include/diff_tables.inc [master:test.t3, slave:test.t3]
+connection master;
begin;
delete from t1;
delete from t2;
diff --git a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
index c4878fa3f4b..f50f6993bdf 100644
--- a/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_circular_for_4_hosts.result
@@ -1,49 +1,59 @@
*** Set up circular replication on four servers ***
include/rpl_init.inc [topology=1->2->3->4->1]
-[connection server_4]
+connection server_4;
SET auto_increment_increment= 4;
SET auto_increment_offset= 4;
-[connection server_3]
+connection server_3;
SET auto_increment_increment= 4;
SET auto_increment_offset= 3;
-[connection server_2]
+connection server_2;
SET auto_increment_increment= 4;
SET auto_increment_offset= 2;
-[connection server_1]
+connection server_1;
SET auto_increment_increment= 4;
SET auto_increment_offset= 1;
*** Preparing data ***
+connection server_1;
CREATE TABLE t1 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=MyISAM;
CREATE TABLE t2 (a INT NOT NULL AUTO_INCREMENT, b VARCHAR(100), c INT NOT NULL, PRIMARY KEY(a)) ENGINE=InnoDB;
include/rpl_sync.inc
+connection server_4;
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
*** Testing schema A->B->C->D->A ***
+connection server_1;
INSERT INTO t1(b,c) VALUES('A',1);
+connection server_2;
INSERT INTO t1(b,c) VALUES('B',1);
+connection server_3;
INSERT INTO t1(b,c) VALUES('C',1);
+connection server_4;
INSERT INTO t1(b,c) VALUES('D',1);
include/rpl_sync.inc
+connection server_1;
SELECT 'Master A',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
Master A a b
Master A 1 A
Master A 2 B
Master A 3 C
Master A 4 D
+connection server_2;
SELECT 'Master B',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
Master B a b
Master B 1 A
Master B 2 B
Master B 3 C
Master B 4 D
+connection server_3;
SELECT 'Master C',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
Master C a b
Master C 1 A
Master C 2 B
Master C 3 C
Master C 4 D
+connection server_4;
SELECT 'Master D',a,b FROM t1 WHERE c = 1 ORDER BY a,b;
Master D a b
Master D 1 A
@@ -54,53 +64,74 @@ Master D 4 D
*** Testing schema A->B->D->A if C has failure ***
* Do failure for C and then make new connection B->D *
+connection server_4;
STOP SLAVE;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;
include/start_slave.inc
+connection server_3;
INSERT INTO t1 VALUES(6,'C',2);
+connection server_4;
+connection server_2;
INSERT INTO t1(b,c) VALUES('B',2);
+connection server_3;
call mtr.add_suppression("Slave SQL.*Duplicate entry .6. for key .PRIMARY.* error.* 1062");
include/wait_for_slave_sql_error.inc [errno=1062]
+connection server_1;
INSERT INTO t1(b,c) VALUES('A',2);
+connection server_4;
INSERT INTO t1(b,c) VALUES('D',2);
+connection server_2;
* Data on servers (C failed) *
+connection server_1;
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master A a b
Master A 5 A
Master A 8 D
+connection server_2;
SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master B a b
Master B 5 A
Master B 6 B
Master B 8 D
+connection server_3;
SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master C a b
Master C 6 C
+connection server_4;
SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master D a b
Master D 8 D
* Reconfigure replication to schema A->B->D->A *
+connection server_3;
include/stop_slave_io.inc
+connection server_4;
include/stop_slave.inc
include/rpl_change_topology.inc [new topology=1->2->4->1,2->3]
include/start_slave.inc
+connection server_2;
+connection server_4;
+connection server_1;
* Check data inserted before failure *
+connection server_1;
SELECT 'Master A',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master A a b
Master A 5 A
Master A 6 B
Master A 8 D
+connection server_2;
SELECT 'Master B',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master B a b
Master B 5 A
Master B 6 B
Master B 8 D
+connection server_3;
SELECT 'Master C',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master C a b
Master C 6 C
+connection server_4;
SELECT 'Master D',a,b FROM t1 WHERE c = 2 ORDER BY a,b;
Master D a b
Master D 5 A
@@ -108,41 +139,58 @@ Master D 6 B
Master D 8 D
* Check data inserted after failure *
+connection server_1;
INSERT INTO t1(b,c) VALUES('A',3);
+connection server_2;
INSERT INTO t1(b,c) VALUES('B',3);
+connection server_4;
INSERT INTO t1(b,c) VALUES('D',3);
+connection server_1;
include/rpl_sync.inc
+connection server_1;
SELECT 'Master A',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
Master A a b
Master A 9 A
Master A 10 B
Master A 12 D
+connection server_2;
SELECT 'Master B',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
Master B a b
Master B 9 A
Master B 10 B
Master B 12 D
+connection server_3;
SELECT 'Master C',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
Master C a b
+connection server_4;
SELECT 'Master D',a,b FROM t1 WHERE c = 3 ORDER BY a,b;
Master D a b
Master D 9 A
Master D 10 B
Master D 12 D
+connection server_1;
*** Testing restoring scheme A->B->C->D->A after failure ***
* Remove wrong event from C and restore B->C->D *
+connection server_4;
include/stop_slave.inc
+connection server_3;
DELETE FROM t1 WHERE a = 6;
include/start_slave.inc
+connection server_2;
+connection server_3;
RESET MASTER;
+connection server_4;
RESET SLAVE;
include/rpl_change_topology.inc [new topology=1->2->3->4->1]
include/start_slave.inc
+connection server_3;
+connection server_4;
include/rpl_sync.inc
* Check data inserted before restoring schema A->B->C->D->A *
+connection server_1;
SELECT 'Master A',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
Master A a b
Master A 5 A
@@ -151,6 +199,7 @@ Master A 8 D
Master A 9 A
Master A 10 B
Master A 12 D
+connection server_2;
SELECT 'Master B',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
Master B a b
Master B 5 A
@@ -159,6 +208,7 @@ Master B 8 D
Master B 9 A
Master B 10 B
Master B 12 D
+connection server_3;
SELECT 'Master C',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
Master C a b
Master C 5 A
@@ -167,6 +217,7 @@ Master C 8 D
Master C 9 A
Master C 10 B
Master C 12 D
+connection server_4;
SELECT 'Master D',a,b FROM t1 WHERE c IN (2,3) ORDER BY a,b;
Master D a b
Master D 5 A
@@ -175,88 +226,116 @@ Master D 8 D
Master D 9 A
Master D 10 B
Master D 12 D
+connection server_1;
* Check data inserted after restoring schema A->B->C->D->A *
+connection server_1;
INSERT INTO t1(b,c) VALUES('A',4);
+connection server_2;
INSERT INTO t1(b,c) VALUES('B',4);
+connection server_3;
INSERT INTO t1(b,c) VALUES('C',4);
+connection server_4;
INSERT INTO t1(b,c) VALUES('D',4);
+connection server_1;
include/rpl_sync.inc
+connection server_1;
SELECT 'Master A',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
Master A a b
Master A 13 A
Master A 14 B
Master A 15 C
Master A 16 D
+connection server_2;
SELECT 'Master B',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
Master B a b
Master B 13 A
Master B 14 B
Master B 15 C
Master B 16 D
+connection server_3;
SELECT 'Master C',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
Master C a b
Master C 13 A
Master C 14 B
Master C 15 C
Master C 16 D
+connection server_4;
SELECT 'Master D',a,b FROM t1 WHERE c = 4 ORDER BY a,b;
Master D a b
Master D 13 A
Master D 14 B
Master D 15 C
Master D 16 D
+connection server_1;
* Transactions with commits *
+connection server_1;
BEGIN;
+connection server_3;
BEGIN;
+connection server_1;
include/rpl_sync.inc
+connection server_1;
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
Master A b COUNT(*)
Master A A 100
Master A B 100
Master A C 100
Master A D 100
+connection server_2;
SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
Master B b COUNT(*)
Master B A 100
Master B B 100
Master B C 100
Master B D 100
+connection server_3;
SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
Master C b COUNT(*)
Master C A 100
Master C B 100
Master C C 100
Master C D 100
+connection server_4;
SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 1 GROUP BY b ORDER BY b;
Master D b COUNT(*)
Master D A 100
Master D B 100
Master D C 100
Master D D 100
+connection server_1;
* Transactions with rollbacks *
+connection server_1;
BEGIN;
+connection server_3;
BEGIN;
+connection server_1;
include/rpl_sync.inc
+connection server_1;
SELECT 'Master A',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
Master A b COUNT(*)
Master A B 100
Master A D 100
+connection server_2;
SELECT 'Master B',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
Master B b COUNT(*)
Master B B 100
Master B D 100
+connection server_3;
SELECT 'Master C',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
Master C b COUNT(*)
Master C B 100
Master C D 100
+connection server_4;
SELECT 'Master D',b,COUNT(*) FROM t2 WHERE c = 2 GROUP BY b ORDER BY b;
Master D b COUNT(*)
Master D B 100
Master D D 100
+connection server_1;
*** Clean up ***
+connection server_1;
DROP TABLE t1,t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_colSize.result b/mysql-test/suite/rpl/r/rpl_colSize.result
index 0f701e32d9b..503bf85222e 100644
--- a/mysql-test/suite/rpl/r/rpl_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_colSize.result
@@ -3,6 +3,7 @@ include/master-slave.inc
DROP TABLE IF EXISTS t1;
**** Testing WL#3228 changes. ****
*** Create "wider" table on slave ***
+connection slave;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
RESET SLAVE;
@@ -30,6 +31,7 @@ s MEDIUMTEXT,
t LONGTEXT
);
*** Create same table on master but with narrow columns ***
+connection master;
CREATE TABLE t1 (
a float (44),
b double (10,3),
@@ -53,9 +55,11 @@ t LONGTEXT
);
RESET MASTER;
*** Start replication ***
+connection slave;
START SLAVE;
include/wait_for_slave_to_start.inc
*** Insert data on master and display it. ***
+connection master;
INSERT INTO t1 () VALUES (
17.567,
2.123,
@@ -80,9 +84,12 @@ SELECT * FROM t1 ORDER BY a;
a b c d e f g h j k l m n o p q r s t
17.567 2.123 10.20 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
*** Select data from slave to compare ***
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c d e f g h j k l m n o p q r s t
17.567 2.123000000 10.200000000000000000000000000000 125 # TEST This is a test # more binary data 6 7 blob 1 blob 2 blob 3 blob 4 text 1 text 2 text 3 text 4
+connection master;
DROP TABLE t1;
Create varchar table on master
CREATE TABLE t1 (
@@ -91,11 +98,13 @@ b VARCHAR(100),
c VARCHAR(300),
d CHAR(5)
);
+connection slave;
Alter varchar table on slave
ALTER TABLE t1 CHANGE COLUMN a a VARCHAR(100);
ALTER TABLE t1 CHANGE COLUMN b b VARCHAR(400);
ALTER TABLE t1 CHANGE COLUMN c c VARCHAR(500);
ALTER TABLE t1 CHANGE COLUMN d d CHAR(100);
+connection master;
Insert some values and select them on master
INSERT INTO t1 VALUES ("This is a test of col a.",
"This is another test of col b.",
@@ -112,6 +121,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(300) DEFAULT NULL,
`d` char(5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
Insert some values and select them on slave
SELECT * FROM t1;
a b c d
@@ -124,6 +134,7 @@ t1 CREATE TABLE `t1` (
`c` varchar(500) DEFAULT NULL,
`d` char(100) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection master;
DROP TABLE t1;
Create bit table on master
CREATE TABLE t1 (
@@ -133,6 +144,7 @@ c BIT(21),
d BIT(11),
e BIT(11)
);
+connection slave;
Create bit table on slave
DROP TABLE t1;
CREATE TABLE t1 (
@@ -142,6 +154,7 @@ c BIT(54),
d BIT(25),
e BIT(13)
);
+connection master;
Insert some values and select them on master
INSERT INTO t1 VALUES (
b'1010101',
@@ -162,6 +175,7 @@ t1 CREATE TABLE `t1` (
`d` bit(11) DEFAULT NULL,
`e` bit(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
Insert some values and select them on master
SELECT BIN(a), BIN(b), BIN(c), BIN(d), BIN(e) FROM t1;
BIN(a) BIN(b) BIN(c) BIN(d) BIN(e)
@@ -176,6 +190,8 @@ t1 CREATE TABLE `t1` (
`e` bit(13) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
*** Cleanup ***
+connection master;
DROP TABLE t1;
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_commit_after_flush.result b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
index b91b273e64e..1d5a657175e 100644
--- a/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
+++ b/mysql-test/suite/rpl/r/rpl_commit_after_flush.result
@@ -5,6 +5,9 @@ begin;
insert into t1 values(1);
flush tables with read lock;
commit;
+connection slave;
+connection master;
unlock tables;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_concurrency_error.result b/mysql-test/suite/rpl/r/rpl_concurrency_error.result
index a94626685e5..31edda51a6b 100644
--- a/mysql-test/suite/rpl/r/rpl_concurrency_error.result
+++ b/mysql-test/suite/rpl/r/rpl_concurrency_error.result
@@ -4,6 +4,7 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
########################################################################
# Environment
########################################################################
+connection master;
CREATE TABLE t (i INT, PRIMARY KEY(i), f CHAR(8)) engine = Innodb;
CREATE TABLE n (d DATETIME, f CHAR(32)) engine = MyIsam;
CREATE TRIGGER tr AFTER UPDATE ON t FOR EACH ROW
@@ -11,21 +12,27 @@ BEGIN
INSERT INTO n VALUES ( now(), concat( 'updated t: ', old.f, ' -> ', new.f ) );
END |
INSERT INTO t VALUES (4,'black'), (2,'red'), (3,'yelow'), (1,'cyan');
+connect conn1, 127.0.0.1,root,,;
+connect conn2, 127.0.0.1,root,,;
########################################################################
# Testing ER_LOCK_WAIT_TIMEOUT
########################################################################
+connection conn1;
SET AUTOCOMMIT = 1;
BEGIN;
UPDATE t SET f = 'yellow 2' WHERE i = 3;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
+connection conn2;
SET AUTOCOMMIT = 1;
BEGIN;
UPDATE t SET f = 'magenta 2' WHERE f = 'red';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t VALUES (5 + (2 * 10),"brown");
INSERT INTO n VALUES (now(),"brown");
+connection conn1;
COMMIT;
+connection conn2;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
@@ -41,18 +48,22 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 2' WHERE f = 'red'
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (2 * 10),"brown")
master-bin.000001 # Query # # ROLLBACK
+connection conn1;
SET AUTOCOMMIT = 1;
BEGIN;
UPDATE t SET f = 'gray 2' WHERE i = 3;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
+connection conn2;
SET AUTOCOMMIT = 1;
BEGIN;
UPDATE t SET f = 'dark blue 2' WHERE f = 'red';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t VALUES (6 + (2 * 10),"brown");
INSERT INTO n VALUES (now(),"brown");
+connection conn1;
COMMIT;
+connection conn2;
COMMIT;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -66,16 +77,20 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 2' WHERE f = 'red'
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (2 * 10),"brown")
master-bin.000001 # Xid # # COMMIT /* XID */
+connection conn1;
SET AUTOCOMMIT = 0;
UPDATE t SET f = 'yellow 1' WHERE i = 3;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
+connection conn2;
SET AUTOCOMMIT = 0;
UPDATE t SET f = 'magenta 1' WHERE f = 'red';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t VALUES (5 + (1 * 10),"brown");
INSERT INTO n VALUES (now(),"brown");
+connection conn1;
COMMIT;
+connection conn2;
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
@@ -91,16 +106,20 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'magenta 1' WHERE f = 'red'
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (5 + (1 * 10),"brown")
master-bin.000001 # Query # # ROLLBACK
+connection conn1;
SET AUTOCOMMIT = 0;
UPDATE t SET f = 'gray 1' WHERE i = 3;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them.
+connection conn2;
SET AUTOCOMMIT = 0;
UPDATE t SET f = 'dark blue 1' WHERE f = 'red';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
INSERT INTO t VALUES (6 + (1 * 10),"brown");
INSERT INTO n VALUES (now(),"brown");
+connection conn1;
COMMIT;
+connection conn2;
COMMIT;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -114,12 +133,19 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; UPDATE t SET f = 'dark blue 1' WHERE f = 'red'
master-bin.000001 # Query # # use `test`; INSERT INTO t VALUES (6 + (1 * 10),"brown")
master-bin.000001 # Xid # # COMMIT /* XID */
+connection master;
+connection slave;
include/rpl_diff.inc
include/rpl_diff.inc
########################################################################
# Cleanup
########################################################################
+connection master;
DROP TRIGGER tr;
DROP TABLE t;
DROP TABLE n;
+connection slave;
+connection master;
+disconnect conn1;
+disconnect conn2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_conditional_comments.result b/mysql-test/suite/rpl/r/rpl_conditional_comments.result
index 5668322d4aa..044f31427be 100644
--- a/mysql-test/suite/rpl/r/rpl_conditional_comments.result
+++ b/mysql-test/suite/rpl/r/rpl_conditional_comments.result
@@ -16,18 +16,22 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; /* 999999 --- */INSERT /*!INTO*/ /*!10000 t1 */ VALUES(10) /* 999999 ,(11)*/
master-bin.000001 # Query # # COMMIT
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
# Case 2:
# -----------------------------------------------------------------
# Verify whether it can be binlogged correctly when executing prepared
# statement.
+connection master;
PREPARE stmt FROM 'INSERT INTO /*!999999 blabla*/ t1 VALUES(60) /*!999999 ,(61)*/';
EXECUTE stmt;
DROP TABLE t1;
CREATE TABLE t1(c1 INT);
EXECUTE stmt;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
SET @value=62;
PREPARE stmt FROM 'INSERT INTO /*!999999 blabla */ t1 VALUES(?) /*!999999 ,(63)*/';
@@ -57,12 +61,14 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE t1(c1 INT)
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO /* 999999 blabla */ t1 VALUES(62) /* 999999 ,(63)*/
master-bin.000001 # Query # # COMMIT
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
# Case 3:
# -----------------------------------------------------------------
# Verify it can restore the '!', if the it is an uncomplete conditional
# comments
+connection master;
SELECT c1 FROM /*!999999 t1 WHEREN;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '/*!999999 t1 WHEREN' at line 1
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_connection.result b/mysql-test/suite/rpl/r/rpl_connection.result
index 02a7a36278e..b5ce7f4ed71 100644
--- a/mysql-test/suite/rpl/r/rpl_connection.result
+++ b/mysql-test/suite/rpl/r/rpl_connection.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
call mtr.add_suppression(".*Invalid .* username when attempting to connect to the master server.*");
include/stop_slave.inc
CHANGE MASTER TO MASTER_USER= '', MASTER_PASSWORD= '';
diff --git a/mysql-test/suite/rpl/r/rpl_corruption.result b/mysql-test/suite/rpl/r/rpl_corruption.result
index 51c2c6261b8..14a67b3a3a5 100644
--- a/mysql-test/suite/rpl/r/rpl_corruption.result
+++ b/mysql-test/suite/rpl/r/rpl_corruption.result
@@ -8,6 +8,7 @@ call mtr.add_suppression('Event crc check failed! Most likely there is event cor
call mtr.add_suppression('Slave SQL: Error initializing relay log position: I/O error reading event at position .*, error.* 1593');
SET @old_master_verify_checksum = @@master_verify_checksum;
# 1. Creating test table/data and set corruption position for testing
+connection master;
* insert/update/delete rows in table t1 *
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b VARCHAR(10), c VARCHAR(100));
include/stop_slave.inc
@@ -18,18 +19,24 @@ ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Wrong offset or I/
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
# 3. Master read a corrupted event from binlog and send the error to slave
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
+connection slave;
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1236]
+connection master;
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
# 4. Master read a corrupted event from binlog and send it to slave
+connection master;
SET GLOBAL master_verify_checksum=0;
SET GLOBAL debug_dbug="+d,corrupt_read_log_event2_set";
+connection slave;
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1913]
+connection master;
SET GLOBAL debug_dbug="-d,corrupt_read_log_event2_set";
SET GLOBAL debug_dbug= "";
SET GLOBAL master_verify_checksum=1;
# 5. Slave. Corruption in network
+connection slave;
SET GLOBAL debug_dbug="+d,corrupt_queue_event";
START SLAVE IO_THREAD;
include/wait_for_slave_io_error.inc [errno=1595,1913]
@@ -41,11 +48,16 @@ include/wait_for_slave_sql_error.inc [errno=1593]
SET GLOBAL debug_dbug="-d,corrupt_read_log_event_char";
SET GLOBAL debug_dbug= "";
# 7. Seek diff for tables on master and slave
+connection slave;
include/start_slave.inc
+connection master;
+connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
# 8. Clean up
+connection master;
SET GLOBAL debug_dbug= "";
SET GLOBAL master_verify_checksum = @old_master_verify_checksum;
DROP TABLE t1;
+connection slave;
SET GLOBAL debug_dbug= "";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_database.result b/mysql-test/suite/rpl/r/rpl_create_database.result
index 6bb950483ed..28c11525d00 100644
--- a/mysql-test/suite/rpl/r/rpl_create_database.result
+++ b/mysql-test/suite/rpl/r/rpl_create_database.result
@@ -3,7 +3,9 @@ include/master-slave.inc
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
+connection slave;
DROP DATABASE IF EXISTS mysqltest_bob;
+connection master;
CREATE DATABASE mysqltest_prometheus;
CREATE DATABASE mysqltest_sisyfos;
CREATE DATABASE mysqltest_bob;
@@ -22,11 +24,13 @@ mysql
mysqltest_bob
mysqltest_prometheus
mysqltest_sisyfos
+connection slave;
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
mysqltest_prometheus
mysqltest_sisyfos
+connection master;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
USE mysqltest_prometheus;
CREATE TABLE t1 (a INT);
@@ -40,6 +44,7 @@ mysql
mysqltest_bob
mysqltest_prometheus
mysqltest_sisyfos
+connection slave;
SHOW DATABASES LIKE 'mysql%';
Database (mysql%)
mysql
@@ -53,7 +58,9 @@ USE mysqltest_sisyfos;
SHOW TABLES;
Tables_in_mysqltest_sisyfos
t2
+connection master;
DROP DATABASE IF EXISTS mysqltest_prometheus;
DROP DATABASE IF EXISTS mysqltest_sisyfos;
DROP DATABASE IF EXISTS mysqltest_bob;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_db.result b/mysql-test/suite/rpl/r/rpl_create_drop_db.result
index b6fb6f127c8..862afdd7011 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_db.result
@@ -1,28 +1,34 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE DATABASE db1;
CREATE DATABASE IF NOT EXISTS db1;
Warnings:
Note 1007 Can't create database 'db1'; database exists
CREATE OR REPLACE DATABASE db2;
CREATE OR REPLACE DATABASE db1;
+connection slave;
SHOW DATABASES LIKE 'db%';
Database (db%)
db1
db2
+connection master;
CREATE DATABASE db1;
ERROR HY000: Can't create database 'db1'; database exists
DROP DATABASE db3;
ERROR HY000: Can't drop database 'db3'; database doesn't exist
CREATE DATABASE IF NOT EXISTS db3;
+connection slave;
SHOW DATABASES LIKE 'db%';
Database (db%)
db1
db2
db3
+connection master;
DROP DATABASE db1;
DROP DATABASE db2;
DROP DATABASE IF EXISTS db3;
+connection slave;
SHOW DATABASES LIKE 'db%';
Database (db%)
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_event.result b/mysql-test/suite/rpl/r/rpl_create_drop_event.result
index 2f477b1976e..250e7894c78 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_event.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_event.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
SET GLOBAL event_scheduler=off;
CREATE TABLE t1 (a INT);
CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND DO INSERT INTO t1 VALUES (10);
@@ -16,9 +17,12 @@ a
11
DELETE FROM t1;
# Syncing slave with master
+connection slave;
SELECT EVENT_NAME,STATUS,EVENT_DEFINITION FROM INFORMATION_SCHEMA.EVENTS;
EVENT_NAME STATUS EVENT_DEFINITION
ev1 SLAVESIDE_DISABLED INSERT INTO t1 VALUES (11)
+connection master;
DROP TABLE t1;
DROP EVENT ev1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_function.result b/mysql-test/suite/rpl/r/rpl_create_drop_function.result
index fc10d1f7c25..744e747134d 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_function.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_function.result
@@ -1,16 +1,19 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
CREATE FUNCTION hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
ERROR 42000: FUNCTION hello already exists
+connection slave;
SHOW CREATE FUNCTION hello;
Function sql_mode Create Function character_set_client collation_connection Database Collation
hello NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`root`@`localhost` FUNCTION `hello`(str CHAR(20)) RETURNS char(50) CHARSET latin1
DETERMINISTIC
RETURN
CONCAT('Hello, ', str, '!') latin1 latin1_swedish_ci latin1_swedish_ci
+connection master;
CREATE OR REPLACE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
@@ -19,9 +22,11 @@ CONCAT('Hello, ', str, '!');
SELECT hello('master');
hello('master')
Hello, master!
+connection slave;
SELECT hello('slave');
hello('slave')
Hello, slave!
+connection master;
CREATE FUNCTION IF NOT EXISTS hello (str CHAR(20)) RETURNS CHAR(50) DETERMINISTIC RETURN
CONCAT('Hello, ', str, '!');
Warnings:
@@ -34,14 +39,17 @@ Hello, master!
SELECT bye('master');
bye('master')
Bye, master!
+connection slave;
SELECT hello('slave');
hello('slave')
Hello, slave!
SELECT bye('slave');
bye('slave')
Bye, slave!
+connection master;
DROP FUNCTION hello;
DROP FUNCTION IF EXISTS bye;
+connection slave;
DROP FUNCTION hello;
ERROR 42000: FUNCTION test.hello does not exist
DROP FUNCTION IF EXISTS bye;
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_index.result b/mysql-test/suite/rpl/r/rpl_create_drop_index.result
index 1126c7eb701..f0d5bdf46b9 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_index.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_index.result
@@ -1,9 +1,10 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1 (a INT, b INT);
CREATE INDEX i1 ON t1 (a);
CREATE OR REPLACE INDEX i1 ON t1 (a, b);
-# On slave:
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -11,7 +12,7 @@ t1 CREATE TABLE `t1` (
`b` int(11) DEFAULT NULL,
KEY `i1` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-# On master:
+connection master;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -20,4 +21,5 @@ t1 CREATE TABLE `t1` (
KEY `i1` (`a`,`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result b/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result
index 5fc7d582cb0..d55ba04293a 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_procedure.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1 (id INT);
CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
CALL proc1(@cnt);
@@ -12,10 +13,12 @@ SELECT @cnt;
@cnt
3
# Syncing with slave
+connection slave;
CALL proc1(@cnt);
SELECT @cnt;
@cnt
3
+connection master;
CREATE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
ERROR 42000: PROCEDURE proc1 already exists
CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
@@ -25,10 +28,12 @@ CREATE OR REPLACE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
# Syncing with slave
+connection slave;
CALL proc1(@cnt);
SELECT @cnt;
@cnt
3
+connection master;
DROP PROCEDURE proc1;
CREATE PROCEDURE IF NOT EXISTS proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
INSERT INTO t1 VALUES (1), (2), (3);
@@ -37,10 +42,12 @@ SELECT @cnt;
@cnt
6
# Syncing with slave
+connection slave;
CALL proc1(@cnt);
SELECT @cnt;
@cnt
6
+connection master;
DROP PROCEDURE proc1;
CREATE OR REPLACE PROCEDURE proc1 (OUT cnt INT) BEGIN SELECT COUNT(*) INTO cnt FROM t1; END$$
INSERT INTO t1 VALUES (1), (2), (3);
@@ -49,16 +56,19 @@ SELECT @cnt;
@cnt
9
# Syncing with slave
+connection slave;
CALL proc1(@cnt);
SELECT @cnt;
@cnt
9
+connection master;
DROP TABLE IF EXISTS t1;
DROP PROCEDURE proc1;
DROP PROCEDURE IF EXISTS proc2;
Warnings:
Note 1305 PROCEDURE test.proc2 does not exist
# Syncing with slave
+connection slave;
DROP PROCEDURE proc1;
ERROR 42000: PROCEDURE test.proc1 does not exist
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_role.result b/mysql-test/suite/rpl/r/rpl_create_drop_role.result
index 84c9b9a7110..7a733614012 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_role.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_role.result
@@ -1,33 +1,42 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE ROLE role_1;
+connection slave;
SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
User
role_1
+connection master;
CREATE ROLE IF NOT EXISTS role_1;
Warnings:
Note 1975 Can't create role 'role_1'; it already exists
CREATE ROLE IF NOT EXISTS role_2;
+connection slave;
SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
User
role_1
role_2
+connection master;
CREATE OR REPLACE ROLE IF NOT EXISTS role_3;
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
CREATE OR REPLACE ROLE role_3;
CREATE OR REPLACE ROLE role_2;
+connection slave;
SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
User
role_1
role_2
role_3
+connection master;
CREATE ROLE role_2;
ERROR HY000: Operation CREATE ROLE failed for 'role_2'
+connection slave;
SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
User
role_1
role_2
role_3
+connection master;
DROP ROLE role_1;
DROP ROLE IF EXISTS role_2;
DROP ROLE IF EXISTS role_3;
@@ -36,6 +45,7 @@ Warnings:
Note 1976 Can't drop role 'role_4'; it doesn't exist
DROP ROLE role_4;
ERROR HY000: Operation DROP ROLE failed for 'role_4'
+connection slave;
SELECT User FROM mysql.user WHERE is_role='Y' ORDER BY User;
User
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result b/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
index 8cb80613af8..76024d1fd74 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_trigger.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
# Part 1 - initial creation
+connection master;
CREATE DATABASE db1;
USE db1;
CREATE TABLE t1 (val INT);
@@ -10,28 +11,34 @@ INSERT INTO t1 VALUES (10), (20), (30);
SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
ACTION_STATEMENT_Master
SET @sum = @sum + NEW.val + 1
+connection slave;
SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
ACTION_STATEMENT_Slave
SET @sum = @sum + NEW.val + 1
# Part 2 - CREATE IF NOT EXISTS (on a existing trigger)
+connection master;
CREATE TRIGGER IF NOT EXISTS val_sum AFTER INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 2;
Warnings:
Note 1359 Trigger already exists
SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
ACTION_STATEMENT_Master
SET @sum = @sum + NEW.val + 1
+connection slave;
SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
ACTION_STATEMENT_Slave
SET @sum = @sum + NEW.val + 1
# Part 3 - CREATE OR REPLACE (on a existing trigger)
+connection master;
CREATE OR REPLACE TRIGGER val_sum BEFORE INSERT ON t1 FOR EACH ROW SET @sum = @sum + NEW.val + 3;
SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Master FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
ACTION_STATEMENT_Master
SET @sum = @sum + NEW.val + 3
+connection slave;
SELECT ACTION_STATEMENT AS ACTION_STATEMENT_Slave FROM INFORMATION_SCHEMA.TRIGGERS WHERE TRIGGER_NAME='val_sum';
ACTION_STATEMENT_Slave
SET @sum = @sum + NEW.val + 3
# Clearing up
+connection master;
DROP TRIGGER val_sum;
DROP TABLE t1;
DROP TRIGGER IF EXISTS val_sum;
@@ -43,6 +50,7 @@ DROP DATABASE db1;
DROP TRIGGER IF EXISTS val_sum;
ERROR 3D000: No database selected
# Syncing slave with master
+connection slave;
DROP TRIGGER val_sum;
ERROR HY000: Trigger does not exist
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_udf.result b/mysql-test/suite/rpl/r/rpl_create_drop_udf.result
index c7089c0ec5b..c0e1c374417 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_udf.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_udf.result
@@ -1,14 +1,17 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
SELECT metaphon('master');
metaphon('master')
MSTR
CREATE FUNCTION metaphon RETURNS INT SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Function 'metaphon' already exists
+connection slave;
SELECT metaphon('slave');
metaphon('slave')
SLF
+connection master;
CREATE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
Warnings:
Note 1125 Function 'metaphon' already exists
@@ -20,20 +23,25 @@ Warnings:
Note 1125 Function 'metaphon' already exists
CREATE OR REPLACE FUNCTION IF NOT EXISTS metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
+connection slave;
SELECT metaphon('slave');
metaphon('slave')
SLF
+connection master;
DROP FUNCTION metaphon;
CREATE OR REPLACE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
CREATE FUNCTION metaphon RETURNS STRING SONAME "UDF_EXAMPLE_LIB";
ERROR HY000: Function 'metaphon' already exists
+connection slave;
SELECT metaphon('slave');
metaphon('slave')
SLF
+connection master;
DROP FUNCTION metaphon;
DROP FUNCTION IF EXISTS metaphon;
Warnings:
Note 1305 FUNCTION test.metaphon does not exist
+connection slave;
DROP FUNCTION metaphon;
ERROR 42000: FUNCTION test.metaphon does not exist
DROP FUNCTION IF EXISTS metaphon;
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_user.result b/mysql-test/suite/rpl/r/rpl_create_drop_user.result
index c55c522852c..f8cc271e8cf 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_user.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_user.result
@@ -1,46 +1,66 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE USER u1@localhost IDENTIFIED BY 'abcdefghijk';
+connect user_a, localhost, u1,'abcdefghijk',;
+connection user_a;
SELECT CURRENT_USER;
CURRENT_USER
u1@localhost
+disconnect user_a;
+connection master;
CREATE USER IF NOT EXISTS u2@localhost;
+connect user_a, localhost, u2,,;
+connection user_a;
SELECT CURRENT_USER;
CURRENT_USER
u2@localhost
+disconnect user_a;
+connection master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
user password
u1 *D9553C4CE316A9845CE49E30A2D7E3857AF966C4
u2
+connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
user password
u1 *D9553C4CE316A9845CE49E30A2D7E3857AF966C4
u2
+connection master;
CREATE OR REPLACE USER u1@localhost IDENTIFIED BY 'abcdefghijk2';
+connect user_a, localhost, u1,'abcdefghijk2',;
+connection user_a;
SELECT CURRENT_USER;
CURRENT_USER
u1@localhost
+disconnect user_a;
+connection master;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
user password
u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
u2
+connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
user password
u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
u2
+connection master;
CREATE USER u1@localhost;
ERROR HY000: Operation CREATE USER failed for 'u1'@'localhost'
DROP USER u3@localhost;
ERROR HY000: Operation DROP USER failed for 'u3'@'localhost'
+connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
user password
u1 *A9A5EF53CE2EFAA6F4A746D63A917B2370971A7E
u2
+connection master;
DROP USER IF EXISTS u1@localhost;
DROP USER u2@localhost;
DROP USER IF EXISTS u3@localhost;
Warnings:
Note 1974 Can't drop user 'u3'@'localhost'; it doesn't exist
+connection slave;
SELECT user, password FROM mysql.user WHERE user LIKE 'u%' ORDER BY user;
user password
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_drop_view.result b/mysql-test/suite/rpl/r/rpl_create_drop_view.result
index 85731210ae8..fef1edb2018 100644
--- a/mysql-test/suite/rpl/r/rpl_create_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_create_drop_view.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1(id INT);
CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
INSERT INTO t1 VALUES (5), (8), (10), (20), (30);
@@ -15,6 +16,7 @@ id
20
30
# Syncing slave with master
+connection slave;
SELECT * FROM t1;
id
5
@@ -26,6 +28,7 @@ SELECT * FROM v1;
id
20
30
+connection master;
CREATE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
ERROR 42S01: Table 'v1' already exists
CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
@@ -34,6 +37,7 @@ Note 1050 Table 'v1' already exists
CREATE OR REPLACE VIEW IF NOT EXISTS v1 AS SELECT * FROM t1 WHERE id>10;
ERROR HY000: Incorrect usage of OR REPLACE and IF NOT EXISTS
# Syncing slave with master
+connection slave;
SELECT * FROM t1;
id
5
@@ -45,6 +49,7 @@ SELECT * FROM v1;
id
20
30
+connection master;
CREATE OR REPLACE VIEW v1 AS SELECT * FROM t1 WHERE id>10;
INSERT INTO t1 VALUES (50), (80), (3), (2), (40);
SELECT * FROM t1;
@@ -67,6 +72,7 @@ id
80
40
# Syncing slave with master
+connection slave;
SELECT * FROM t1;
id
5
@@ -86,6 +92,7 @@ id
50
80
40
+connection master;
DROP VIEW v1;
DROP TABLE t1;
DROP VIEW v1;
@@ -94,6 +101,7 @@ DROP VIEW IF EXISTS v2;
Warnings:
Note 1051 Unknown table 'test.v2'
# Syncing slave with master
+connection slave;
SELECT * FROM v1;
ERROR 42S02: Table 'test.v1' doesn't exist
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result b/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
index 14f81fcb9b1..d74fd07189c 100644
--- a/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
+++ b/mysql-test/suite/rpl/r/rpl_create_if_not_exists.result
@@ -9,7 +9,10 @@ CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t;
CREATE EVENT IF NOT EXISTS e
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT now();
+connection slave;
+connection slave;
DROP DATABASE mysqltest;
+connection master;
CREATE DATABASE IF NOT EXISTS mysqltest;
USE mysqltest;
CREATE TABLE IF NOT EXISTS t(c1 int);
@@ -18,6 +21,8 @@ CREATE TABLE IF NOT EXISTS t2 SELECT * FROM t;
CREATE EVENT IF NOT EXISTS e
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 HOUR
DO SELECT now();
+connection slave;
+connection slave;
SHOW TABLES in mysqltest;
Tables_in_mysqltest
t
@@ -25,8 +30,10 @@ t1
SHOW EVENTS in mysqltest;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
mysqltest e root@localhost SYSTEM ONE TIME # NULL NULL NULL NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
+connection master;
DROP DATABASE IF EXISTS mysqltest;
-------------BUG#47418-------------
+connection master;
USE test;
DROP TABLE IF EXISTS t3;
CREATE TABLE t3(c1 INTEGER);
@@ -43,12 +50,14 @@ c1
SELECT * FROM t2;
c1
1
+connection slave;
SELECT * FROM t1;
c1
33
SELECT * FROM t2;
c1
33
+connection master;
DROP TEMPORARY TABLE t1;
DROP TEMPORARY TABLE t2;
SELECT * FROM t1;
@@ -68,6 +77,7 @@ DROP TABLE t3;
include/rpl_reset.inc
# Case 1: BUG#47132
+connection master;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.*");
CREATE TABLE t1 (id int);
CREATE TABLE t2 (id int);
@@ -112,6 +122,8 @@ CREATE TABLE IF NOT EXISTS v1 SELECT 2 as a;
Warnings:
Note 1050 Table 'v1' already exists
include/show_binlog_events.inc
+connection slave;
+connection master;
DROP VIEW v1;
DROP TABLE t1, t2;
#
@@ -128,4 +140,6 @@ Warnings:
Note 1050 Table 't2' already exists
# Clean-up.
DROP TABLE t1, t2;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_cross_version.result b/mysql-test/suite/rpl/r/rpl_cross_version.result
index ddb97ffa8c5..b94b02a24ff 100644
--- a/mysql-test/suite/rpl/r/rpl_cross_version.result
+++ b/mysql-test/suite/rpl/r/rpl_cross_version.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialize ====
+connection slave;
include/stop_slave.inc
RESET SLAVE;
include/setup_fake_relay_log.inc
diff --git a/mysql-test/suite/rpl/r/rpl_current_user.result b/mysql-test/suite/rpl/r/rpl_current_user.result
index 3391af5de9c..93a84cf38be 100644
--- a/mysql-test/suite/rpl/r/rpl_current_user.result
+++ b/mysql-test/suite/rpl/r/rpl_current_user.result
@@ -1,6 +1,7 @@
include/rpl_init.inc [topology=1->2->3]
include/rpl_connect.inc [creating master]
include/rpl_connect.inc [creating slave]
+connection master;
CREATE TABLE t1(c1 char(100));
CREATE VIEW test.v_user AS SELECT * FROM mysql.user WHERE User LIKE 'bug48321%';
CREATE VIEW test.v_tables_priv AS SELECT * FROM mysql.tables_priv WHERE User LIKE 'bug48321%';
@@ -20,7 +21,8 @@ GRANT CREATE USER ON *.* TO 'fakename'@'0123456789012345678901234567890123456789
ERROR HY000: String '0123456789012345678901234567890123456789012345678901234567890' is too long for host name (should be no longer than 60)
# User 'bug48321_1-01234' connects to master by conn1
-# [On conn1]
+connect conn1, 127.0.0.1, 'bug48321_1-01234'@'localhost',,;
+connection conn1;
# Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
include/rpl_sync.inc
@@ -74,14 +76,19 @@ include/diff_tables.inc [server_1:v_tables_priv, server_2:v_tables_priv, server_
RENAME USER CURRENT_USER TO 'bug48321_2'@'localhost';
include/rpl_sync.inc
include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
+disconnect conn1;
# Verify 'DROP USER ...' statement
+connection master;
GRANT CREATE USER ON *.* TO 'bug48321_2'@'localhost';
+connect conn1, 127.0.0.1, 'bug48321_2'@'localhost',,;
+connection conn1;
DROP USER CURRENT_USER();
include/rpl_sync.inc
include/diff_tables.inc [server_1:v_user, server_2:v_user, server_3:v_user]
# Verify 'ALTER EVENT...' statement
+connection master;
CREATE EVENT e1 ON SCHEDULE EVERY 1 DAY DO SELECT * FROM t1;
# Explicitly assign CURRENT_USER() to definer
ALTER DEFINER=CURRENT_USER() EVENT e1 ENABLE;
@@ -96,7 +103,7 @@ include/diff_tables.inc [server_1:v_event, server_2:v_event, server_3:v_event]
# Verify that this patch does not affect the calling of CURRENT_USER()
# in the other statements
-# [On master]
+connection master;
INSERT INTO t1 VALUES(CURRENT_USER()), ('1234');
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
@@ -104,17 +111,17 @@ SELECT * FROM t1;
c1
root@localhost
1234
-# [On slave]
+connection slave;
SELECT * FROM t1;
c1
@
1234
-# [On server_3]
+connection server_3;
SELECT * FROM t1;
c1
@
1234
-# [On master]
+connection master;
UPDATE t1 SET c1=CURRENT_USER() WHERE c1='1234';
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
@@ -122,29 +129,29 @@ SELECT * FROM t1;
c1
root@localhost
root@localhost
-# [On slave]
+connection slave;
SELECT * FROM t1;
c1
@
@
-# [On server_3]
+connection server_3;
SELECT * FROM t1;
c1
@
@
-# [On master]
+connection master;
DELETE FROM t1 WHERE c1=CURRENT_USER();
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
SELECT * FROM t1;
c1
-# [On slave]
+connection slave;
SELECT * FROM t1;
c1
-# [On server_3]
+connection server_3;
SELECT * FROM t1;
c1
-# [On master]
+connection master;
CREATE TABLE t2(c1 char(100));
CREATE FUNCTION my_user() RETURNS VARCHAR(64)
SQL SECURITY INVOKER
@@ -161,14 +168,14 @@ root@localhost
SELECT * FROM t2;
c1
root@localhost
-# [On slave]
+connection slave;
SELECT * FROM t1;
c1
@
SELECT * FROM t2;
c1
@
-# [On server_3]
+connection server_3;
SELECT * FROM t1;
c1
@
@@ -177,6 +184,7 @@ c1
@
# END
+connection master;
DROP TABLE t1, t2;
DROP VIEW v_user, v_tables_priv, v_procs_priv, v_event;
DROP PROCEDURE p1;
diff --git a/mysql-test/suite/rpl/r/rpl_ddl.result b/mysql-test/suite/rpl/r/rpl_ddl.result
index df246cc547f..7bb9bd02cba 100644
--- a/mysql-test/suite/rpl/r/rpl_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_ddl.result
@@ -2,12 +2,15 @@ include/master-slave.inc
[connection master]
set global sql_mode='';
set local sql_mode='';
-
--------- switch to master -------
+connection slave;
+connection master;
SET AUTOCOMMIT = 1;
CREATE DATABASE mysqltest1;
CREATE DATABASE mysqltest2;
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE=InnoDB;
+connection slave;
+connection slave;
+connection master;
INSERT INTO mysqltest1.t1 SET f1= 0;
CREATE TABLE mysqltest1.t2 (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t3 (f1 BIGINT) ENGINE=InnoDB;
@@ -32,1046 +35,936 @@ CREATE TABLE mysqltest1.t19 (f1 BIGINT) ENGINE=InnoDB;
CREATE TEMPORARY TABLE mysqltest1.t23 (f1 BIGINT) ENGINE=MEMORY;
SET AUTOCOMMIT = 0;
use mysqltest1;
-
--------- switch to slave --------
+connection slave;
+connection slave;
SET AUTOCOMMIT = 1;
use mysqltest1;
-
--------- switch to master -------
+connection master;
######## SELECT 1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-
--------- switch to master -------
+connection master;
SELECT 1;
1
1
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## SELECT COUNT(*) FROM t1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-
--------- switch to master -------
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
2
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## COMMIT ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 0 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
0
-
--------- switch to master -------
+connection master;
COMMIT;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## ROLLBACK ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 1 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## SET AUTOCOMMIT=1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 1 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
1
-
--------- switch to master -------
+connection master;
SET AUTOCOMMIT=1;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SET AUTOCOMMIT=0;
######## START TRANSACTION ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 2 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
3
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
2
-
--------- switch to master -------
+connection master;
START TRANSACTION;
SELECT MAX(f1) FROM t1;
MAX(f1)
3
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
3
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
3
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
3
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## BEGIN ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 3 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
4
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
3
-
--------- switch to master -------
+connection master;
BEGIN;
SELECT MAX(f1) FROM t1;
MAX(f1)
4
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
4
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
4
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
4
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## DROP TABLE mysqltest1.t2 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 4 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
4
-
--------- switch to master -------
+connection master;
DROP TABLE mysqltest1.t2;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW TABLES LIKE 't2';
Tables_in_mysqltest1 (t2)
-
--------- switch to slave --------
+connection slave;
SHOW TABLES LIKE 't2';
Tables_in_mysqltest1 (t2)
-
--------- switch to master -------
+connection master;
######## DROP TEMPORARY TABLE mysqltest1.t23 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 5 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
-
--------- switch to master -------
+connection master;
DROP TEMPORARY TABLE mysqltest1.t23;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
5
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
TEST-INFO: SLAVE: The INSERT is committed (Failed)
-
--------- switch to master -------
+connection master;
SHOW TABLES LIKE 't23';
Tables_in_mysqltest1 (t23)
-
--------- switch to slave --------
+connection slave;
SHOW TABLES LIKE 't23';
Tables_in_mysqltest1 (t23)
-
--------- switch to master -------
+connection master;
######## RENAME TABLE mysqltest1.t3 to mysqltest1.t20 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 5 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to master -------
+connection master;
RENAME TABLE mysqltest1.t3 to mysqltest1.t20;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW TABLES LIKE 't20';
Tables_in_mysqltest1 (t20)
t20
-
--------- switch to slave --------
+connection slave;
SHOW TABLES LIKE 't20';
Tables_in_mysqltest1 (t20)
t20
-
--------- switch to master -------
+connection master;
######## ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 6 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
7
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
6
-
--------- switch to master -------
+connection master;
ALTER TABLE mysqltest1.t4 ADD column f2 BIGINT;
SELECT MAX(f1) FROM t1;
MAX(f1)
7
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
7
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
7
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
7
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
describe mysqltest1.t4;
Field Type Null Key Default Extra
f1 bigint(20) YES NULL
f2 bigint(20) YES NULL
-
--------- switch to slave --------
+connection slave;
describe mysqltest1.t4;
Field Type Null Key Default Extra
f1 bigint(20) YES NULL
f2 bigint(20) YES NULL
-
--------- switch to master -------
+connection master;
######## CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= InnoDB ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 7 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
7
-
--------- switch to master -------
+connection master;
CREATE TABLE mysqltest1.t21 (f1 BIGINT) ENGINE= InnoDB;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 8 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
-
--------- switch to master -------
+connection master;
CREATE TEMPORARY TABLE mysqltest1.t22 (f1 BIGINT) ENGINE=MEMORY;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
8
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
TEST-INFO: SLAVE: The INSERT is committed (Failed)
-
--------- switch to master -------
+connection master;
######## TRUNCATE TABLE mysqltest1.t7 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 8 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to master -------
+connection master;
TRUNCATE TABLE mysqltest1.t7;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SELECT * FROM mysqltest1.t7;
f1
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT * FROM mysqltest1.t7;
f1
-
--------- switch to master -------
+connection master;
######## LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 9 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
9
-
--------- switch to master -------
+connection master;
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
UNLOCK TABLES;
######## UNLOCK TABLES ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 10 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to master -------
+connection master;
UNLOCK TABLES;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
+connection master;
LOCK TABLES mysqltest1.t1 READ;
######## UNLOCK TABLES ########
-
--------- switch to master -------
+connection 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 --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to master -------
+connection master;
UNLOCK TABLES;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
TEST-INFO: MASTER: The INSERT is not committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
TEST-INFO: SLAVE: The INSERT is not committed (Succeeded)
-
--------- switch to master -------
+connection master;
LOCK TABLES mysqltest1.t1 WRITE, mysqltest1.t8 READ;
######## UNLOCK TABLES ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 10 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
10
-
--------- switch to master -------
+connection master;
UNLOCK TABLES;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
######## DROP INDEX my_idx6 ON mysqltest1.t6 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 11 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
12
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
11
-
--------- switch to master -------
+connection master;
DROP INDEX my_idx6 ON mysqltest1.t6;
SELECT MAX(f1) FROM t1;
MAX(f1)
12
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
12
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
12
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
12
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection 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 Index_comment
-
--------- switch to slave --------
+connection 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 Index_comment
-
--------- switch to master -------
+connection master;
######## CREATE INDEX my_idx5 ON mysqltest1.t5(f1) ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 12 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
13
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
12
-
--------- switch to master -------
+connection master;
CREATE INDEX my_idx5 ON mysqltest1.t5(f1);
SELECT MAX(f1) FROM t1;
MAX(f1)
13
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
13
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
13
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
13
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection 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 Index_comment
t5 1 my_idx5 1 f1 A 0 NULL NULL YES BTREE
-
--------- switch to slave --------
+connection 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 Index_comment
t5 1 my_idx5 1 f1 A NULL NULL NULL YES BTREE
-
--------- switch to master -------
+connection master;
######## DROP DATABASE mysqltest2 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 13 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
14
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
13
-
--------- switch to master -------
+connection master;
DROP DATABASE mysqltest2;
SELECT MAX(f1) FROM t1;
MAX(f1)
14
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
14
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
14
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
14
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW DATABASES LIKE "mysqltest2";
Database (mysqltest2)
-
--------- switch to slave --------
+connection slave;
SHOW DATABASES LIKE "mysqltest2";
Database (mysqltest2)
-
--------- switch to master -------
+connection master;
######## CREATE DATABASE mysqltest3 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 14 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
15
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
14
-
--------- switch to master -------
+connection master;
CREATE DATABASE mysqltest3;
SELECT MAX(f1) FROM t1;
MAX(f1)
15
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
15
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
15
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
15
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW DATABASES LIKE "mysqltest3";
Database (mysqltest3)
mysqltest3
-
--------- switch to slave --------
+connection slave;
SHOW DATABASES LIKE "mysqltest3";
Database (mysqltest3)
mysqltest3
-
--------- switch to master -------
+connection master;
######## CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1" ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 15 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
15
-
--------- switch to master -------
+connection master;
CREATE PROCEDURE p1() READS SQL DATA SELECT "this is p1";
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
@@ -1084,8 +977,7 @@ Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
-
--------- switch to slave --------
+connection slave;
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
@@ -1098,49 +990,44 @@ Comment
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
-
--------- switch to master -------
+connection master;
######## ALTER PROCEDURE p1 COMMENT "I have been altered" ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 16 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
16
-
--------- switch to master -------
+connection master;
ALTER PROCEDURE p1 COMMENT "I have been altered";
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
@@ -1153,8 +1040,7 @@ Comment I have been altered
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
-
--------- switch to slave --------
+connection slave;
SHOW PROCEDURE STATUS LIKE 'p1';
Db mysqltest1
Name p1
@@ -1167,458 +1053,403 @@ Comment I have been altered
character_set_client latin1
collation_connection latin1_swedish_ci
Database Collation latin1_swedish_ci
-
--------- switch to master -------
+connection master;
######## DROP PROCEDURE p1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 17 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
17
-
--------- switch to master -------
+connection master;
DROP PROCEDURE p1;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW PROCEDURE STATUS LIKE 'p1';
-
--------- switch to slave --------
+connection slave;
SHOW PROCEDURE STATUS LIKE 'p1';
-
--------- switch to master -------
+connection master;
######## CREATE OR REPLACE VIEW v1 as select * from t1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 18 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
19
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
18
-
--------- switch to master -------
+connection master;
CREATE OR REPLACE VIEW v1 as select * from t1;
SELECT MAX(f1) FROM t1;
MAX(f1)
19
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
19
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
19
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
19
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to slave --------
+connection slave;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to master -------
+connection master;
######## ALTER VIEW v1 AS select f1 from t1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 19 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
20
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
19
-
--------- switch to master -------
+connection master;
ALTER VIEW v1 AS select f1 from t1;
SELECT MAX(f1) FROM t1;
MAX(f1)
20
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
20
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
20
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
20
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to slave --------
+connection slave;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`f1` AS `f1` from `t1` latin1 latin1_swedish_ci
-
--------- switch to master -------
+connection master;
######## DROP VIEW IF EXISTS v1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 20 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
21
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
20
-
--------- switch to master -------
+connection master;
DROP VIEW IF EXISTS v1;
SELECT MAX(f1) FROM t1;
MAX(f1)
21
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
21
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
21
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
21
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW CREATE VIEW v1;
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-
--------- switch to slave --------
+connection slave;
SHOW CREATE VIEW v1;
ERROR 42S02: Table 'mysqltest1.v1' doesn't exist
-
--------- switch to master -------
+connection master;
######## CREATE TRIGGER trg1 BEFORE INSERT ON t1 FOR EACH ROW SET @a:=1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 21 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
22
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
21
-
--------- switch to master -------
+connection 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 --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
22
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
22
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
22
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-
--------- switch to slave --------
+connection slave;
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 SET @a:=1 BEFORE NULL root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-
--------- switch to master -------
+connection master;
######## DROP TRIGGER trg1 ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 22 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
23
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
22
-
--------- switch to master -------
+connection master;
DROP TRIGGER trg1;
SELECT MAX(f1) FROM t1;
MAX(f1)
23
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
23
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
23
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
23
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-
--------- switch to slave --------
+connection slave;
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-
--------- switch to master -------
+connection master;
######## CREATE USER user1@localhost ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 23 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
24
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
23
-
--------- switch to master -------
+connection master;
CREATE USER user1@localhost;
SELECT MAX(f1) FROM t1;
MAX(f1)
24
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
24
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
24
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
24
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SELECT user FROM mysql.user WHERE user = 'user1';
user
user1
-
--------- switch to slave --------
+connection slave;
SELECT user FROM mysql.user WHERE user = 'user1';
user
user1
-
--------- switch to master -------
+connection master;
######## RENAME USER user1@localhost TO rename1@localhost ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 24 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
25
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
24
-
--------- switch to master -------
+connection master;
RENAME USER user1@localhost TO rename1@localhost;
SELECT MAX(f1) FROM t1;
MAX(f1)
25
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
25
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
25
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
25
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SELECT user FROM mysql.user WHERE user = 'rename1';
user
rename1
-
--------- switch to slave --------
+connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1';
user
rename1
-
--------- switch to master -------
+connection master;
######## DROP USER rename1@localhost ########
-
--------- switch to master -------
+connection master;
INSERT INTO t1 SET f1= 25 + 1;
SELECT MAX(f1) FROM t1;
MAX(f1)
26
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
25
-
--------- switch to master -------
+connection master;
DROP USER rename1@localhost;
SELECT MAX(f1) FROM t1;
MAX(f1)
26
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
26
-
--------- switch to master -------
+connection master;
ROLLBACK;
SELECT MAX(f1) FROM t1;
MAX(f1)
26
TEST-INFO: MASTER: The INSERT is committed (Succeeded)
-
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT MAX(f1) FROM t1;
MAX(f1)
26
TEST-INFO: SLAVE: The INSERT is committed (Succeeded)
-
--------- switch to master -------
+connection master;
SELECT user FROM mysql.user WHERE user = 'rename1';
user
-
--------- switch to slave --------
+connection slave;
SELECT user FROM mysql.user WHERE user = 'rename1';
user
use test;
-
--------- switch to master -------
+connection master;
DROP TEMPORARY TABLE mysqltest1.t22;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest3;
diff --git a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
index f2128f8d855..1c9611ba8f0 100644
--- a/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_deadlock_innodb.result
@@ -1,9 +1,11 @@
include/master-slave.inc
[connection master]
*** Prepare tables and data ***
+connection master;
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
CREATE TABLE t2 (a INT) ENGINE=innodb;
CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=innodb;
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -25,6 +27,7 @@ SHOW VARIABLES LIKE 'slave_transaction_retries';
Variable_name Value
slave_transaction_retries 2
include/stop_slave.inc
+connection master;
BEGIN;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
@@ -32,6 +35,7 @@ INSERT INTO t3 VALUES (3);
COMMIT;
*** Test deadlock ***
+connection slave;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
@@ -49,6 +53,7 @@ a
include/check_slave_is_running.inc
*** Test lock wait timeout ***
+connection slave;
include/stop_slave.inc
DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>;
@@ -74,6 +79,7 @@ a
include/check_slave_is_running.inc
*** Test lock wait timeout and purged relay logs ***
+connection slave;
SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0;
Warnings:
@@ -106,7 +112,9 @@ a
include/check_slave_is_running.inc
*** Clean up ***
+connection master;
DROP TABLE t1,t2,t3;
+connection slave;
SET global max_relay_log_size= @my_max_relay_log_size;
End of 5.1 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_delete_no_where.result b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
index 923cd428aec..24f49c7c6b4 100644
--- a/mysql-test/suite/rpl/r/rpl_delete_no_where.result
+++ b/mysql-test/suite/rpl/r/rpl_delete_no_where.result
@@ -2,11 +2,16 @@ include/master-slave.inc
[connection master]
create table t1 (a int, b int) engine=myisam;
insert into t1 values(1,1);
+connection slave;
select * from t1;
a b
1 1
+connection master;
delete from t1;
+connection slave;
select * from t1;
a b
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_do_grant.result b/mysql-test/suite/rpl/r/rpl_do_grant.result
index a9f1d92cb42..67d1b51559b 100644
--- a/mysql-test/suite/rpl/r/rpl_do_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_do_grant.result
@@ -1,22 +1,29 @@
include/master-slave.inc
[connection master]
+connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
+connection slave;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+connection master;
create user rpl_do_grant@localhost;
grant select on *.* to rpl_do_grant@localhost;
grant drop on test.* to rpl_do_grant@localhost;
+connection slave;
show grants for rpl_do_grant@localhost;
Grants for rpl_do_grant@localhost
GRANT SELECT ON *.* TO 'rpl_do_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_do_grant'@'localhost'
+connection master;
set password for rpl_do_grant@localhost=password("does it work?");
+connection slave;
select password<>_binary'' from mysql.user where user=_binary'rpl_do_grant';
password<>_binary''
1
+connection master;
update mysql.user set password='' where user='rpl_do_grant';
flush privileges;
select password<>'' from mysql.user where user='rpl_do_grant';
@@ -25,77 +32,103 @@ password<>''
set sql_mode='ANSI_QUOTES';
set password for rpl_do_grant@localhost=password('does it work?');
set sql_mode='';
+connection slave;
select password<>'' from mysql.user where user='rpl_do_grant';
password<>''
1
+connection master;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
+connection slave;
delete from mysql.user where user=_binary'rpl_do_grant';
delete from mysql.db where user=_binary'rpl_do_grant';
flush privileges;
+connection master;
show grants for rpl_do_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
+connection slave;
show grants for rpl_do_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant' on host 'localhost'
+connection master;
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'
+connection slave;
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'
+connection master;
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'
+connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+connection master;
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'
+connection slave;
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'
+connection master;
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'
+connection slave;
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'
+connection master;
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'
+connection slave;
show grants for rpl_do_grant2@localhost;
Grants for rpl_do_grant2@localhost
GRANT USAGE ON *.* TO 'rpl_do_grant2'@'localhost'
+connection master;
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'
+connection slave;
show grants for rpl_do_grant2@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_do_grant2' on host 'localhost'
+connection master;
call mtr.add_suppression("Slave: Operation DROP USER failed for 'create_rout_db'@'localhost' error.* 1396");
+connection slave;
+connection master;
DROP DATABASE IF EXISTS bug42217_db;
CREATE DATABASE bug42217_db;
GRANT CREATE ROUTINE ON bug42217_db.* TO 'create_rout_db'@'localhost'
IDENTIFIED BY 'create_rout_db' WITH GRANT OPTION;
+connection slave;
+connection master;
+connect create_rout_db_master, localhost, create_rout_db, create_rout_db, bug42217_db,$MASTER_MYPORT,;
+connect create_rout_db_slave, localhost, create_rout_db, create_rout_db, bug42217_db, $SLAVE_MYPORT,;
+connection create_rout_db_master;
USE bug42217_db;
CREATE FUNCTION upgrade_del_func() RETURNS CHAR(30)
BEGIN
RETURN "INSIDE upgrade_del_func()";
END//
+connection master;
USE bug42217_db;
SELECT * FROM mysql.procs_priv;
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
@@ -103,6 +136,7 @@ localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@lo
SELECT upgrade_del_func();
upgrade_del_func()
INSIDE upgrade_del_func()
+connection slave;
SELECT * FROM mysql.procs_priv;
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
localhost bug42217_db create_rout_db upgrade_del_func FUNCTION create_rout_db@localhost Execute,Alter Routine #
@@ -122,6 +156,7 @@ SELECT upgrade_del_func();
upgrade_del_func()
INSIDE upgrade_del_func()
"Check whether the definer user will be able to execute the replicated routine on slave"
+connection create_rout_db_slave;
USE bug42217_db;
SHOW CREATE FUNCTION upgrade_del_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
@@ -132,6 +167,7 @@ END latin1 latin1_swedish_ci latin1_swedish_ci
SELECT upgrade_del_func();
upgrade_del_func()
INSIDE upgrade_del_func()
+connection slave;
DELETE FROM mysql.procs_priv;
FLUSH PRIVILEGES;
USE bug42217_db;
@@ -141,13 +177,16 @@ ERROR 42000: execute command denied to user 'create_rout_db'@'localhost' for rou
"Test the user who creates a function on master doesn't exist on slave."
"Hence SQL thread ACL_GLOBAL privilege jumps in and no mysql.procs_priv is inserted"
DROP USER 'create_rout_db'@'localhost';
+connection create_rout_db_master;
CREATE FUNCTION upgrade_alter_func() RETURNS CHAR(30)
BEGIN
RETURN "INSIDE upgrade_alter_func()";
END//
+connection master;
SELECT upgrade_alter_func();
upgrade_alter_func()
INSIDE upgrade_alter_func()
+connection slave;
SHOW CREATE FUNCTION upgrade_alter_func;
Function sql_mode Create Function character_set_client collation_connection Database Collation
upgrade_alter_func NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION CREATE DEFINER=`create_rout_db`@`localhost` FUNCTION `upgrade_alter_func`() RETURNS char(30) CHARSET latin1
@@ -159,10 +198,15 @@ SELECT * FROM mysql.procs_priv;
Host Db User Routine_name Routine_type Grantor Proc_priv Timestamp
SELECT upgrade_alter_func();
ERROR HY000: The user specified as a definer ('create_rout_db'@'localhost') does not exist
+disconnect create_rout_db_master;
+disconnect create_rout_db_slave;
+connection master;
USE bug42217_db;
DROP FUNCTION upgrade_del_func;
DROP FUNCTION upgrade_alter_func;
DROP DATABASE bug42217_db;
+connection slave;
+connection master;
SET SQL_LOG_BIN= 0;
DROP USER 'create_rout_db'@'localhost';
SET SQL_LOG_BIN= 1;
@@ -170,14 +214,20 @@ include/rpl_reset.inc
USE test;
######## BUG#49119 #######
### i) test case from the 'how to repeat section'
+connection master;
CREATE TABLE t1(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
REVOKE EXECUTE ON PROCEDURE p1 FROM 'root'@'localhost';
ERROR 42000: There is no such grant defined for user 'root' on host 'localhost' on routine 'p1'
+connection slave;
+connection master;
DROP TABLE t1;
DROP PROCEDURE p1;
+connection slave;
### ii) Test case in which REVOKE partially succeeds
+connection master;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1(c1 INT);
CREATE PROCEDURE p1() SELECT * FROM t1 |
CREATE USER 'user49119'@'localhost';
@@ -193,6 +243,7 @@ Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
+connection slave;
##############################################################
### Showing grants for both users: root and user49119 (master)
SHOW GRANTS FOR 'user49119'@'localhost';
@@ -204,6 +255,7 @@ Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
+connection master;
## This statement will make the revoke fail because root has no
## execute grant. However, it will still revoke the grant for
## user49119.
@@ -220,6 +272,7 @@ Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
+connection slave;
#############################################################
### Showing grants for both users: root and user49119 (slave)
### after revoke statement failure (should match
@@ -231,10 +284,13 @@ Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT PROXY ON ''@'%' TO 'root'@'localhost' WITH GRANT OPTION
##############################################################
+connection master;
DROP TABLE t1;
DROP PROCEDURE p1;
DROP USER 'user49119'@'localhost';
+connection slave;
include/rpl_reset.inc
+connection master;
grant all on *.* to foo@"1.2.3.4";
revoke all privileges, grant option from "foo";
ERROR HY000: Can't revoke all privileges for one or more of the requested users
@@ -244,24 +300,32 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; grant all on *.* to foo@"1.2.3.4"
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; revoke all privileges, grant option from "foo"
+connection slave;
include/check_slave_no_error.inc
+connection master;
DROP USER foo@"1.2.3.4";
+connection slave;
# Bug#27606 GRANT statement should be replicated with DEFINER information
include/rpl_reset.inc
+connection master;
GRANT SELECT, INSERT ON mysql.user TO user_bug27606@localhost;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
+connection slave;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
+connection master;
REVOKE SELECT ON mysql.user FROM user_bug27606@localhost;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
+connection slave;
SELECT Grantor FROM mysql.tables_priv WHERE User='user_bug27606';
Grantor
root@localhost
+connection master;
DROP USER user_bug27606@localhost;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter.result
index fb315c4b020..893d76e4a2e 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter.result
@@ -1,9 +1,9 @@
include/master-slave.inc
[connection master]
-# On slave
+connection slave;
call mtr.add_suppression("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be non-empty at the same time");
call mtr.add_suppression("DO_DOMAIN_IDS or IGNORE_DOMAIN_IDS lists can't be non-empty in non-GTID mode.*");
-# On master
+connection master;
SET @@session.gtid_domain_id= 1;
SELECT @@session.gtid_domain_id;
@@session.gtid_domain_id
@@ -14,7 +14,7 @@ SELECT * FROM t1;
i
1
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t1;
i
@@ -26,7 +26,7 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) : 1
IGNORE_DOMAIN_IDS (AFTER) :
-# On master
+connection master;
SET @@session.gtid_domain_id= 2;
INSERT INTO t1 VALUES(2);
SET @@session.gtid_domain_id= 1;
@@ -37,7 +37,7 @@ i
2
3
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t1;
i
@@ -50,7 +50,7 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
+connection master;
SELECT @@session.gtid_domain_id;
@@session.gtid_domain_id
1
@@ -65,7 +65,7 @@ i
4
5
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t1;
i
@@ -88,7 +88,7 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(4,4,5,1,7,7,7,1,1,2,6,8,1,4,5,5,9,3), IGNORE_DOM
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) : 1, 2, 3, 4, 5, 6, 7, 8, 9
IGNORE_DOMAIN_IDS (AFTER) :
-# On master
+connection master;
SELECT @@session.gtid_domain_id;
@@session.gtid_domain_id
2
@@ -105,7 +105,7 @@ COMMIT;
INSERT INTO t1 VALUES(14);
INSERT INTO t1 VALUES(15);
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t1;
i
@@ -114,10 +114,10 @@ i
5
8
9
-# On slave
+connection slave;
# Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
Seconds_Behind_Master = '0'
-# On slave
+connection slave;
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) : 1, 2, 3, 4, 5, 6, 7, 8, 9
IGNORE_DOMAIN_IDS (BEFORE) :
@@ -125,7 +125,7 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
+connection master;
SET @@session.gtid_domain_id=2;
CREATE TABLE t2(i int) ENGINE=MYISAM;
CREATE TABLE t3(i int) ENGINE=INNODB;
@@ -133,28 +133,28 @@ SET @@session.gtid_domain_id=1;
BEGIN;
INSERT INTO t2 VALUES(1);
INSERT INTO t3 VALUES(1);
-# On slave
+connection slave;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
-# On master
+connection master;
INSERT INTO t2 VALUES(2);
INSERT INTO t3 VALUES(2);
COMMIT;
include/save_master_gtid.inc
-# On slave
+connection slave;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t2;
i
SELECT * FROM t3;
i
-# On master
+connection master;
SET @@session.gtid_domain_id=1;
BEGIN;
INSERT INTO t2 VALUES(3);
INSERT INTO t3 VALUES(3);
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
@@ -163,12 +163,12 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_p
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
-# On master
+connection master;
INSERT INTO t2 VALUES(4);
INSERT INTO t3 VALUES(4);
COMMIT;
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t2;
i
@@ -177,13 +177,13 @@ SELECT * FROM t3;
i
3
4
-# On master
+connection master;
SET @@session.gtid_domain_id=1;
BEGIN;
INSERT INTO t2 VALUES(5);
INSERT INTO t3 VALUES(5);
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
@@ -192,12 +192,12 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
+connection master;
INSERT INTO t2 VALUES(6);
INSERT INTO t3 VALUES(6);
COMMIT;
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t2;
i
@@ -207,7 +207,7 @@ SELECT * FROM t3;
i
3
4
-# On slave
+connection slave;
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) : 1
@@ -215,14 +215,14 @@ CHANGE MASTER TO IGNORE_DOMAIN_IDS=(2), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 2
-# On master
+connection master;
SET @@session.gtid_domain_id=2;
BEGIN;
INSERT INTO t2 VALUES(7);
INSERT INTO t3 VALUES(7);
COMMIT;
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
@@ -231,14 +231,14 @@ CHANGE MASTER TO IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
-# On master
+connection master;
SET @@session.gtid_domain_id=2;
BEGIN;
INSERT INTO t2 VALUES(8);
INSERT INTO t3 VALUES(8);
COMMIT;
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t2;
i
@@ -250,6 +250,7 @@ i
3
4
8
+connection slave;
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) :
@@ -274,11 +275,11 @@ DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), DO_DOMAIN_IDS=(), MASTER_USE_GTID=SLAVE_POS;
include/start_slave.inc
-# On master
+connection master;
SET @@session.gtid_domain_id=2;
DROP TABLE t1, t2, t3;
include/save_master_gtid.inc
-# On slave
+connection slave;
include/sync_with_master_gtid.inc
include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
index 0c4fe90ba9a..a2b1d03c4fd 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_io_crash.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-# On master
+connection master;
SET @@session.gtid_domain_id= 1;
SELECT @@session.gtid_domain_id;
@@session.gtid_domain_id
@@ -10,7 +10,8 @@ INSERT INTO t1 VALUES(1);
SELECT * FROM t1;
i
1
-# On slave
+connection slave;
+connection slave;
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
# Case 0 : Start slave with IGNORE_DOMAIN_IDS=(), then restart
# replication with IGNORE_DOMAIN_IDS=() after IO thread is
@@ -26,7 +27,7 @@ include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
@@ -36,7 +37,7 @@ i
1
2
3
-# On slave
+connection slave;
include/wait_for_slave_io_error.inc [errno=1595]
SELECT * FROM t1;
i
@@ -60,7 +61,7 @@ include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES(4);
INSERT INTO t1 VALUES(5);
@@ -72,7 +73,7 @@ i
3
4
5
-# On slave
+connection slave;
include/wait_for_slave_io_error.inc [errno=1595]
SELECT * FROM t1;
i
@@ -98,7 +99,7 @@ include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES(6);
INSERT INTO t1 VALUES(7);
@@ -125,7 +126,7 @@ i
9
10
11
-# On slave
+connection slave;
include/wait_for_slave_io_error.inc [errno=1595]
SELECT * FROM t1;
i
@@ -158,7 +159,7 @@ include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
-# On master
+connection master;
SET @@session.gtid_domain_id= 1;
START TRANSACTION;
INSERT INTO t1 VALUES(12);
@@ -192,7 +193,7 @@ i
15
16
17
-# On slave
+connection slave;
include/wait_for_slave_io_error.inc [errno=1595]
SELECT * FROM t1;
i
@@ -231,7 +232,7 @@ include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
-# On master
+connection master;
SET @@session.gtid_domain_id= 1;
START TRANSACTION;
INSERT INTO t1 VALUES(18);
@@ -271,7 +272,7 @@ i
21
22
23
-# On slave
+connection slave;
include/wait_for_slave_io_error.inc [errno=1595]
SELECT * FROM t1;
i
@@ -318,7 +319,7 @@ include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) :
SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
-# On master
+connection master;
SET @@session.gtid_domain_id= 1;
START TRANSACTION;
INSERT INTO t1 VALUES(24);
@@ -364,7 +365,7 @@ i
27
28
29
-# On slave
+connection slave;
include/wait_for_slave_io_error.inc [errno=1595]
SELECT * FROM t1;
i
@@ -406,9 +407,10 @@ i
23
28
29
-# On master
+connection master;
DROP TABLE t1;
-# On slave
+connection slave;
+connection slave;
include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
index f26619a0871..c89de06485c 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_master_crash.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-# On master
+connection master;
call mtr.add_suppression("mysqld: Table './mysql/gtid_slave_pos' is marked as crashed and should be repaired");
call mtr.add_suppression("Checking table: './mysql/gtid_slave_pos'");
call mtr.add_suppression("mysql.gtid_slave_pos: 1 client is using or hasn't closed the table properly");
@@ -9,7 +9,7 @@ create table ti (a int auto_increment primary key) engine=innodb;
create table tm (a int auto_increment primary key) engine=myisam;
insert into ti set a=null;
insert into tm set a=null;
-# On slave
+connection slave;
include/stop_slave.inc
select * from ti;
a
@@ -17,7 +17,7 @@ a
select * from tm;
a
1
-# On master
+connection master;
SET @@session.gtid_domain_id= 1;
begin;
insert into ti set a=null;
@@ -27,18 +27,18 @@ SET @@session.gtid_domain_id= 0;
insert into ti set a=null;
insert into tm set a=null;
set @@global.debug_dbug="+d,crash_before_send_xid";
-# On slave
+connection slave;
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) :
CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
+connection master;
include/rpl_start_server.inc [server_number=1]
# Master has restarted successfully
set @@global.debug_dbug="-d";
-# On slave
+connection slave;
include/stop_slave.inc
include/start_slave.inc
select * from ti;
@@ -49,10 +49,11 @@ select * from tm;
a
1
3
-# On master
+connection master;
drop table ti;
drop table tm;
-# On slave
+connection slave;
+connection slave;
include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result
index d3e17a991b6..7d9142ee6bb 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_parallel.result
@@ -1,12 +1,12 @@
include/rpl_init.inc [topology=1->2]
-# On slave
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
-# On slave
+connection server_2;
CHANGE MASTER TO master_use_gtid=slave_pos, DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
include/start_slave.inc
-# On master
+connection server_1;
SELECT @@session.gtid_domain_id;
@@session.gtid_domain_id
0
@@ -15,10 +15,10 @@ CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
-# On slave
-# New connection 'con_temp1'
+connection server_2;
+connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
LOCK TABLE t1 WRITE;
-# On master
+connection server_1;
SET @@session.gtid_domain_id=1;
INSERT INTO t1 VALUES (2);
SET @@session.gtid_domain_id=0;
@@ -29,7 +29,7 @@ INSERT INTO t2 VALUES (4);
INSERT INTO t2 VALUES (5);
COMMIT;
INSERT INTO t2 VALUES (6);
-# On slave
+connection server_2;
SELECT * FROM t2 ORDER by a;
a
1
@@ -38,17 +38,17 @@ a
4
5
6
-# On con_temp1
+connection con_temp1;
SELECT * FROM t1;
a
1
UNLOCK TABLES;
-# On slave
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
2
-# On slave
+connection server_2;
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) :
@@ -56,10 +56,10 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) : 1
IGNORE_DOMAIN_IDS (AFTER) :
-# On slave
-# On con_temp1
+connection server_2;
+connection con_temp1;
LOCK TABLE t1 WRITE;
-# On master
+connection server_1;
SET @@session.gtid_domain_id=0;
INSERT INTO t1 VALUES (3);
SET @@session.gtid_domain_id=1;
@@ -70,7 +70,7 @@ INSERT INTO t2 VALUES (9);
INSERT INTO t2 VALUES (10);
COMMIT;
INSERT INTO t2 VALUES (11);
-# On slave
+connection server_2;
SELECT * FROM t2 ORDER by a;
a
1
@@ -84,18 +84,18 @@ a
9
10
11
-# On con_temp1
+connection con_temp1;
SELECT * FROM t1;
a
1
2
UNLOCK TABLES;
-# On slave
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
2
-# On slave
+connection server_2;
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) : 1
IGNORE_DOMAIN_IDS (BEFORE) :
@@ -103,10 +103,10 @@ CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
-# On slave
-# On con_temp1
+connection server_2;
+connection con_temp1;
LOCK TABLE t1 WRITE;
-# On master
+connection server_1;
SET @@session.gtid_domain_id=1;
INSERT INTO t1 VALUES (4);
SET @@session.gtid_domain_id=0;
@@ -117,7 +117,7 @@ INSERT INTO t2 VALUES (14);
INSERT INTO t2 VALUES (15);
COMMIT;
INSERT INTO t2 VALUES (16);
-# On slave
+connection server_2;
SELECT * FROM t2 ORDER by a;
a
1
@@ -136,13 +136,13 @@ a
14
15
16
-# On con_temp1
+connection con_temp1;
SELECT * FROM t1;
a
1
2
UNLOCK TABLES;
-# On slave
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -166,10 +166,10 @@ a
15
16
# Restore original settings.
-# On master
+connection server_1;
SET @@session.gtid_domain_id=0;
DROP TABLE t1, t2;
-# On slave
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads= @old_parallel_threads;
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
diff --git a/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result
index b4706ea5f11..f6eff3f9efc 100644
--- a/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result
+++ b/mysql-test/suite/rpl/r/rpl_domain_id_filter_restart.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-# On slave
+connection slave;
include/stop_slave.inc
DO_DOMAIN_IDS (BEFORE) :
IGNORE_DOMAIN_IDS (BEFORE) :
@@ -8,7 +8,7 @@ CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), MASTER_USE_GTID=slave_pos;
include/start_slave.inc
DO_DOMAIN_IDS (AFTER) :
IGNORE_DOMAIN_IDS (AFTER) : 1
-# On master
+connection master;
SET @@session.gtid_domain_id= 0;
CREATE TABLE t1(i INT);
CREATE TABLE t2(i INT);
@@ -21,14 +21,15 @@ INSERT INTO t2 VALUES(1);
SELECT * FROM t2;
i
1
-# On slave
+connection slave;
+connection slave;
SELECT * FROM t1;
i
1
SELECT * FROM t2;
i
include/rpl_restart_server.inc [server_number=2]
-# On slave
+connection slave;
DO_DOMAIN_IDS (AFTER RESTART) :
IGNORE_DOMAIN_IDS (AFTER RESTART) : 1
CHANGE MASTER TO IGNORE_DOMAIN_IDS=();
@@ -40,7 +41,8 @@ i
1
SELECT * FROM t2;
i
-# On master
+connection master;
SET @@session.gtid_domain_id= 0;
DROP TABLE t1, t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop.result b/mysql-test/suite/rpl/r/rpl_drop.result
index b91400b2296..74514fe7f61 100644
--- a/mysql-test/suite/rpl/r/rpl_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_drop.result
@@ -3,4 +3,5 @@ include/master-slave.inc
create table t1 (a int);
drop table t1, t2;
ERROR 42S02: Unknown table 'test.t2'
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db.result b/mysql-test/suite/rpl/r/rpl_drop_db.result
index 800a70c8c9b..1b132c20afc 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
drop database if exists mysqltest1;
create database mysqltest1;
create table mysqltest1.t1 (n int);
@@ -20,6 +21,8 @@ Tables_in_mysqltest1
use test;
create table t1 (n int);
insert into t1 values (1234);
+connection slave;
+connection slave;
use mysqltest1;
show tables;
Tables_in_mysqltest1
@@ -27,7 +30,9 @@ use test;
select * from t1;
n
1234
+connection master;
use test;
drop table t1;
drop database mysqltest1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_db_fail.result b/mysql-test/suite/rpl/r/rpl_drop_db_fail.result
index 1be90338493..4b4eacff3bb 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_db_fail.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_db_fail.result
@@ -1,16 +1,21 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE DATABASE IF NOT EXISTS db1;
CREATE DATABASE IF NOT EXISTS db2;
use db1;
CREATE TABLE a(id INT);
CREATE VIEW v AS SELECT * FROM a;
CREATE TABLE table_father(id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(20)) ENGINE=INNODB;
+connection slave;
+connection master;
use db2;
CREATE TABLE table_child(id INT PRIMARY KEY, info VARCHAR(20), father_id INT) ENGINE=INNODB;
ALTER TABLE table_child ADD CONSTRAINT aaa FOREIGN KEY (father_id) REFERENCES db1.table_father(id);
DROP DATABASE db1;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails
DROP DATABASE db2;
+connection slave;
+connection master;
DROP DATABASE db1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_drop_temp.result b/mysql-test/suite/rpl/r/rpl_drop_temp.result
index 44b5f44b4a2..adeecc42fcf 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_temp.result
@@ -1,13 +1,22 @@
include/master-slave.inc
[connection master]
create database if not exists mysqltest;
+connect con_temp,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection con_temp;
use mysqltest;
create temporary table mysqltest.t1 (n int)ENGINE=MyISAM;
create temporary table mysqltest.t2 (n int)ENGINE=MyISAM;
+disconnect con_temp;
+connection master;
+connection slave;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connection master;
drop database mysqltest;
+connection slave;
+connection master;
DROP TEMPORARY TABLE IF EXISTS tmp1;
Warnings:
Note 1051 Unknown table 'test.tmp1'
@@ -16,22 +25,34 @@ DROP TEMPORARY TABLE t1, t2;
ERROR 42S02: Unknown table 'test.t2'
DROP TEMPORARY TABLE tmp2;
ERROR 42S02: Unknown table 'test.tmp2'
+connection slave;
+connection slave;
stop slave;
-**** On Master ****
+connection master;
CREATE TEMPORARY TABLE tmp3 (a int);
DROP TEMPORARY TABLE tmp3;
+connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
+connection master;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 ( i INT );
+connection slave;
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connect con1,localhost,root,,;
CREATE TEMPORARY TABLE ttmp1 ( i INT );
SET SESSION binlog_format=ROW;
+disconnect con1;
+connection master;
+connection slave;
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connection master;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_drop_view.result b/mysql-test/suite/rpl/r/rpl_drop_view.result
index 70a87816e4b..f6ced4eb41f 100644
--- a/mysql-test/suite/rpl/r/rpl_drop_view.result
+++ b/mysql-test/suite/rpl/r/rpl_drop_view.result
@@ -15,6 +15,7 @@ ERROR 42S02: Unknown table 'test.not_exist_view'
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
drop view v2, v3;
+connection slave;
select * from v1;
ERROR 42S02: Table 'test.v1' doesn't exist
select * from v2;
@@ -22,5 +23,7 @@ ERROR 42S02: Table 'test.v2' doesn't exist
select * from v3;
ERROR 42S02: Table 'test.v3' doesn't exist
==== clean up ====
+connection master;
drop table t1, t2, t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
index 3a3bed1a6fd..676d74b9478 100644
--- a/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
+++ b/mysql-test/suite/rpl/r/rpl_dual_pos_advance.result
@@ -1,7 +1,10 @@
include/rpl_init.inc [topology=1->2->1]
+connection server_2;
create table t1 (n int);
+connection server_1;
include/stop_slave.inc
create table t2 (n int);
+connection server_2;
show tables;
Tables_in_test
t1
@@ -14,6 +17,7 @@ insert into t3 values(2);
insert into t3 values(3);
commit;
insert into t3 values(4);
+connection server_1;
start slave until master_log_file="MASTER_LOG_FILE",master_log_pos=MASTER_LOG_POS;
Warnings:
Note 1278 It is recommended to use --skip-slave-start when doing step-by-step replication with START SLAVE UNTIL; otherwise, you will get problems if you get an unexpected slave's mysqld restart
@@ -39,9 +43,12 @@ n
2
3
include/start_slave.inc
+connection server_1;
create table t4 (n int);
create table t5 (n int);
create table t6 (n int);
+connection server_2;
+connection server_1;
show tables;
Tables_in_test
t1
diff --git a/mysql-test/suite/rpl/r/rpl_empty_master_host.result b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
index 8b0b4ec30df..3d497cd824d 100644
--- a/mysql-test/suite/rpl/r/rpl_empty_master_host.result
+++ b/mysql-test/suite/rpl/r/rpl_empty_master_host.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
Master_Host = '127.0.0.1' (expected '127.0.0.1')
diff --git a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
index c2ec7eb4ba4..2017252f5d1 100644
--- a/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
+++ b/mysql-test/suite/rpl/r/rpl_err_ignoredtable.result
@@ -1,10 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1 (a int primary key);
create table t4 (a int primary key);
insert into t1 values (1),(1);
Got one of the listed errors
insert into t4 values (1),(2);
+connection slave;
show tables like 't1';
Tables_in_test (t1)
show tables like 't4';
@@ -14,26 +16,36 @@ SELECT * FROM test.t4 ORDER BY a;
a
1
2
+connection master;
drop table t1;
+connection slave;
+connection master1;
select get_lock('crash_lock%20C', 10);
get_lock('crash_lock%20C', 10)
1
+connection master;
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);
+connection master1;
select (@id := id) - id from t3;
(@id := id) - id
0
kill @id;
drop table t2,t3;
insert into t4 values (3),(4);
+connection master;
+connection master1;
+connection slave;
SELECT * FROM test.t4 ORDER BY a;
a
1
2
3
4
+connection master1;
DROP TABLE test.t4;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_events.result b/mysql-test/suite/rpl/r/rpl_events.result
index 23dcfab57f0..f7f802a57e6 100644
--- a/mysql-test/suite/rpl/r/rpl_events.result
+++ b/mysql-test/suite/rpl/r/rpl_events.result
@@ -21,6 +21,7 @@ test justonce ENABLED 1
"Checking event data on the master"
ONE
1
+connection slave;
"Checking event data on the slave"
ZERO
0
@@ -38,6 +39,7 @@ db name status originator
test slave_once ENABLED 2
"Dropping event test.slave_once on the slave"
DROP EVENT IF EXISTS test.slave_once;
+connection master;
"Dropping event test.justonce on the master"
DROP EVENT IF EXISTS test.justonce;
"Creating event test.er on the master"
@@ -47,10 +49,12 @@ INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er');
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
db name status originator body
test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
+connection slave;
"Checking event status on the slave"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (4, 'from er')
+connection master;
"Altering event test.er on the master"
ALTER EVENT test.er ON SCHEDULE EVERY 5 SECOND STARTS CURRENT_TIMESTAMP + INTERVAL 1 HOUR DO
INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
@@ -58,15 +62,18 @@ INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er');
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
db name status originator body
test er ENABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er')
+connection slave;
"Checking event status on the slave"
SELECT db, name, status, originator, body FROM mysql.event WHERE db = 'test' AND name = 'er';
db name status originator body
test er SLAVESIDE_DISABLED 1 INSERT IGNORE INTO t1(id, c) VALUES (5, 'from alter er')
+connection master;
"Dropping event test.er on the master"
DROP EVENT test.er;
"Checking event status on the master"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
+connection slave;
"Checking event status on the slave"
SELECT db, name, status, originator FROM mysql.event WHERE db = 'test';
db name status originator
@@ -89,13 +96,19 @@ test slave_terminate SLAVESIDE_DISABLED 2
"Dropping event test.slave_terminate on the slave"
DROP EVENT test.slave_terminate;
"Cleanup"
+connection master;
DROP TABLE t1;
+connection slave;
+connection master;
+connection master;
CREATE TABLE t28953 (a INT);
CREATE EVENT event1 ON SCHEDULE EVERY 1 YEAR
DO BEGIN
select * from t28953;
END;|
ALTER EVENT event1 RENAME TO event2;
+connection slave;
+connection master;
DROP EVENT event2;
CREATE TABLE test.t1(details CHAR(30));
CREATE EVENT /*!50000 event44331_1 */
@@ -122,7 +135,6 @@ ABC
ABC
123
123
-#on master
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
where EVENT_NAME='event44331_1';
EVENT_SCHEMA EVENT_NAME DEFINER
@@ -139,7 +151,8 @@ select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
where EVENT_NAME='event44331_4';
EVENT_SCHEMA EVENT_NAME DEFINER
test event44331_4 user44331@%
-#on slave
+connection slave;
+connection slave;
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
where EVENT_NAME='event44331_1';
EVENT_SCHEMA EVENT_NAME DEFINER
@@ -156,6 +169,7 @@ select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
where EVENT_NAME='event44331_4';
EVENT_SCHEMA EVENT_NAME DEFINER
test event44331_4 user44331@%
+connection master;
SET @@global.event_scheduler= @old_event_scheduler;
DROP TABLE t28953;
DROP TABLE t1;
@@ -163,4 +177,5 @@ DROP EVENT event44331_1;
DROP EVENT event44331_2;
DROP EVENT event44331_3;
DROP EVENT event44331_4;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
index e5e690bdf52..8371018f96a 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
@@ -12,6 +12,7 @@ include/master-slave.inc
***** Testing more columns on the Master *****
+connection master;
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
f5 FLOAT DEFAULT '2.00',
@@ -24,10 +25,12 @@ f11 VARBINARY(64))ENGINE='InnoDB';
* Alter Table on Slave and drop columns f5 through f11 *
+connection slave;
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
* Insert data in Master then update and delete some rows*
+connection master;
* Select count and 20 rows from Master *
SELECT COUNT(*) FROM t1;
@@ -57,6 +60,7 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+connection slave;
* Select count and 20 rows from Slave *
@@ -90,6 +94,7 @@ include/check_slave_is_running.inc
***** Testing Altering table def scenario *****
+connection master;
CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
f5 DOUBLE DEFAULT '2.00',
@@ -164,6 +169,7 @@ f35 VARCHAR(257)
** Alter tables on slave and drop columns **
+connection slave;
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
f12;
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
@@ -176,6 +182,7 @@ drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
drop f33, drop f34, drop f35;
** Insert Data into Master **
+connection master;
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
some var char';
INSERT into t2 values (2, 2, 2, 'second',
@@ -340,6 +347,7 @@ Warning 1264 Out of range value for column 'f24' at row 3
** Sync slave with master **
** Do selects from tables **
+connection slave;
select * from t1 order by f3;
f1 f2 f3 f4
2 2 2 second
@@ -401,6 +409,7 @@ f1 f2 f3 f4
1 1 4 fourth
1 1 5 fifth
1 1 6 sixth
+connection master;
** Do updates master **
@@ -418,12 +427,14 @@ delete from t2;
delete from t3;
delete from t4;
delete from t31;
+connection slave;
select * from t31;
f1 f2 f3 f4
** Check slave status **
include/check_slave_is_running.inc
+connection master;
****************************************
* columns in master at middle of table *
@@ -441,14 +452,17 @@ CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
** Connect to master and create table **
+connection master;
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
@@ -459,11 +473,14 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
*** Drop t10 ***
+connection master;
DROP TABLE t10;
+connection slave;
*********************************************
* More columns in master at middle of table *
@@ -477,14 +494,17 @@ CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
) ENGINE='InnoDB';
*** Create t11 on Master ***
+connection master;
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
@@ -495,11 +515,14 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
*** Drop t11 ***
+connection master;
DROP TABLE t11;
+connection slave;
*********************************************
* More columns in master at middle of table *
@@ -513,14 +536,17 @@ CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
) ENGINE='InnoDB';
*** Create t12 on Master ***
+connection master;
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -534,6 +560,7 @@ a hex(b) f c e
3 62316231623162316231623162316231 QA test 1
*** Select on Slave ***
+connection slave;
SELECT a,hex(b),c FROM t12 ORDER BY a;
a hex(b) c
1 62316231623162316231623162316231 Kyle
@@ -541,7 +568,9 @@ a hex(b) c
3 62316231623162316231623162316231 QA
*** Drop t12 ***
+connection master;
DROP TABLE t12;
+connection slave;
****************************************************
* - Alter Master adding columns at middle of table *
@@ -556,6 +585,7 @@ CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
*** Create t14 on Master ***
+connection master;
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -563,9 +593,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
@@ -582,6 +614,7 @@ c1 c2 c3 hex(c4) c5 c6 c7
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
*** Select on Slave ****
+connection slave;
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
c1 c2 c3 hex(c4) c5
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
@@ -594,6 +627,7 @@ c1 c2 c3 hex(c4) c5
****************************************************
*** connect to master and drop columns ***
+connection master;
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c7;
@@ -607,6 +641,7 @@ c1 c3 hex(c4) c5 c6
************
* Bug30415 *
************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1091]
Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
@@ -614,8 +649,10 @@ RESET SLAVE;
*** Drop t14 ***
DROP TABLE t14;
+connection master;
DROP TABLE t14;
RESET MASTER;
+connection slave;
START SLAVE;
*************************************************
@@ -630,6 +667,7 @@ CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
*** Create t15 on Master ***
+connection master;
CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -637,9 +675,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -656,6 +696,7 @@ c1 hex(c4) c5 c6 c7 c2
*** Expect slave to fail with Error 1054 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1054]
Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
STOP SLAVE;
@@ -663,8 +704,10 @@ RESET SLAVE;
*** Drop t15 ***
DROP TABLE t15;
+connection master;
DROP TABLE t15;
RESET MASTER;
+connection slave;
START SLAVE;
************************************************
@@ -679,6 +722,7 @@ CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
*** Create t16 on Master ***
+connection master;
CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -686,9 +730,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Create Index and Data Insert ***
+connection master;
CREATE INDEX part_of_c6 ON t16 (c6);
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -705,6 +751,7 @@ c1 hex(c4) c5 c6 c7
*** BUG 30434 ***
*****************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1072]
Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
STOP SLAVE;
@@ -712,8 +759,10 @@ RESET SLAVE;
*** Drop t16 ***
DROP TABLE t16;
+connection master;
DROP TABLE t16;
RESET MASTER;
+connection slave;
START SLAVE;
*****************************************************
@@ -728,6 +777,7 @@ CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
*** Create t17 on Master ***
+connection master;
CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -735,9 +785,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -750,6 +802,7 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
@@ -757,6 +810,7 @@ c1 hex(c4) c5
3 62316231623162316231623162316231 QA
** Delete from master **
+connection master;
DELETE FROM t17 WHERE c6 = 3;
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
c1 hex(c4) c5 c6 c7
@@ -764,11 +818,14 @@ c1 hex(c4) c5 c6 c7
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
** Check slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
2 62316231623162316231623162316231 JOE
+connection master;
DROP TABLE t17;
+connection slave;
*****************************************************
@@ -786,6 +843,7 @@ CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
*** Create t18 on Master ***
+connection master;
CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -793,9 +851,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -808,6 +868,7 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
@@ -815,6 +876,7 @@ c1 hex(c4) c5
3 62316231623162316231623162316231 QA
** update from master **
+connection master;
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
c1 hex(c4) c5 c6 c7
@@ -823,12 +885,15 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
** Check slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
2 62316231623162316231623162316231 JOE
3 62316231623162316231623162316231 TEST
+connection master;
DROP TABLE t18;
+connection slave;
*****************************************************
@@ -843,6 +908,7 @@ CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
*** Create t5 on Master ***
+connection master;
CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 LONG,
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -850,9 +916,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
(2,@b1,'JOE',UUID(),DEFAULT),
@@ -864,10 +932,14 @@ c1 hex(c4) c5 c6 c7
3 6231623162316231 QA UUID TIME
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
c1 hex(c4) c5
1 6231623162316231 Kyle
2 6231623162316231 JOE
3 6231623162316231 QA
+connection master;
DROP TABLE t5;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
index 9247ceb1030..6b41925aad7 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
@@ -12,6 +12,7 @@ include/master-slave.inc
***** Testing more columns on the Master *****
+connection master;
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
f5 FLOAT DEFAULT '2.00',
@@ -24,10 +25,12 @@ f11 VARBINARY(64))ENGINE='MyISAM';
* Alter Table on Slave and drop columns f5 through f11 *
+connection slave;
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
* Insert data in Master then update and delete some rows*
+connection master;
* Select count and 20 rows from Master *
SELECT COUNT(*) FROM t1;
@@ -57,6 +60,7 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+connection slave;
* Select count and 20 rows from Slave *
@@ -90,6 +94,7 @@ include/check_slave_is_running.inc
***** Testing Altering table def scenario *****
+connection master;
CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
f5 DOUBLE DEFAULT '2.00',
@@ -164,6 +169,7 @@ f35 VARCHAR(257)
** Alter tables on slave and drop columns **
+connection slave;
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
f12;
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
@@ -176,6 +182,7 @@ drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
drop f33, drop f34, drop f35;
** Insert Data into Master **
+connection master;
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
some var char';
INSERT into t2 values (2, 2, 2, 'second',
@@ -340,6 +347,7 @@ Warning 1264 Out of range value for column 'f24' at row 3
** Sync slave with master **
** Do selects from tables **
+connection slave;
select * from t1 order by f3;
f1 f2 f3 f4
2 2 2 second
@@ -401,6 +409,7 @@ f1 f2 f3 f4
1 1 4 fourth
1 1 5 fifth
1 1 6 sixth
+connection master;
** Do updates master **
@@ -418,12 +427,14 @@ delete from t2;
delete from t3;
delete from t4;
delete from t31;
+connection slave;
select * from t31;
f1 f2 f3 f4
** Check slave status **
include/check_slave_is_running.inc
+connection master;
****************************************
* columns in master at middle of table *
@@ -441,14 +452,17 @@ CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
** Connect to master and create table **
+connection master;
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
@@ -459,11 +473,14 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
*** Drop t10 ***
+connection master;
DROP TABLE t10;
+connection slave;
*********************************************
* More columns in master at middle of table *
@@ -477,14 +494,17 @@ CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
) ENGINE='MyISAM';
*** Create t11 on Master ***
+connection master;
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
@@ -495,11 +515,14 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
*** Drop t11 ***
+connection master;
DROP TABLE t11;
+connection slave;
*********************************************
* More columns in master at middle of table *
@@ -513,14 +536,17 @@ CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
) ENGINE='MyISAM';
*** Create t12 on Master ***
+connection master;
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -534,6 +560,7 @@ a hex(b) f c e
3 62316231623162316231623162316231 QA test 1
*** Select on Slave ***
+connection slave;
SELECT a,hex(b),c FROM t12 ORDER BY a;
a hex(b) c
1 62316231623162316231623162316231 Kyle
@@ -541,7 +568,9 @@ a hex(b) c
3 62316231623162316231623162316231 QA
*** Drop t12 ***
+connection master;
DROP TABLE t12;
+connection slave;
****************************************************
* - Alter Master adding columns at middle of table *
@@ -556,6 +585,7 @@ CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
*** Create t14 on Master ***
+connection master;
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -563,9 +593,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
@@ -582,6 +614,7 @@ c1 c2 c3 hex(c4) c5 c6 c7
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
*** Select on Slave ****
+connection slave;
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
c1 c2 c3 hex(c4) c5
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
@@ -594,6 +627,7 @@ c1 c2 c3 hex(c4) c5
****************************************************
*** connect to master and drop columns ***
+connection master;
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c7;
@@ -607,6 +641,7 @@ c1 c3 hex(c4) c5 c6
************
* Bug30415 *
************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1091]
Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
@@ -614,8 +649,10 @@ RESET SLAVE;
*** Drop t14 ***
DROP TABLE t14;
+connection master;
DROP TABLE t14;
RESET MASTER;
+connection slave;
START SLAVE;
*************************************************
@@ -630,6 +667,7 @@ CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
*** Create t15 on Master ***
+connection master;
CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -637,9 +675,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -656,6 +696,7 @@ c1 hex(c4) c5 c6 c7 c2
*** Expect slave to fail with Error 1054 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1054]
Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
STOP SLAVE;
@@ -663,8 +704,10 @@ RESET SLAVE;
*** Drop t15 ***
DROP TABLE t15;
+connection master;
DROP TABLE t15;
RESET MASTER;
+connection slave;
START SLAVE;
************************************************
@@ -679,6 +722,7 @@ CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
*** Create t16 on Master ***
+connection master;
CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -686,9 +730,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Create Index and Data Insert ***
+connection master;
CREATE INDEX part_of_c6 ON t16 (c6);
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -705,6 +751,7 @@ c1 hex(c4) c5 c6 c7
*** BUG 30434 ***
*****************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1072]
Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
STOP SLAVE;
@@ -712,8 +759,10 @@ RESET SLAVE;
*** Drop t16 ***
DROP TABLE t16;
+connection master;
DROP TABLE t16;
RESET MASTER;
+connection slave;
START SLAVE;
*****************************************************
@@ -728,6 +777,7 @@ CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
*** Create t17 on Master ***
+connection master;
CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -735,9 +785,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -750,6 +802,7 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
@@ -757,6 +810,7 @@ c1 hex(c4) c5
3 62316231623162316231623162316231 QA
** Delete from master **
+connection master;
DELETE FROM t17 WHERE c6 = 3;
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
c1 hex(c4) c5 c6 c7
@@ -764,11 +818,14 @@ c1 hex(c4) c5 c6 c7
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
** Check slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
2 62316231623162316231623162316231 JOE
+connection master;
DROP TABLE t17;
+connection slave;
*****************************************************
@@ -786,6 +843,7 @@ CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
*** Create t18 on Master ***
+connection master;
CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -793,9 +851,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -808,6 +868,7 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
@@ -815,6 +876,7 @@ c1 hex(c4) c5
3 62316231623162316231623162316231 QA
** update from master **
+connection master;
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
c1 hex(c4) c5 c6 c7
@@ -823,12 +885,15 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
** Check slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
2 62316231623162316231623162316231 JOE
3 62316231623162316231623162316231 TEST
+connection master;
DROP TABLE t18;
+connection slave;
*****************************************************
@@ -843,6 +908,7 @@ CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
*** Create t5 on Master ***
+connection master;
CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 LONG,
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -850,9 +916,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
(2,@b1,'JOE',UUID(),DEFAULT),
@@ -864,10 +932,14 @@ c1 hex(c4) c5 c6 c7
3 6231623162316231 QA UUID TIME
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
c1 hex(c4) c5
1 6231623162316231 Kyle
2 6231623162316231 JOE
3 6231623162316231 QA
+connection master;
DROP TABLE t5;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
index c24020eef87..e5e474fecca 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_innodb.result
@@ -3,7 +3,7 @@ include/master-slave.inc
call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051");
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677");
**** Diff Table Def Start ****
-*** On Slave ***
+connection slave;
STOP SLAVE;
RESET SLAVE;
SET @saved_slave_type_conversions = @@slave_type_conversions;
@@ -13,12 +13,15 @@ d FLOAT DEFAULT '2.00',
e CHAR(4) DEFAULT 'TEST')
ENGINE='InnoDB';
*** Create t1 on Master ***
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
SELECT * FROM t1 ORDER BY a;
a b c
@@ -26,6 +29,7 @@ a b c
2 1 AUSTIN
3 4 QA
*** Select from slave ***
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c d e
1 2 TEXAS 2 TEST
@@ -33,7 +37,9 @@ a b c d e
3 4 QA 2 TEST
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
*** Drop t1 ***
+connection master;
DROP TABLE t1;
+connection slave;
*** Create t2 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -42,10 +48,12 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='InnoDB';
*** Create t2 on Master ***
+connection master;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='InnoDB';
RESET MASTER;
*** Master Data Insert ***
+connection master;
INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
SELECT * FROM t2 ORDER BY a;
a b c
@@ -53,6 +61,7 @@ a b c
2 1 JOE AUSTIN
3 4 QA TESTING
*** Start Slave ***
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
@@ -60,10 +69,14 @@ STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
a b c d e
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
*** Drop t2 ***
+connection master;
DROP TABLE t2;
+connection slave;
*** Create t3 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -72,22 +85,28 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='InnoDB';
*** Create t3 on Master ***
+connection master;
CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
*** Drop t3 ***
+connection master;
DROP TABLE t3;
+connection slave;
*** Create t4 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -96,21 +115,27 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='InnoDB';
*** Create t4 on Master ***
+connection master;
CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
(30000.22,4,'QA TESTING');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
*** Drop t4 ***
+connection master;
DROP TABLE t4;
+connection slave;
*** Create t5 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -118,45 +143,57 @@ CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
c FLOAT, d INT, e DOUBLE,
f DECIMAL(8,2))ENGINE='InnoDB';
*** Create t5 on Master ***
+connection master;
CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
c DECIMAL(8,2), d BIT, e BLOB,
f FLOAT) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
(2,'JOE',300.01,0,'b2b2',1.0000009);
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t5 ***
+connection master;
DROP TABLE t5;
+connection slave;
*** Create t6 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
c FLOAT, d INT)ENGINE='InnoDB';
*** Create t6 on Master ***
+connection master;
CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
c DECIMAL(8,2), d BIT
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
(2,'JOE',300.01,0);
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t6 ***
include/rpl_reset.inc
+connection master;
DROP TABLE t6;
+connection slave;
**** Diff Table Def End ****
**** Extra Colums Start ****
*** Create t7 on slave ***
@@ -167,12 +204,15 @@ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
e CHAR(20) DEFAULT 'Extra Column Testing')
ENGINE='InnoDB';
*** Create t7 on Master ***
+connection master;
CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -182,13 +222,16 @@ a b c
2 b1b1 JOE
3 b1b1 QA
*** Select from slave ***
+connection slave;
SELECT * FROM t7 ORDER BY a;
a b c d e
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
*** Drop t7 ***
+connection master;
DROP TABLE t7;
+connection slave;
*** Create t8 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -196,17 +239,22 @@ CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
e INT)ENGINE='InnoDB';
*** Create t8 on Master ***
+connection master;
CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
*** Drop t8 ***
+connection master;
DROP TABLE t8;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
@@ -218,77 +266,98 @@ g text,
h blob not null,
i blob) ENGINE='InnoDB';
*** Create t9 on Master ***
+connection master;
CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+connection slave;
select * from t9;
a b c d e f g h i
1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+connection master;
DROP TABLE t9;
+connection slave;
*** Create t10 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
c CHAR(5), e INT DEFAULT '1')ENGINE='InnoDB';
*** Create t10 on Master ***
+connection master;
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
*** Drop t10 ***
+connection master;
DROP TABLE t10;
+connection slave;
*** Create t11 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
*** Create t11 on Master ***
+connection master;
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
*** Drop t11 ***
+connection master;
DROP TABLE t11;
+connection slave;
*** Create t12 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='InnoDB';
*** Create t12 on Master ***
+connection master;
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -298,13 +367,16 @@ a b c
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ***
+connection slave;
SELECT * FROM t12 ORDER BY a;
a b f c e
1 b1b1b1b1b1b1b1b1 Kyle test 1
2 b1b1b1b1b1b1b1b1 JOE test 1
3 b1b1b1b1b1b1b1b1 QA test 1
*** Drop t12 ***
+connection master;
DROP TABLE t12;
+connection slave;
**** Extra Colums End ****
*** BUG 22177 Start ***
*** Create t13 on slave ***
@@ -315,12 +387,15 @@ d INT DEFAULT '1',
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='InnoDB';
*** Create t13 on Master ***
+connection master;
CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -330,13 +405,16 @@ a b c
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t13 ORDER BY a;
a b c d e
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Drop t13 ***
+connection master;
DROP TABLE t13;
+connection slave;
*** 22117 END ***
*** Alter Master Table Testing Start ***
*** Create t14 on slave ***
@@ -347,12 +425,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='InnoDB';
*** Create t14 on Master ***
+connection master;
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
set @b1 = 'b1b1b1b1';
@@ -366,6 +447,7 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t14 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -379,12 +461,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='InnoDB';
*** Create t14a on Master ***
+connection master;
CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
@@ -396,6 +481,7 @@ c1 c4 c5
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t14a ORDER BY c1;
c1 c4 c5 c6 c7
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -404,11 +490,14 @@ c1 c4 c5 c6 c7
STOP SLAVE;
RESET SLAVE;
*** Master Drop c5 ***
+connection master;
ALTER TABLE t14a DROP COLUMN c5;
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t14a () VALUES(4,@b1),
@@ -423,6 +512,7 @@ c1 c4
5 b1b1b1b1b1b1b1b1
6 b1b1b1b1b1b1b1b1
*** Select on Slave ****
+connection slave;
SELECT * FROM t14a ORDER BY c1;
c1 c4 c5 c6 c7
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -431,8 +521,11 @@ c1 c4 c5 c6 c7
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+connection master;
DROP TABLE t14a;
+connection slave;
*** connect to master and drop columns ***
+connection master;
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c4;
*** Select from Master ***
@@ -442,13 +535,16 @@ c1 c3 c5
2 This Test Should work JOE
3 If is does not, I will open a bug QA
*** Select from Slave ***
+connection slave;
SELECT * FROM t14 ORDER BY c1;
c1 c3 c5 c6 c7
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
*** Drop t14 ***
+connection master;
DROP TABLE t14;
+connection slave;
*** Create t15 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -458,15 +554,18 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='InnoDB';
*** Create t15 on Master ***
+connection master;
CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
c4 BLOB, c5 CHAR(5)) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051");
call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060");
call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535");
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
@@ -478,19 +577,23 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Add column on master that is a Extra on Slave ***
+connection master;
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
********************************************
*** Expect slave to fail with Error 1060 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1060]
Last_SQL_Error = 'Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5''
*** Try to insert in master ****
+connection master;
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6
@@ -499,6 +602,7 @@ c1 c2 c3 c4 c5 c6
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
*** Try to select from slave ****
+connection slave;
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -506,7 +610,9 @@ c1 c2 c3 c4 c5 c6 c7
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
*** DROP TABLE t15 ***
+connection master;
DROP TABLE t15;
+connection slave;
*** Create t16 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -516,12 +622,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='InnoDB';
*** Create t16 on Master ***
+connection master;
CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
c4 BLOB, c5 CHAR(5))ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
@@ -533,12 +642,14 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t16 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Add Partition on master ***
+connection master;
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
SHOW CREATE TABLE t16;
@@ -554,6 +665,7 @@ t16 CREATE TABLE `t16` (
/*!50100 PARTITION BY KEY (c1)
PARTITIONS 4 */
*** Show table on Slave ****
+connection slave;
SHOW CREATE TABLE t16;
Table Create Table
t16 CREATE TABLE `t16` (
@@ -569,7 +681,9 @@ t16 CREATE TABLE `t16` (
/*!50100 PARTITION BY KEY (c1)
PARTITIONS 4 */
*** DROP TABLE t16 ***
+connection master;
DROP TABLE t16;
+connection slave;
*** Alter Master End ***
*** Create t17 on slave ***
STOP SLAVE;
@@ -579,18 +693,24 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='InnoDB';
*** Create t17 on Master ***
+connection master;
CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='InnoDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
** DROP table t17 ***
+connection master;
DROP TABLE t17;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
index a8710f0de5b..548736b9146 100644
--- a/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_extra_col_slave_myisam.result
@@ -3,7 +3,7 @@ include/master-slave.inc
call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051");
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677");
**** Diff Table Def Start ****
-*** On Slave ***
+connection slave;
STOP SLAVE;
RESET SLAVE;
SET @saved_slave_type_conversions = @@slave_type_conversions;
@@ -13,12 +13,15 @@ d FLOAT DEFAULT '2.00',
e CHAR(4) DEFAULT 'TEST')
ENGINE='MyISAM';
*** Create t1 on Master ***
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
SELECT * FROM t1 ORDER BY a;
a b c
@@ -26,6 +29,7 @@ a b c
2 1 AUSTIN
3 4 QA
*** Select from slave ***
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c d e
1 2 TEXAS 2 TEST
@@ -33,7 +37,9 @@ a b c d e
3 4 QA 2 TEST
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
*** Drop t1 ***
+connection master;
DROP TABLE t1;
+connection slave;
*** Create t2 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -42,10 +48,12 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='MyISAM';
*** Create t2 on Master ***
+connection master;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='MyISAM';
RESET MASTER;
*** Master Data Insert ***
+connection master;
INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
SELECT * FROM t2 ORDER BY a;
a b c
@@ -53,6 +61,7 @@ a b c
2 1 JOE AUSTIN
3 4 QA TESTING
*** Start Slave ***
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
@@ -60,10 +69,14 @@ STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
a b c d e
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
*** Drop t2 ***
+connection master;
DROP TABLE t2;
+connection slave;
*** Create t3 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -72,22 +85,28 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='MyISAM';
*** Create t3 on Master ***
+connection master;
CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
*** Drop t3 ***
+connection master;
DROP TABLE t3;
+connection slave;
*** Create t4 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -96,21 +115,27 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='MyISAM';
*** Create t4 on Master ***
+connection master;
CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
(30000.22,4,'QA TESTING');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
*** Drop t4 ***
+connection master;
DROP TABLE t4;
+connection slave;
*** Create t5 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -118,45 +143,57 @@ CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
c FLOAT, d INT, e DOUBLE,
f DECIMAL(8,2))ENGINE='MyISAM';
*** Create t5 on Master ***
+connection master;
CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
c DECIMAL(8,2), d BIT, e BLOB,
f FLOAT) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
(2,'JOE',300.01,0,'b2b2',1.0000009);
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t5 ***
+connection master;
DROP TABLE t5;
+connection slave;
*** Create t6 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
c FLOAT, d INT)ENGINE='MyISAM';
*** Create t6 on Master ***
+connection master;
CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
c DECIMAL(8,2), d BIT
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
(2,'JOE',300.01,0);
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t6 ***
include/rpl_reset.inc
+connection master;
DROP TABLE t6;
+connection slave;
**** Diff Table Def End ****
**** Extra Colums Start ****
*** Create t7 on slave ***
@@ -167,12 +204,15 @@ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
e CHAR(20) DEFAULT 'Extra Column Testing')
ENGINE='MyISAM';
*** Create t7 on Master ***
+connection master;
CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -182,13 +222,16 @@ a b c
2 b1b1 JOE
3 b1b1 QA
*** Select from slave ***
+connection slave;
SELECT * FROM t7 ORDER BY a;
a b c d e
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
*** Drop t7 ***
+connection master;
DROP TABLE t7;
+connection slave;
*** Create t8 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -196,17 +239,22 @@ CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
e INT)ENGINE='MyISAM';
*** Create t8 on Master ***
+connection master;
CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
*** Drop t8 ***
+connection master;
DROP TABLE t8;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
@@ -218,77 +266,98 @@ g text,
h blob not null,
i blob) ENGINE='MyISAM';
*** Create t9 on Master ***
+connection master;
CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+connection slave;
select * from t9;
a b c d e f g h i
1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+connection master;
DROP TABLE t9;
+connection slave;
*** Create t10 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
c CHAR(5), e INT DEFAULT '1')ENGINE='MyISAM';
*** Create t10 on Master ***
+connection master;
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
*** Drop t10 ***
+connection master;
DROP TABLE t10;
+connection slave;
*** Create t11 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
*** Create t11 on Master ***
+connection master;
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
*** Drop t11 ***
+connection master;
DROP TABLE t11;
+connection slave;
*** Create t12 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='MyISAM';
*** Create t12 on Master ***
+connection master;
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -298,13 +367,16 @@ a b c
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ***
+connection slave;
SELECT * FROM t12 ORDER BY a;
a b f c e
1 b1b1b1b1b1b1b1b1 Kyle test 1
2 b1b1b1b1b1b1b1b1 JOE test 1
3 b1b1b1b1b1b1b1b1 QA test 1
*** Drop t12 ***
+connection master;
DROP TABLE t12;
+connection slave;
**** Extra Colums End ****
*** BUG 22177 Start ***
*** Create t13 on slave ***
@@ -315,12 +387,15 @@ d INT DEFAULT '1',
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='MyISAM';
*** Create t13 on Master ***
+connection master;
CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -330,13 +405,16 @@ a b c
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t13 ORDER BY a;
a b c d e
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Drop t13 ***
+connection master;
DROP TABLE t13;
+connection slave;
*** 22117 END ***
*** Alter Master Table Testing Start ***
*** Create t14 on slave ***
@@ -347,12 +425,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='MyISAM';
*** Create t14 on Master ***
+connection master;
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
set @b1 = 'b1b1b1b1';
@@ -366,6 +447,7 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t14 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -379,12 +461,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='MyISAM';
*** Create t14a on Master ***
+connection master;
CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
@@ -396,6 +481,7 @@ c1 c4 c5
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t14a ORDER BY c1;
c1 c4 c5 c6 c7
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -404,11 +490,14 @@ c1 c4 c5 c6 c7
STOP SLAVE;
RESET SLAVE;
*** Master Drop c5 ***
+connection master;
ALTER TABLE t14a DROP COLUMN c5;
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t14a () VALUES(4,@b1),
@@ -423,6 +512,7 @@ c1 c4
5 b1b1b1b1b1b1b1b1
6 b1b1b1b1b1b1b1b1
*** Select on Slave ****
+connection slave;
SELECT * FROM t14a ORDER BY c1;
c1 c4 c5 c6 c7
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -431,8 +521,11 @@ c1 c4 c5 c6 c7
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+connection master;
DROP TABLE t14a;
+connection slave;
*** connect to master and drop columns ***
+connection master;
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c4;
*** Select from Master ***
@@ -442,13 +535,16 @@ c1 c3 c5
2 This Test Should work JOE
3 If is does not, I will open a bug QA
*** Select from Slave ***
+connection slave;
SELECT * FROM t14 ORDER BY c1;
c1 c3 c5 c6 c7
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
*** Drop t14 ***
+connection master;
DROP TABLE t14;
+connection slave;
*** Create t15 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -458,15 +554,18 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='MyISAM';
*** Create t15 on Master ***
+connection master;
CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
c4 BLOB, c5 CHAR(5)) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051");
call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060");
call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535");
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
@@ -478,19 +577,23 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Add column on master that is a Extra on Slave ***
+connection master;
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
********************************************
*** Expect slave to fail with Error 1060 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1060]
Last_SQL_Error = 'Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5''
*** Try to insert in master ****
+connection master;
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6
@@ -499,6 +602,7 @@ c1 c2 c3 c4 c5 c6
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
*** Try to select from slave ****
+connection slave;
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -506,7 +610,9 @@ c1 c2 c3 c4 c5 c6 c7
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
*** DROP TABLE t15 ***
+connection master;
DROP TABLE t15;
+connection slave;
*** Create t16 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -516,12 +622,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='MyISAM';
*** Create t16 on Master ***
+connection master;
CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
c4 BLOB, c5 CHAR(5))ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
@@ -533,12 +642,14 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t16 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Add Partition on master ***
+connection master;
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
SHOW CREATE TABLE t16;
@@ -554,6 +665,7 @@ t16 CREATE TABLE `t16` (
/*!50100 PARTITION BY KEY (c1)
PARTITIONS 4 */
*** Show table on Slave ****
+connection slave;
SHOW CREATE TABLE t16;
Table Create Table
t16 CREATE TABLE `t16` (
@@ -569,7 +681,9 @@ t16 CREATE TABLE `t16` (
/*!50100 PARTITION BY KEY (c1)
PARTITIONS 4 */
*** DROP TABLE t16 ***
+connection master;
DROP TABLE t16;
+connection slave;
*** Alter Master End ***
*** Create t17 on slave ***
STOP SLAVE;
@@ -579,18 +693,24 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='MyISAM';
*** Create t17 on Master ***
+connection master;
CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='MyISAM';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
** DROP table t17 ***
+connection master;
DROP TABLE t17;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_failed_optimize.result b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
index 0d46f78c150..ad49fb4d8bb 100644
--- a/mysql-test/suite/rpl/r/rpl_failed_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_failed_optimize.result
@@ -3,10 +3,13 @@ include/master-slave.inc
CREATE TABLE t1 ( a int ) ENGINE=InnoDB;
BEGIN;
INSERT INTO t1 VALUES (1);
+connection master1;
OPTIMIZE TABLE non_existing;
Table Op Msg_type Msg_text
test.non_existing optimize Error Table 'test.non_existing' doesn't exist
test.non_existing optimize status Operation failed
+connection slave;
+connection master;
select * from t1;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result
index eaa2ed9a61d..caedf3cd2e2 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_dbs_dynamic.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @@GLOBAL.replicate_do_db="db1";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SET @@GLOBAL.replicate_ignore_db="db2";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
+connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_do_db="db1";
SET @@GLOBAL.replicate_ignore_db="db2";
include/start_slave.inc
+connection master;
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE DATABASE db3;
@@ -23,6 +26,7 @@ USE db2;
INSERT INTO t2 VALUES (2);
USE db3;
INSERT INTO t3 VALUES (3);
+connection slave;
[on slave]
SHOW DATABASES LIKE 'db%';
Database (db%)
@@ -30,11 +34,12 @@ db1
SHOW TABLES IN db1 LIKE 't%';
Tables_in_db1 (t%)
t1
-[on master]
-[on master]
+connection master;
+connection master;
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
DROP DATABASE IF EXISTS db3;
include/rpl_end.inc
+connection slave;
SET @@GLOBAL.replicate_do_db="";
SET @@GLOBAL.replicate_ignore_db="";
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result
index 5a746c88458..b6c82e3754c 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_dynamic.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
+connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_do_table="test.t1,test.t2,test.t3";
SET @@GLOBAL.replicate_ignore_table="test.t4,test.t5,test.t6";
include/start_slave.inc
+connection master;
CREATE TABLE t1 (id int, a int);
CREATE TABLE t2 (id int, b int);
CREATE TABLE t3 (id int, c int);
@@ -26,13 +29,13 @@ INSERT INTO t6 VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO t7 VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO t8 VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3);
-[on slave]
+connection slave;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
t2
t3
-[on master]
+connection master;
UPDATE t7 LEFT JOIN t4 ON (t4.id=t7.id) SET d=0, g=0 where t7.id=1;
UPDATE t7 LEFT JOIN (t4, t5, t6) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t6.id) SET d=0, e=0, f=0, g=0 where t7.id=1;
UPDATE t4 LEFT JOIN (t7, t8, t9) ON (t4.id=t7.id and t4.id=t8.id and t4.id=t9.id) SET d=0, g=0, h=0, i=0 where t4.id=1;
@@ -50,7 +53,10 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id
UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1;
UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1;
+connection slave;
+connection slave;
call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* error.* 1146");
+connection master;
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1;
include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1''
@@ -99,6 +105,7 @@ Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default databa
UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1''
+connection slave;
[on slave]
show tables like 't%';
Tables_in_test (t%)
@@ -120,8 +127,9 @@ id c
1 1
2 2
3 3
-[on master]
+connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
include/rpl_end.inc
+connection slave;
SET @@GLOBAL.replicate_do_table="";
SET @@GLOBAL.replicate_ignore_table="";
diff --git a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
index 932a44e7f04..f7d6b17245a 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_tables_not_exist.result
@@ -18,13 +18,13 @@ INSERT INTO t6 VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO t7 VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO t8 VALUES (1, 1), (2, 2), (3, 3);
INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3);
-[on slave]
+connection slave;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
t2
t3
-[on master]
+connection master;
UPDATE t7 LEFT JOIN t4 ON (t4.id=t7.id) SET d=0, g=0 where t7.id=1;
UPDATE t7 LEFT JOIN (t4, t5, t6) ON (t7.id=t4.id and t7.id=t5.id and t7.id=t6.id) SET d=0, e=0, f=0, g=0 where t7.id=1;
UPDATE t4 LEFT JOIN (t7, t8, t9) ON (t4.id=t7.id and t4.id=t8.id and t4.id=t9.id) SET d=0, g=0, h=0, i=0 where t4.id=1;
@@ -42,7 +42,10 @@ UPDATE t4 LEFT JOIN (t1, t2, t5) ON (t1.id=t4.id and t2.id=t4.id and t5.id=t4.id
UPDATE t4 LEFT JOIN (t1, t6, t7) ON (t4.id=t1.id and t4.id=t6.id and t4.id=t7.id) SET a=0, d=0, f=0, g=0 where t4.id=1;
UPDATE t7 LEFT JOIN (t4, t1, t2) ON (t7.id=t4.id and t7.id=t1.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
UPDATE t7 LEFT JOIN (t8, t4, t1) ON (t7.id=t8.id and t7.id=t4.id and t7.id=t1.id) SET a=0, d=0, g=0, h=0 where t7.id=1;
+connection slave;
+connection slave;
call mtr.add_suppression("Slave SQL.*Error .Table .test.t[47]. doesn.t exist. on query.* error.* 1146");
+connection master;
UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1;
include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t1 LEFT JOIN t4 ON (t1.id=t4.id) SET a=0 where t1.id=1''
@@ -91,6 +94,7 @@ Last_SQL_Error = 'Error 'Table 'test.t4' doesn't exist' on query. Default databa
UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1;
include/wait_for_slave_sql_error_and_skip.inc [errno=1146]
Last_SQL_Error = 'Error 'Table 'test.t7' doesn't exist' on query. Default database: 'test'. Query: 'UPDATE t7 LEFT JOIN (t1, t4, t2) ON (t7.id=t1.id and t7.id=t4.id and t7.id=t2.id) SET a=0, b=0, d=0, g=0 where t7.id=1''
+connection slave;
[on slave]
show tables like 't%';
Tables_in_test (t%)
@@ -112,26 +116,33 @@ id c
1 1
2 2
3 3
-[on master]
+connection master;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+connection slave;
+connection master;
CREATE TABLE test.t5 (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TABLE test.t1 (a INT);
INSERT INTO test.t1 VALUES(1);
+connection slave;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
CREATE TABLE test.t_slave (a INT AUTO_INCREMENT PRIMARY KEY, b DECIMAL(20,20), c INT);
CREATE TRIGGER t1_update AFTER UPDATE ON test.t1 FOR EACH ROW
INSERT INTO test.t_slave VALUES(NULL, RAND(), @c);
+connection master;
SET INSERT_ID=2;
SET @c=2;
SET @@rand_seed1=10000000, @@rand_seed2=1000000;
INSERT INTO t5 VALUES (NULL, RAND(), @c);
SELECT b into @b FROM test.t5;
UPDATE test.t1 SET a=2;
+connection slave;
SELECT a AS 'ONE' into @a FROM test.t_slave;
SELECT c AS 'NULL' into @c FROM test.t_slave;
SELECT b into @b FROM test.t_slave;
include/assert.inc [Random values from master and slave must be different]
+connection master;
drop table test.t5;
drop table test.t1;
+connection slave;
drop table test.t_slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result
index 19d8e513e6f..47cd362a549 100644
--- a/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result
+++ b/mysql-test/suite/rpl/r/rpl_filter_wild_tables_dynamic.result
@@ -1,26 +1,30 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @@GLOBAL.replicate_wild_do_table="test.a%";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
+connection slave;
include/stop_slave.inc
SET @@GLOBAL.replicate_wild_do_table="test.a%";
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
include/start_slave.inc
+connection master;
CREATE TABLE a1 (a INT);
CREATE TABLE b1 (a INT);
CREATE TABLE c1 (a INT);
INSERT INTO a1 VALUES (1);
INSERT INTO b1 VALUES (2);
INSERT INTO c1 VALUES (3);
-[on slave]
+connection slave;
SHOW TABLES LIKE '%1';
Tables_in_test (%1)
a1
-[on master]
-[on master]
+connection master;
+connection master;
DROP TABLE IF EXISTS a1,b1,c1;
include/rpl_end.inc
+connection slave;
SET @@GLOBAL.replicate_wild_do_table="";
SET @@GLOBAL.replicate_wild_ignore_table="";
diff --git a/mysql-test/suite/rpl/r/rpl_flush_logs.result b/mysql-test/suite/rpl/r/rpl_flush_logs.result
index 1f543cd9f43..01188531a1e 100644
--- a/mysql-test/suite/rpl/r/rpl_flush_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_flush_logs.result
@@ -1,15 +1,20 @@
include/master-slave.inc
[connection master]
+connection master;
# Test if support 'flush error logs' statement.
flush error logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs' statement.
+connection slave;
# Make sure relay logs was not be flushed
# after execute 'flush error logs' statement.
+connection master;
# Test if support 'flush relay logs' statement.
flush relay logs;
+connection slave;
# Check the 'slave-relay-bin.000003' file is not created
# after executed 'flush relay logs' statement.
+connection master;
# Make sure binary logs was not be flushed
# after execute 'flush relay logs' statement.
# Test if support 'flush slow logs' statement.
@@ -30,21 +35,26 @@ flush engine logs;
flush binary logs;
# Check the 'master-bin.000002' file is created
# after executed 'flush binary logs' statement.
+connection slave;
# Make sure the 'slave-relay-bin.000005' file does not exist
# exist before execute 'flush error logs, relay logs' statement.
+connection master;
# Test if support to combine all kinds of logs into one statement.
flush error logs, relay logs;
# Make sure binary logs was not be flushed
# after execute 'flush error logs, relay logs' statement.
+connection slave;
# Check the 'slave-relay-bin.000004' file is created after
# execute 'flush error logs, relay logs' statement.
# Make sure the 'slave-relay-bin.000005' and 'slave-relay-bin.000006'
# files do not exist before execute 'flush error logs, relay logs'
# statement.
+connection master;
# Test if 'flush logs' statement works fine and flush all the logs.
flush logs;
# Check 'master-bin.000003' is created
# after execute 'flush logs' statement.
+connection slave;
# Check the 'slave-relay-bin.000005' and 'slave-relay-bin.000006'
# files are created after execute 'flush logs' statement.
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
index a5bf73cdbfa..75ea113ca59 100644
--- a/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
+++ b/mysql-test/suite/rpl/r/rpl_flushlog_loop.result
@@ -9,9 +9,13 @@ relay_log_purge ON
relay_log_recovery OFF
relay_log_space_limit 0
CREATE TABLE t1 (a INT KEY) ENGINE= MyISAM;
+connection server_2;
+connection server_1;
INSERT INTO t1 VALUE(1);
FLUSH LOGS;
+connection server_2;
INSERT INTO t1 VALUE(2);
+connection server_1;
include/check_slave_is_running.inc
Relay_Log_File = 'master-relay-bin.000003'
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
index c30bac3d8c0..120ae018d2f 100644
--- a/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_foreign_key_innodb.result
@@ -18,6 +18,7 @@ SELECT * FROM t2 ORDER BY b;
b c
5 0
6 11
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
10
@@ -28,14 +29,19 @@ SELECT * FROM t2 ORDER BY b;
b c
5 0
6 11
+connection master;
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 'a'
+connection slave;
+connection master;
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS t1,t2,t3;
SET FOREIGN_KEY_CHECKS=1;
+connection slave;
+connection master;
create table t1 (b int primary key) engine = INNODB;
create table t2 (a int primary key, b int, foreign key (b) references t1(b))
engine = INNODB;
@@ -44,8 +50,10 @@ insert into t2 set a=1, b=1;
set foreign_key_checks=0;
delete from t1;
must sync w/o a problem (could not with the buggy code)
+connection slave;
select count(*) from t1 /* must be zero */;
count(*)
0
+connection master;
drop table t2,t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_free_items.result b/mysql-test/suite/rpl/r/rpl_free_items.result
index 416f597aebc..af7a267266f 100644
--- a/mysql-test/suite/rpl/r/rpl_free_items.result
+++ b/mysql-test/suite/rpl/r/rpl_free_items.result
@@ -2,6 +2,9 @@ include/master-slave.inc
[connection master]
create table t1 (a int);
create table t2 (a int);
+connection slave;
+connection master;
drop table t1;
drop table t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_function_defaults.result b/mysql-test/suite/rpl/r/rpl_function_defaults.result
index 264bb3c9c6d..e0d2ff14c43 100644
--- a/mysql-test/suite/rpl/r/rpl_function_defaults.result
+++ b/mysql-test/suite/rpl/r/rpl_function_defaults.result
@@ -3,19 +3,19 @@
#
include/master-slave.inc
[connection master]
-connection master
+connection master;
SET TIME_ZONE="+10:30";
SET TIMESTAMP=123456.789123;
SELECT CURRENT_TIMESTAMP;
CURRENT_TIMESTAMP
1970-01-02 20:47:36
-connection slave
+connection slave;
SET TIME_ZONE="+00:00";
SET TIMESTAMP=987654321.123456;
SELECT CURRENT_TIMESTAMP;
CURRENT_TIMESTAMP
2001-04-19 04:25:21
-connection master
+connection master;
CREATE TABLE t1 (
a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
b TIMESTAMP(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1),
@@ -53,7 +53,8 @@ o INT
);
INSERT INTO t2 ( o ) VALUES ( 1 );
sync_slave_with_master
-connection slave
+connection slave;
+connection slave;
SELECT * FROM t1;
a 1970-01-02 10:17:36
b 1970-01-02 10:17:36.7
@@ -86,7 +87,7 @@ l NULL
m NULL
n NULL
o 1
-connection master
+connection master;
SET TIMESTAMP=1234567890.123456;
SELECT CURRENT_TIMESTAMP;
CURRENT_TIMESTAMP
@@ -94,7 +95,8 @@ CURRENT_TIMESTAMP
UPDATE t1 SET o = 2;
UPDATE t2 SET o = 2;
sync_slave_with_master
-connection slave
+connection slave;
+connection slave;
SELECT * FROM t1;
a 1970-01-02 10:17:36
b 1970-01-02 10:17:36.7
@@ -127,6 +129,6 @@ l 2009-02-14 10:01:30.1234
m 2009-02-14 10:01:30.12345
n 2009-02-14 10:01:30.123456
o 2
-connection master
+connection master;
DROP TABLE t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_geometry.result b/mysql-test/suite/rpl/r/rpl_geometry.result
index 7ec119c9ae8..01dad7b00a0 100644
--- a/mysql-test/suite/rpl/r/rpl_geometry.result
+++ b/mysql-test/suite/rpl/r/rpl_geometry.result
@@ -11,5 +11,7 @@ create table t2 (a int(11) not null auto_increment primary key,
b geometrycollection default null,
c decimal(10,0));
insert into t2(c) values (null);
+connection slave;
+connection master;
drop table t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_get_lock.result b/mysql-test/suite/rpl/r/rpl_get_lock.result
index 757ce9bba17..b852546e1bf 100644
--- a/mysql-test/suite/rpl/r/rpl_get_lock.result
+++ b/mysql-test/suite/rpl/r/rpl_get_lock.result
@@ -3,12 +3,15 @@ include/master-slave.inc
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table t1(n int);
insert into t1 values(get_lock("lock",2));
+disconnect master;
+connection master1;
select get_lock("lock",2);
get_lock("lock",2)
1
select release_lock("lock");
release_lock("lock")
1
+connection slave;
select get_lock("lock",3);
get_lock("lock",3)
1
@@ -29,5 +32,7 @@ is_free_lock("lock2")
select is_free_lock(NULL);
is_free_lock(NULL)
NULL
+connection master1;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_grant.result b/mysql-test/suite/rpl/r/rpl_grant.result
index 4ec8c51a5dc..0f546f7edc4 100644
--- a/mysql-test/suite/rpl/r/rpl_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_grant.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-**** On Master ****
+connection master;
CREATE USER dummy@localhost;
CREATE USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user like 'dummy%';
@@ -11,6 +11,7 @@ dummy2 localhost
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*)
3
+connection slave;
**** On Slave ****
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
user host
@@ -20,7 +21,7 @@ dummy2 localhost
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*)
3
-**** On Master ****
+connection master;
DROP USER nonexisting@localhost;
ERROR HY000: Operation DROP USER failed for 'nonexisting'@'localhost'
DROP USER nonexisting@localhost, dummy@localhost;
@@ -31,7 +32,7 @@ user host
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
COUNT(*)
0
-**** On Slave ****
+connection slave;
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
user host
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_basic.result b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
index 22f284d6716..2a665e87008 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_basic.result
@@ -1,4 +1,5 @@
include/rpl_init.inc [topology=1->2->3->4]
+connection server_1;
*** GTID position should be empty here ***
SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
@@ -16,6 +17,7 @@ COMMIT;
SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
<GTID_POS_SERVER_1>
+connection server_2;
*** GTID position should be the same as on server_1 ***
SELECT BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>);
BINLOG_GTID_POS('<BINLOG_FILE>',<BINLOG_POS>)
@@ -32,6 +34,7 @@ a b
2 i2
3 i3
4 i4
+connection server_3;
SELECT * FROM t1 ORDER BY a;
a b
1 m1
@@ -44,6 +47,7 @@ a b
2 i2
3 i3
4 i4
+connection server_4;
SELECT * FROM t1 ORDER BY a;
a b
1 m1
@@ -57,9 +61,12 @@ a b
3 i3
4 i4
*** Now take out D, let it fall behind a bit, and then test re-attaching it to A ***
+connection server_4;
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (5, "m1a");
INSERT INTO t2 VALUES (5, "i1a");
+connection server_4;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
@@ -78,11 +85,14 @@ a b
4 i4
5 i1a
*** Now move B to D (C is still replicating from B) ***
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
+connection server_4;
UPDATE t2 SET b="j1a" WHERE a=5;
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a b
1 m1
@@ -98,10 +108,13 @@ a b
4 i4
5 j1a
*** Now move C to D, after letting it fall a little behind ***
+connection server_3;
include/stop_slave.inc
+connection server_1;
INSERT INTO t2 VALUES (6, "i6b");
INSERT INTO t2 VALUES (7, "i7b");
include/save_master_gtid.inc
+connection server_3;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
@@ -116,18 +129,22 @@ a b
6 i6b
7 i7b
*** Now change everything back to what it was, to make rpl_end.inc happy
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_MYPORT;
include/start_slave.inc
include/wait_for_slave_to_start.inc
+connection server_3;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_MYPORT;
include/start_slave.inc
include/sync_with_master_gtid.inc
+connection server_4;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
include/start_slave.inc
+connection server_1;
DROP TABLE t1,t2;
include/save_master_gtid.inc
*** A few more checks for BINLOG_GTID_POS function ***
@@ -166,8 +183,10 @@ NULL
Warnings:
Warning 1916 Got overflow when converting '18446744073709551616' to INT. Value truncated.
*** Some tests of @@GLOBAL.gtid_binlog_state ***
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
+connection server_1;
SET @old_state= @@GLOBAL.gtid_binlog_state;
SET GLOBAL gtid_binlog_state = '';
ERROR HY000: This operation is not allowed if any GTID has been logged to the binary log. Run RESET MASTER first to erase the log
@@ -195,6 +214,7 @@ CREATE TABLE t1 (a INT PRIMARY KEY);
SET gtid_seq_no=100;
INSERT INTO t1 VALUES (1);
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1;
@@ -202,9 +222,12 @@ a
1
Gtid_IO_Pos = '0-1-100'
*** Test @@LAST_GTID and MASTER_GTID_WAIT() ***
+connection server_1;
DROP TABLE t1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+connection server_2;
include/stop_slave.inc
+connect m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SELECT @@last_gtid;
@@last_gtid
@@ -224,6 +247,7 @@ COMMIT;
SELECT @@last_gtid;
@@last_gtid
0-1-110
+connect s1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SET @pos= '0-1-110';
SELECT master_gtid_wait(NULL);
master_gtid_wait(NULL)
@@ -246,15 +270,19 @@ master_gtid_wait(@pos, 0.5)
SELECT * FROM t1 ORDER BY a;
a
SELECT master_gtid_wait(@pos);
+connection server_2;
include/start_slave.inc
+connection s1;
master_gtid_wait(@pos)
0
SELECT * FROM t1 ORDER BY a;
a
2
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (3);
+connection s1;
SET @pos= 'POS';
SELECT master_gtid_wait(@pos, 0);
master_gtid_wait(@pos, 0)
@@ -262,7 +290,9 @@ master_gtid_wait(@pos, 0)
SELECT * FROM t1 WHERE a >= 3;
a
SELECT master_gtid_wait(@pos, -1);
+connection server_2;
include/start_slave.inc
+connection s1;
master_gtid_wait(@pos, -1)
0
SELECT * FROM t1 WHERE a >= 3;
@@ -271,15 +301,25 @@ a
SELECT master_gtid_wait('1-1-1', 0);
master_gtid_wait('1-1-1', 0)
0
+connection s1;
SELECT master_gtid_wait('2-1-1,1-1-4,0-1-110');
+connect s2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('0-1-1000', 0.5);
+connect s3,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('0-1-2000');
+connect s4,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('2-1-10');
+connect s5,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('2-1-6', 1);
+connect s6,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('2-1-5');
+connect s7,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('2-1-10');
+connect s8,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('2-1-5,1-1-4,0-1-110');
+connect s9,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('2-1-2');
+connection server_2;
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 0
@@ -300,7 +340,9 @@ SELECT IF(@a <= 100*1000*1000, "OK", CONCAT("Error: wait time ", @a, " is larger
AS Master_gtid_wait_time_as_expected;
Master_gtid_wait_time_as_expected
OK
+connect s10,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SELECT master_gtid_wait('0-1-109');
+connection server_2;
SHOW STATUS LIKE 'Master_gtid_wait_timeouts';
Variable_name Value
Master_gtid_wait_timeouts 0
@@ -321,43 +363,60 @@ SELECT IF(@a BETWEEN 0.4*1000*1000 AND 100*1000*1000, "OK", CONCAT("Error: wait
Master_gtid_wait_time_as_expected
OK
KILL QUERY KILL_ID;
+connection s3;
ERROR 70100: Query execution was interrupted
+connection server_1;
SET gtid_domain_id=2;
SET gtid_seq_no=2;
INSERT INTO t1 VALUES (4);
+connection s9;
master_gtid_wait('2-1-2')
0
+connection server_2;
KILL CONNECTION KILL_ID;
+connection s6;
Got one of the listed errors
+connection server_1;
SET gtid_domain_id=1;
SET gtid_seq_no=4;
INSERT INTO t1 VALUES (5);
SET gtid_domain_id=2;
SET gtid_seq_no=5;
INSERT INTO t1 VALUES (6);
+connection s8;
master_gtid_wait('2-1-5,1-1-4,0-1-110')
0
+connection s1;
master_gtid_wait('2-1-1,1-1-4,0-1-110')
0
+connection s2;
master_gtid_wait('0-1-1000', 0.5)
-1
+connection s5;
master_gtid_wait('2-1-6', 1)
-1
+connection s10;
master_gtid_wait('0-1-109')
0
+connection server_1;
SET gtid_domain_id=2;
SET gtid_seq_no=10;
INSERT INTO t1 VALUES (7);
+connection s4;
master_gtid_wait('2-1-10')
0
+connection s7;
master_gtid_wait('2-1-10')
0
*** Test gtid_slave_pos when used with GTID ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id=2;
SET gtid_seq_no=1000;
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
+connection server_2;
SET sql_slave_skip_counter= 1;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
@@ -367,10 +426,12 @@ SELECT IF(LOCATE("2-1-1001", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
status
Ok
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id=2;
SET gtid_seq_no=1010;
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
+connection server_2;
SET sql_slave_skip_counter= 2;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
@@ -381,11 +442,13 @@ SELECT IF(LOCATE("2-1-1011", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
status
Ok
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id=2;
SET gtid_seq_no=1020;
INSERT INTO t1 VALUES (14);
INSERT INTO t1 VALUES (15);
INSERT INTO t1 VALUES (16);
+connection server_2;
SET sql_slave_skip_counter= 3;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
@@ -398,11 +461,13 @@ SELECT IF(LOCATE("2-1-1022", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
status
Ok
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id=2;
SET gtid_seq_no=1030;
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
+connection server_2;
SET sql_slave_skip_counter= 5;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
@@ -416,6 +481,7 @@ SELECT IF(LOCATE("2-1-1032", @@GLOBAL.gtid_slave_pos)>0, "Ok", CONCAT("ERROR! ex
status
Ok
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id=3;
SET gtid_seq_no=100;
CREATE TABLE t2 (a INT PRIMARY KEY);
@@ -423,6 +489,7 @@ DROP TABLE t2;
SET gtid_domain_id=2;
SET gtid_seq_no=1040;
INSERT INTO t1 VALUES (20);
+connection server_2;
SET @saved_mode= @@GLOBAL.slave_ddl_exec_mode;
SET GLOBAL slave_ddl_exec_mode=STRICT;
SET sql_slave_skip_counter=1;
@@ -456,13 +523,21 @@ status
Ok
SET GLOBAL slave_ddl_exec_mode= @saved_mode;
*** Test GTID-connecting to a master with out-of-order sequence numbers in the binlog. ***
+connection server_1;
SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
INSERT INTO t1 VALUES (31);
+connection server_2;
SET gtid_domain_id= @@GLOBAL.gtid_domain_id;
INSERT INTO t1 VALUES (32);
+connection server_1;
INSERT INTO t1 VALUES (33);
+connection server_2;
+connection server_3;
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (34);
+connection server_2;
+connection server_3;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
a
@@ -470,11 +545,13 @@ a
32
33
34
+connection server_4;
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
a
31
32
33
34
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
index 0c2249f2dce..00cae145673 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
@@ -1,5 +1,6 @@
include/rpl_init.inc [topology=1->2]
*** Test crashing master, causing slave IO thread to reconnect while SQL thread is running ***
+connection server_1;
call mtr.add_suppression("Checking table:");
call mtr.add_suppression("client is using or hasn't closed the table properly");
call mtr.add_suppression("Table .* is marked as crashed and should be repaired");
@@ -8,31 +9,43 @@ flush tables;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 0);
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
+connection server_1;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
+connection server_2;
include/start_slave.inc
+connection server_1;
include/save_master_gtid.inc
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
+connection server_2;
include/sync_with_master_gtid.inc
+connection server_1;
INSERT INTO t1 VALUES (1000, 3);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
+connection server_1;
DROP TABLE t1;
*** Test crashing the master mysqld and check that binlog state is recovered. ***
+connection server_2;
include/stop_slave.inc
RESET MASTER;
SET GLOBAL gtid_slave_pos='';
+connection server_1;
RESET MASTER;
SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid_list # # []
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+connection server_2;
include/start_slave.inc
+connection server_1;
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
@@ -60,6 +73,7 @@ master-bin.000004 #
SHOW BINLOG EVENTS IN 'master-bin.000004' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000004 # Gtid_list # # #
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -69,32 +83,42 @@ a
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_before_write_rpl_slave_state";
START SLAVE;
+connection server_1;
INSERT INTO t1 VALUES (4);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,crash_commit_before";
START SLAVE;
+connection server_1;
INSERT INTO t1 VALUES (5);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,crash_commit_after";
START SLAVE;
+connection server_1;
INSERT INTO t1 VALUES (6);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_before_flush_rli";
START SLAVE;
+connection server_1;
INSERT INTO t1 VALUES (7);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_after_flush_rli";
START SLAVE;
+connection server_1;
INSERT INTO t1 VALUES (8);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -107,20 +131,26 @@ a
7
8
*** MDEV-4725: Incorrect recovery when crash in the middle of writing an event group ***
+connection server_2;
SET GLOBAL debug_dbug="+d,crash_before_writing_xid";
+connection server_1;
INSERT INTO t1 VALUES (9), (10);
+connection server_2;
SHOW VARIABLES like 'gtid_strict_mode';
Variable_name Value
gtid_strict_mode ON
include/start_slave.inc
*** MDEV-6462: Incorrect recovery on a slave reconnecting to crashed master ***
+connection server_1;
set sql_log_bin= 0;
call mtr.add_suppression("Error writing file 'master-bin'");
set sql_log_bin= 1;
+connection server_2;
set sql_log_bin= 0;
call mtr.add_suppression("The server_id of master server changed in the middle of GTID");
call mtr.add_suppression("Unexpected change of master binlog file name in the middle of GTID");
set sql_log_bin= 1;
+connection server_1;
SET GLOBAL debug_dbug="+d,inject_error_writing_xid";
BEGIN;
INSERT INTO t1 VALUES (11);
@@ -137,6 +167,7 @@ a
gtid_check
Binlog pos ok
# Wait 30 seconds for SQL thread to catch up with IO thread
+connection server_2;
SELECT * from t1 WHERE a > 10 ORDER BY a;
a
gtid_check
@@ -146,6 +177,7 @@ Slave pos ok
gtid_check
Current pos ok
# Repeat this with additional transactions on the master
+connection server_1;
SET GLOBAL debug_dbug="+d,inject_error_writing_xid";
BEGIN;
INSERT INTO t1 VALUES (12);
@@ -164,11 +196,13 @@ a
13
14
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * from t1 WHERE a > 10 ORDER BY a;
a
13
14
+connection server_1;
SET GLOBAL debug_dbug="+d,inject_error_writing_xid";
BEGIN;
INSERT INTO t1 VALUES (21);
@@ -189,6 +223,7 @@ Binlog pos ok
gtid_check
Current pos ok
# Wait 30 seconds for SQL thread to catch up with IO thread
+connection server_2;
SELECT * from t1 WHERE a > 10 ORDER BY a;
a
13
@@ -200,6 +235,7 @@ Slave pos ok
gtid_check
Current pos ok
# Repeat this with additional transactions on the master
+connection server_1;
SET GLOBAL debug_dbug="+d,inject_error_writing_xid";
BEGIN;
INSERT INTO t1 VALUES (22);
@@ -217,6 +253,7 @@ a
23
24
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * from t1 WHERE a > 10 ORDER BY a;
a
@@ -225,6 +262,7 @@ a
23
24
# Repeat this with slave restart
+connection server_1;
SET GLOBAL debug_dbug="+d,inject_error_writing_xid";
BEGIN;
INSERT INTO t1 VALUES (25);
@@ -233,9 +271,12 @@ ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device
SET GLOBAL debug_dbug="+d,crash_dispatch_command_before";
COMMIT;
Got one of the listed errors
+connection server_1;
+connection server_2;
# Wait 30 seconds for IO thread to connect and SQL thread to catch up
# with IO thread.
include/stop_slave.inc
+connection server_1;
gtid_check
Binlog pos ok
gtid_check
@@ -251,6 +292,7 @@ a
26
27
include/save_master_gtid.inc
+connection server_2;
gtid_check
Binlog pos ok
gtid_check
@@ -268,7 +310,9 @@ a
26
27
*** MDEV-6391: GTID binlog state not recovered if mariadb-bin.state is removed ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (30);
SET @old_server_id= @@server_id;
SET @old_domain_id= @@gtid_domain_id;
@@ -303,6 +347,7 @@ a
38
39
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
@@ -317,5 +362,7 @@ a
37
38
39
+connection server_1;
DROP TABLE t1;
+connection default;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash_myisam.result b/mysql-test/suite/rpl/r/rpl_gtid_crash_myisam.result
index 55465d7e81b..dc6b22d4acf 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash_myisam.result
@@ -1,24 +1,33 @@
include/rpl_init.inc [topology=1->2]
*** Test crashing master with InnoDB disabled, the binlog gtid state should still be correctly recovered. ***
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=MyISAM;
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
2
+connection server_1;
FLUSH TABLES;
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
+connection server_1;
INSERT INTO t1 VALUES (3);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
+connection server_1;
DROP TABLE t1;
+connection default;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
index a2bf8b567e8..444f6519e65 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorhandling.result
@@ -1,11 +1,16 @@
include/master-slave.inc
[connection master]
*** Test that we check against incorrect table definition for mysql.gtid_slave_pos ***
+connection master;
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
+connection slave;
+connection slave;
include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos CHANGE seq_no seq_no VARCHAR(20);
START SLAVE;
+connection master;
INSERT INTO t1 VALUES (1);
+connection slave;
CALL mtr.add_suppression("Slave: Failed to open mysql.gtid_slave_pos");
include/wait_for_slave_sql_error.inc [errno=1942]
include/stop_slave.inc
@@ -26,6 +31,9 @@ include/stop_slave.inc
ALTER TABLE mysql.gtid_slave_pos DROP PRIMARY KEY;
ALTER TABLE mysql.gtid_slave_pos ADD PRIMARY KEY (domain_id, sub_id);
include/start_slave.inc
+connection master;
+connection slave;
+connection slave;
SELECT * FROM t1;
a
1
@@ -53,11 +61,14 @@ SELECT * FROM t1 ORDER BY a;
a
1
*** Test requesting an explicit GTID position that conflicts with newer GTIDs of our own in the binlog. ***
+connection slave;
include/stop_slave.inc
+connection master;
RESET MASTER;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (4);
include/save_master_gtid.inc
+connection slave;
SET sql_log_bin = 0;
INSERT INTO t1 VALUES (2);
SET sql_log_bin = 1;
@@ -94,8 +105,10 @@ a
4
*** MDEV-4688: Empty value of @@GLOBAL.gtid_slave_pos ***
include/stop_slave.inc
+connection master;
INSERT INTO t1 VALUES (5);
include/save_master_gtid.inc
+connection slave;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_fail_after_record_gtid";
@@ -139,8 +152,10 @@ include/stop_slave.inc
SET GLOBAL gtid_slave_pos = "0-1-3";
START SLAVE;
include/wait_for_slave_to_start.inc
+connection master;
INSERT INTO t1 VALUES (6);
include/save_master_gtid.inc
+connection slave;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -151,21 +166,29 @@ a
5
6
*** MDEV-4278: Slave does not detect that master is not GTID-aware ***
+connection slave;
include/stop_slave.inc
+connection master;
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,simulate_non_gtid_aware_master";
+connection slave;
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1233]
+connection master;
SET GLOBAL debug_dbug= @old_dbug;
INSERT INTO t1 VALUES (7);
+connection slave;
START SLAVE;
SET sql_log_bin=0;
CALL mtr.add_suppression("The slave I/O thread stops because master does not support MariaDB global transaction id");
SET sql_log_bin=1;
*** Test error during record_gtid() (non-xid cases) ***
+connection slave;
include/stop_slave.inc
+connection master;
CREATE TABLE t2 (a INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1);
+connection slave;
SET @old_dbug= @@global.DEBUG_DBUG;
SET GLOBAL debug_dbug="+d,gtid_inject_record_gtid";
START SLAVE;
@@ -180,6 +203,7 @@ SET sql_log_bin=0;
CALL mtr.add_suppression("Slave: Could not update replication slave gtid state");
SET sql_log_bin=1;
*** MDEV-4906: When event apply fails, next SQL thread start erroneously commits the failing GTID to gtid_slave_pos ***
+connection slave;
include/stop_slave.inc
SET sql_log_bin=0;
DELETE FROM t2;
@@ -187,10 +211,12 @@ SET sql_log_bin=1;
SET @old_format=@@binlog_format;
SET GLOBAL binlog_format='row';
include/start_slave.inc
+connection master;
SET @old_format=@@binlog_format;
SET binlog_format='row';
DELETE FROM t2;
SET binlog_format=@old_format;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1032]
result
OK
@@ -206,6 +232,7 @@ CALL mtr.add_suppression("Slave: Can't find record in 't2' Error_code: 1032");
SET sql_log_bin=1;
include/start_slave.inc
SET GLOBAL binlog_format=@old_format;
+connection master;
DROP TABLE t1;
DROP TABLE t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
index e247ea9c2a7..4b3881df434 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
@@ -1,14 +1,19 @@
include/master-slave.inc
[connection master]
*** Test MDEV-6120, output of current GTID when a replication error is logged to the errorlog ***
+connection master;
CREATE TABLE t1(a INT PRIMARY KEY);
+connection slave;
+connection slave;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
+connection master;
INSERT INTO t1 VALUES (1);
SET gtid_seq_no=100;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
+connection slave;
SET sql_log_bin=0;
INSERT INTO t1 VALUES (2);
SET sql_log_bin=1;
@@ -23,10 +28,12 @@ a
2
3
4
+connection master;
SET @dbug_save= @@debug_dbug;
SET debug_dbug= '+d,incident_database_resync_on_replace';
REPLACE INTO t1 VALUES (5);
SET debug_dbug= @dbug_save;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1590]
include/stop_slave.inc
SET sql_slave_skip_counter=1;
@@ -40,5 +47,6 @@ a
5
FOUND /Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error/ in mysqld.2.err
FOUND /Slave SQL: The incident LOST_EVENTS occurred on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_ignored.result b/mysql-test/suite/rpl/r/rpl_gtid_ignored.result
index 80df3af9232..8d5b9be2ca0 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_ignored.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_ignored.result
@@ -1,20 +1,26 @@
include/rpl_init.inc [topology=1->2]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
+connection server_2;
include/stop_slave.inc
SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode=1;
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
+connection server_2;
**** MDEV-4488: GTID position should be updated for events that are ignored due to server id ***
include/stop_slave.inc
CHANGE MASTER TO ignore_server_ids=(1);
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
+connection server_2;
RESULT
OK
SELECT * FROM t1 ORDER BY a;
@@ -28,8 +34,10 @@ OK
SELECT * FROM t1 ORDER BY a;
a
1
+connection server_1;
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
+connection server_2;
RESULT
OK
a
@@ -37,13 +45,16 @@ a
4
5
*** Test the same thing when IO thread exits before SQL thread reaches end of log. ***
+connection server_2;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= "+d,inject_slave_sql_before_apply_event";
CHANGE MASTER TO ignore_server_ids=(1);
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
+connection server_2;
include/wait_for_slave_param.inc [Read_Master_Log_Pos]
STOP SLAVE IO_THREAD;
SET debug_sync = "now SIGNAL continue";
@@ -55,8 +66,10 @@ include/stop_slave.inc
CHANGE MASTER TO ignore_server_ids=();
SET GLOBAL debug_dbug= @old_dbug;
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -64,9 +77,11 @@ a
5
8
9
+connection server_1;
DROP TABLE t1;
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
SET debug_sync = "reset";
+connection server_2;
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
SET debug_sync = "reset";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
index 599c35164dd..15bcb6621ff 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_master_promote.result
@@ -1,4 +1,5 @@
include/rpl_init.inc [topology=1->2, 1->3, 1->4, 1->5]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t4 (a INT, b INT, PRIMARY KEY (a,b)) Engine=InnoDB;
CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100))
@@ -9,14 +10,19 @@ SET s= SUBSTR(s FROM LOCATE(CONCAT(",", d, "-"), s) + 1);
SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
RETURN s;
END|
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_3;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_4;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_5;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_1;
SET gtid_domain_id= 1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
@@ -41,10 +47,15 @@ INSERT INTO t4 VALUES (3, 1);
INSERT INTO t3 VALUES (3);
INSERT INTO t3 VALUES (4);
INSERT INTO t4 VALUES (3, 3);
+connection server_2;
START SLAVE UNTIL master_gtid_pos= "1-1-4,2-1-4,3-1-4";
+connection server_3;
START SLAVE UNTIL master_gtid_pos= "1-1-1,2-1-4,3-1-7";
+connection server_4;
START SLAVE UNTIL master_gtid_pos= "2-1-1,3-1-4,1-1-7";
+connection server_5;
START SLAVE UNTIL master_gtid_pos= "3-1-1,1-1-4,2-1-7";
+connection server_2;
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -63,6 +74,7 @@ a b
1 1
2 1
3 1
+connection server_3;
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -81,6 +93,7 @@ a b
2 1
3 1
3 3
+connection server_4;
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -99,6 +112,7 @@ a b
1 1
1 3
3 1
+connection server_5;
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -118,6 +132,8 @@ a b
2 1
2 3
*** Now replicate all extra changes from 3,4,5 to 2, in preparation for making 2 the new master. ***
+connection server_3;
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_3;
START SLAVE UNTIL master_gtid_pos = "SERVER3_POS";
include/wait_for_slave_to_stop.inc
@@ -141,6 +157,8 @@ a b
2 1
3 1
3 3
+connection server_4;
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_4;
START SLAVE UNTIL master_gtid_pos = "SERVER4_POS";
include/wait_for_slave_to_stop.inc
@@ -167,6 +185,8 @@ a b
2 1
3 1
3 3
+connection server_5;
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_5;
START SLAVE UNTIL master_gtid_pos = "SERVER5_POS";
include/wait_for_slave_to_stop.inc
@@ -197,6 +217,7 @@ a b
3 1
3 3
*** Now make 2 master and point 3,4,5 to the new master 2
+connection server_2;
SET gtid_domain_id= 1;
INSERT INTO t1 values (5);
INSERT INTO t4 values (1,5);
@@ -206,12 +227,17 @@ INSERT INTO t4 values (2,5);
SET gtid_domain_id= 3;
INSERT INTO t3 values (5);
INSERT INTO t4 values (3,5);
+connection server_3;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2;
include/start_slave.inc
+connection server_4;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2;
include/start_slave.inc
+connection server_5;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2;
include/start_slave.inc
+connection server_2;
+connection server_3;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -244,6 +270,7 @@ a b
3 1
3 3
3 5
+connection server_5;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -276,6 +303,7 @@ a b
3 1
3 3
3 5
+connection server_5;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -309,6 +337,7 @@ a b
3 3
3 5
*** Now let the old master join up as slave. ***
+connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
master_user = "root", master_use_gtid = current_pos;
include/start_slave.inc
@@ -345,19 +374,25 @@ a b
3 3
3 5
*** Finally move things back and clean up. ***
+connection server_1;
include/stop_slave.inc
RESET SLAVE ALL;
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
include/start_slave.inc
+connection server_3;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
include/start_slave.inc
+connection server_4;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
include/start_slave.inc
+connection server_5;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1;
include/start_slave.inc
+connection server_1;
SET gtid_domain_id = 0;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
index f983262d3a9..5c80e64dc9b 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4473.result
@@ -1,20 +1,26 @@
include/rpl_init.inc [topology=1->2,1->3]
+connection server_1;
create table t1 (n int);
insert into t1 values (1);
insert into t1 values (2);
+connection server_3;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
+connection server_2;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset slave all;
+connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
master_user='root', MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
include/wait_for_slave_to_start.inc
+connection server_2;
flush logs;
insert into t1 values (3);
insert into t1 values (4);
flush logs;
+connection server_3;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
@@ -43,15 +49,19 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; insert into t1 values (4)
master-bin.000001 # Query # # COMMIT
+connection server_1;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset slave all;
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
master_user = 'root', MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
+connection server_3;
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
+connection server_1;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result
index e7500a57a13..b790ab8462b 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4474.result
@@ -4,10 +4,12 @@ include/rpl_init.inc [topology=1->2->1]
#
# Server 1
# Stop replication 2->1
+connection server_1;
include/stop_slave.inc
#
# Server 2
# Use GTID for replication 1->2
+connection server_2;
include/stop_slave.inc
change master to master_use_gtid=slave_pos;
include/start_slave.inc
@@ -42,6 +44,7 @@ slave-bin.000001 # Xid # # COMMIT /* XID */
#
# Server 1
# Start replication 2->1 using GTID,
+connection server_1;
change master to master_use_gtid=slave_pos;
include/start_slave.inc
select * from t1 order by i;
@@ -51,6 +54,7 @@ i
select * from t2 order by i;
i
1
+connection server_2;
select * from t1 order by i;
i
1
@@ -58,6 +62,8 @@ i
select * from t2 order by i;
i
1
+connection server_1;
drop table t1;
+connection server_2;
drop table t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result
index 4d223452151..c49207b99fa 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4484.result
@@ -1,9 +1,13 @@
include/master-slave.inc
[connection master]
CREATE TABLE t1 (i int) ENGINE=InnoDB;
+connection slave;
*** MDEV-4484, incorrect error handling when entries in gtid_slave_pos not found. ***
TRUNCATE TABLE mysql.gtid_slave_pos;
+connection master;
INSERT INTO t1 VALUES (1);
+connection slave;
+connection slave;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,gtid_slave_pos_simulate_failed_delete";
@@ -12,7 +16,9 @@ CALL mtr.add_suppression("Can't find file");
ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET sql_log_bin= 1;
include/start_slave.inc
+connection master;
INSERT INTO t1 VALUES (2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1942]
STOP SLAVE IO_THREAD;
SELECT domain_id, server_id, seq_no FROM mysql.gtid_slave_pos
@@ -21,7 +27,10 @@ domain_id server_id seq_no
0 1 3
SET GLOBAL debug_dbug= @old_dbug;
include/start_slave.inc
+connection master;
INSERT INTO t1 VALUES (3);
+connection slave;
+connection slave;
SELECT domain_id, server_id, seq_no FROM mysql.gtid_slave_pos
ORDER BY domain_id, sub_id DESC LIMIT 1;
domain_id server_id seq_no
@@ -31,5 +40,6 @@ i
1
2
3
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result
index 34efd43f81b..58953491ba3 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4485.result
@@ -1,15 +1,24 @@
include/rpl_init.inc [topology=1->3]
*** MDEV-4485. Master did not allow slave to connect from the very start (empty GTID pos) if GTIDs from other multi_source master was present ***
+connection server_1;
create table t1 (i int);
+connection server_2;
create table t2 (i int);
+connection server_3;
set default_master_connection = 'm2';
change master to master_host='127.0.0.1', master_port=SERVER_MYPORT_2, master_user='root', master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_2;
insert into t2 values (1);
+connection server_3;
+connection server_1;
drop table t1;
+connection server_2;
drop table t2;
+connection server_3;
set default_master_connection = 'm2';
include/stop_slave.inc
RESET SLAVE ALL;
set default_master_connection = '';
+connection server_1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
index be420cb021b..02018b3a59c 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev4820.result
@@ -1,24 +1,31 @@
include/rpl_init.inc [topology=1->2]
+connection server_2;
include/stop_slave.inc
SET @slave_old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_1;
SET @master_old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
RESET MASTER;
SET GLOBAL gtid_slave_pos= 'OLD_GTID_POS';
+connection server_2;
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (4);
include/save_master_gtid.inc
+connection server_2;
SET sql_log_bin= 0;
CALL mtr.add_suppression("The binlog on the master is missing the GTID");
SET sql_log_bin= 1;
@@ -35,14 +42,18 @@ include/stop_slave.inc
RESET SLAVE ALL;
RESET MASTER;
SET GLOBAL gtid_slave_pos= '0-2-10';
+connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_2,
master_user= 'root', master_use_gtid=CURRENT_POS;
START SLAVE;
+connection server_2;
INSERT INTO t1 VALUES (11);
+connection server_1;
SET sql_log_bin= 0;
CALL mtr.add_suppression("which is not in the master's binlog. Since the master's binlog contains GTIDs with higher sequence numbers, it probably means that the slave has diverged");
SET sql_log_bin= 1;
include/wait_for_slave_io_error.inc [errno=1236]
+connection server_1;
STOP SLAVE SQL_THREAD;
SET GLOBAL gtid_slave_pos= '0-2-10';
SET GLOBAL gtid_strict_mode= 0;
@@ -57,6 +68,7 @@ a
include/stop_slave.inc
RESET SLAVE ALL;
INSERT INTO t1 VALUES (12);
+connection server_2;
INSERT INTO t1 VALUES (22);
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
master_user= 'root', master_use_gtid=CURRENT_POS;
@@ -79,7 +91,9 @@ a
11
12
22
+connection server_2;
SET GLOBAL gtid_strict_mode= @slave_old_strict;
+connection server_1;
DROP TABLE t1;
SET GLOBAL gtid_strict_mode= @master_old_strict;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result b/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result
index f6a4f3e4f7e..9f0ad66bb83 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_mdev9033.result
@@ -1,12 +1,15 @@
include/rpl_init.inc [topology=1->2->3]
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO
MASTER_USE_GTID = SLAVE_POS, IGNORE_DOMAIN_IDS = (2,3);
START SLAVE;
+connection server_3;
include/stop_slave.inc
CHANGE MASTER TO
MASTER_USE_GTID = SLAVE_POS, IGNORE_DOMAIN_IDS = (2,3);
START SLAVE;
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, "m1");
INSERT INTO t1 VALUES (2, "m2"), (3, "m3"), (4, "m4");
@@ -16,6 +19,7 @@ CREATE TABLE t2 (a INT PRIMARY KEY, b VARCHAR(10)) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1, "m1");
INSERT INTO t2 VALUES (2, "m2"), (3, "m3"), (4, "m4");
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a b
@@ -28,6 +32,7 @@ SHOW TABLES;
Tables_in_test
t1
include/save_master_gtid.inc
+connection server_3;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a b
@@ -40,16 +45,21 @@ SHOW TABLES;
Tables_in_test
t1
# Cleanup
+connection server_1;
SET @@session.gtid_domain_id=1;
DROP TABLE t1;
SET @@session.gtid_domain_id=2;
DROP TABLE t2;
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/save_master_gtid.inc
+connection server_3;
include/sync_with_master_gtid.inc
+connection server_2;
STOP SLAVE;
CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = ();
+connection server_3;
STOP SLAVE;
CHANGE MASTER TO MASTER_USE_GTID = NO, IGNORE_DOMAIN_IDS = ();
# End of test.
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_misc.result b/mysql-test/suite/rpl/r/rpl_gtid_misc.result
index cdaac1b1d34..a5c61759ed6 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_misc.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_misc.result
@@ -1,16 +1,21 @@
include/master-slave.inc
[connection master]
*** MDEV-6403: Temporary tables lost at STOP SLAVE in GTID mode if master has not rotated binlog since restart ***
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
+connection slave;
+connection slave;
include/stop_slave.inc
SET sql_log_bin= 0;
INSERT INTO t1 VALUES (1);
SET sql_log_bin= 1;
CHANGE MASTER TO master_use_gtid= current_pos;
+connection master;
CREATE TEMPORARY TABLE t2 LIKE t1;
INSERT INTO t2 VALUE (1);
INSERT INTO t1 SELECT * FROM t2;
DROP TEMPORARY TABLE t2;
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1062]
STOP SLAVE IO_THREAD;
@@ -21,5 +26,6 @@ include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
1
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
index 9aee74d0b46..c42348d40ee 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_nobinlog.result
@@ -1,4 +1,5 @@
include/rpl_init.inc [topology=1->2]
+connection server_1;
SET @old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
select @@global.log_slave_updates;
@@ -7,6 +8,7 @@ select @@global.log_slave_updates;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
INSERT INTO t1 VALUES (1, 1);
INSERT INTO t1 VALUES (2, 1);
+connection server_2;
SET @old_strict= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
select @@global.log_slave_updates;
@@ -17,10 +19,12 @@ a b
1 1
2 1
include/stop_slave.inc
+connection server_1;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SLAVE_PORT,
master_user = 'root', master_use_gtid = current_pos;
START SLAVE;
include/wait_for_slave_to_start.inc
+connection server_2;
INSERT INTO t1 VALUES (3, 2);
INSERT INTO t1 VALUES (4, 2);
include/save_master_gtid.inc
@@ -32,6 +36,7 @@ slave-bin.000001 # Query # # COMMIT
slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (4, 2)
slave-bin.000001 # Query # # COMMIT
+connection server_1;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a b
@@ -44,6 +49,7 @@ RESET SLAVE;
INSERT INTO t1 VALUES (5, 1);
INSERT INTO t1 VALUES (6, 1);
include/save_master_gtid.inc
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
master_use_gtid = current_pos;
START SLAVE;
@@ -57,6 +63,7 @@ a b
5 1
6 1
SET GLOBAL gtid_strict_mode= @old_strict;
+connection server_1;
SET GLOBAL gtid_strict_mode= @old_strict;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
index 001362825f9..d5037f8cf94 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_reconnect.result
@@ -1,9 +1,13 @@
include/rpl_init.inc [topology=1->2]
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid= current_pos;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT);
FLUSH LOGS;
+connection server_2;
+connection server_1;
SET gtid_domain_id=10;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
@@ -11,6 +15,7 @@ SET gtid_seq_no=100;
INSERT INTO t1 VALUES (3);
INSERT INTO t1 VALUES (4);
INSERT INTO t1 VALUES (5);
+connection server_2;
include/stop_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -19,11 +24,13 @@ a
3
4
5
+connection server_1;
include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (10);
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
+connection server_2;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -37,6 +44,7 @@ include/stop_slave.inc
TRUNCATE t1;
RESET MASTER;
SET GLOBAL gtid_slave_pos= "";
+connection server_1;
SET GLOBAL debug_dbug= @old_debug;
TRUNCATE t1;
RESET MASTER;
@@ -55,6 +63,7 @@ INSERT INTO t1 VALUES (3);
SET gtid_domain_id=11;
SET gtid_seq_no=200;
INSERT INTO t1 VALUES (13);
+connection server_2;
START SLAVE UNTIL master_gtid_pos="10-1-50,11-1-200";
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
@@ -63,10 +72,12 @@ a
11
12
13
+connection server_1;
include/kill_binlog_dump_threads.inc
INSERT INTO t1 VALUES (20);
SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
+connection server_2;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -81,6 +92,7 @@ include/stop_slave.inc
TRUNCATE t1;
RESET MASTER;
SET GLOBAL gtid_slave_pos= "";
+connection server_1;
SET GLOBAL debug_dbug= @old_debug;
TRUNCATE t1;
RESET MASTER;
@@ -103,6 +115,7 @@ INSERT INTO t1 VALUES (13);
SET gtid_domain_id= 10;
SET GLOBAL debug_dbug="+d,dummy_disable_default_dbug_output";
SET GLOBAL debug_dbug="+d,gtid_force_reconnect_at_10_1_100";
+connection server_2;
START SLAVE UNTIL master_gtid_pos="9-1-50,10-1-200";
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
@@ -111,8 +124,10 @@ a
11
12
13
+connection server_1;
SET GLOBAL debug_dbug= @old_debug;
INSERT INTO t1 VALUES (20);
+connection server_2;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -124,10 +139,12 @@ a
13
20
*** Test when slave IO thread needs to reconnect in the middle of an event group. ***
+connection server_2;
include/stop_slave.inc
TRUNCATE t1;
RESET MASTER;
SET GLOBAL gtid_slave_pos= "";
+connection server_1;
SET GLOBAL debug_dbug= @old_debug;
TRUNCATE t1;
RESET MASTER;
@@ -152,6 +169,7 @@ INSERT INTO t2 VALUES (27);
INSERT INTO t2 VALUES (28);
INSERT INTO t2 VALUES (29);
COMMIT;
+connection server_2;
include/start_slave.inc
SELECT * FROM t2 ORDER BY a;
a
@@ -168,6 +186,8 @@ a
27
28
29
+connection server_1;
SET GLOBAL debug_dbug= @old_debug;
+connection server_1;
DROP TABLE t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_sort.result b/mysql-test/suite/rpl/r/rpl_gtid_sort.result
index add24522b90..34c0fd32766 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_sort.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_sort.result
@@ -1,5 +1,6 @@
include/rpl_init.inc [topology=1->2]
*** Test connecting with empty GTID state to start from very beginning of binlog ***
+connection server_2;
include/stop_slave.inc
RESET MASTER;
RESET SLAVE;
@@ -15,6 +16,7 @@ gtid_slave_pos
SHOW VARIABLES LIKE 'gtid_binlog_state';
Variable_name Value
gtid_binlog_state
+connection server_1;
RESET MASTER;
FLUSH LOGS;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -42,6 +44,7 @@ gtid_slave_pos
SHOW VARIABLES LIKE 'gtid_binlog_state';
Variable_name Value
gtid_binlog_state 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-1
+connection server_2;
SHOW VARIABLES LIKE 'gtid_binlog_pos';
Variable_name Value
gtid_binlog_pos
@@ -95,5 +98,6 @@ gtid_slave_pos 0-1-1,1-1-1,10-1-1,100-1-1,99999-1-1,2147483648-1-1,4294967295-1-
SHOW VARIABLES LIKE 'gtid_binlog_state';
Variable_name Value
gtid_binlog_state 0-1-1,1-1-1,10-1-1,89-2-1,100-1-1,1000-2-1,99999-1-1,10100000-2-1,2147483648-1-1,4294967295-1-1
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
index 9ff51ff6b8a..a7e0a66e078 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
@@ -1,29 +1,36 @@
include/rpl_init.inc [topology=1->2]
*** Test connecting with empty GTID state to start from very beginning of binlog ***
+connection server_2;
include/stop_slave.inc
RESET MASTER;
RESET SLAVE;
+connection server_1;
RESET MASTER;
FLUSH LOGS;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+connection server_2;
SET GLOBAL gtid_slave_pos="";
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
SELECT * FROM t1;
a
+connection server_1;
INSERT INTO t1 VALUES (1);
+connection server_2;
SELECT * FROM t1;
a
1
include/stop_slave.inc
*** Test that master gives error when slave asks for empty gtid pos and binlog files have been purged. ***
+connection server_1;
FLUSH LOGS;
INSERT INTO t1 VALUES (2);
include/wait_for_purge.inc "master-bin.000003"
show binary logs;
Log_name File_size
master-bin.000003 #
+connection server_2;
SET GLOBAL gtid_slave_pos="";
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
@@ -42,8 +49,10 @@ call mtr.add_suppression('Could not find GTID state requested by slave in any bi
SET sql_log_bin=1;
*** Test that we give warning when explict @@gtid_slave_pos=xxx that conflicts with what is in our binary log ***
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES(3);
include/save_master_gtid.inc
+connection server_2;
SET GLOBAL gtid_slave_pos='0-1-3';
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_USE_GTID=CURRENT_POS;
@@ -55,8 +64,10 @@ a
2
3
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (4);
include/save_master_gtid.inc
+connection server_2;
INSERT INTO t1 VALUES (10);
DELETE FROM t1 WHERE a=10;
SET GLOBAL gtid_slave_pos='0-1-4';
@@ -72,29 +83,39 @@ a
2
3
4
+connection server_1;
DROP TABLE t1;
+connection server_2;
*** MDEV-4275: I/O thread restart duplicates events in relay log ***
+connection server_2;
include/stop_slave.inc
RESET SLAVE ALL;
RESET MASTER;
+connection server_1;
RESET MASTER;
+connection server_2;
SET GLOBAL gtid_slave_pos='';
CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=current_pos;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
+connection server_2;
SELECT * FROM t1;
a
1
include/stop_slave_io.inc
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
+connection server_1;
INSERT INTO t1 VALUES (2);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
2
*** MDEV-4329: GTID_SLAVE_POS='' is not checked for conflicts with binlog ***
+connection server_2;
include/stop_slave.inc
DROP TABLE t1;
RESET SLAVE;
@@ -108,6 +129,7 @@ SELECT * FROM t1 ORDER BY a;
a
1
2
+connection server_2;
include/stop_slave.inc
SET SQL_LOG_BIN=0;
DROP TABLE t1;
@@ -130,8 +152,10 @@ include/wait_for_slave_sql_error.inc [errno=1050]
STOP SLAVE IO_THREAD;
CHANGE MASTER TO MASTER_USE_GTID=CURRENT_POS;
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES(3);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -142,11 +166,14 @@ SET SQL_LOG_BIN=0;
call mtr.add_suppression("Slave: Table 't1' already exists error.* 1050");
SET SQL_LOG_BIN=1;
*** Test reconnecting slave with GTID after purge logs on master. ***
+connection server_1;
FLUSH LOGS;
INSERT INTO t1 VALUES (4);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
+connection server_1;
FLUSH LOGS;
FLUSH LOGS;
include/wait_for_purge.inc "master-bin.000004"
@@ -155,6 +182,7 @@ Log_name File_size
master-bin.000004 #
INSERT INTO t1 VALUES (5);
include/save_master_gtid.inc
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT;
include/start_slave.inc
include/sync_with_master_gtid.inc
@@ -166,13 +194,16 @@ a
4
5
*** Test modifying binlog on slave and the effect on GTID state. ***
+connection server_2;
include/stop_slave.inc
RESET MASTER;
SET GLOBAL gtid_slave_pos="";
+connection server_1;
RESET MASTER;
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (10);
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1;
@@ -203,19 +234,24 @@ SELECT '0-1-2' AS Gtid_Slave_Pos;
Gtid_Slave_Pos
0-1-2
*** MDEV-4483: Slave loses traditional master coordinates immediately on CHANGE MASTER TO MASTER_USE_GTID = 1 ***
+connection server_2;
include/stop_slave.inc
DROP TABLE t1;
RESET SLAVE ALL;
RESET MASTER;
SET GLOBAL gtid_slave_pos= "";
CHANGE MASTER TO master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root', master_use_gtid=no, master_log_file="", master_log_pos= 4;
+connection server_1;
DROP TABLE t1;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY);
+connection server_2;
include/start_slave.inc
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
+connection server_2;
START SLAVE UNTIL master_log_file='LOG_FILE1', master_log_pos=LOG_POS1;
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
@@ -238,6 +274,8 @@ SELECT * FROM t1 ORDER BY a;
a
1
2
+connection server_1;
DROP TABLE t1;
+connection server_2;
set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
index 60c8e4666b9..db2f40fd495 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
@@ -1,11 +1,14 @@
include/rpl_init.inc [topology=1->2]
*** Test normal shutdown/restart of slave server configured as a GTID slave. ***
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
+connection server_2;
include/stop_slave.inc
Master_Log_File = 'master-bin.000001'
Using_Gtid = 'No'
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_1;
FLUSH LOGS;
include/wait_for_purge.inc "master-bin.000002"
show binary logs;
@@ -19,6 +22,7 @@ show binary logs;
Log_name File_size
master-bin.000002 #
master-bin.000003 #
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -26,6 +30,7 @@ a
2
3
*** Test normal shutdown/restart of master server, check binlog state is preserved. ***
+connection server_1;
SET SESSION gtid_domain_id= 1;
INSERT INTO t1 VALUES (4);
SHOW BINLOG EVENTS IN 'master-bin.000003' LIMIT 1,1;
@@ -35,6 +40,8 @@ FLUSH LOGS;
SHOW BINLOG EVENTS IN 'master-bin.000004' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000004 # Gtid_list # # #
+connection default;
+connection server_1;
SHOW BINLOG EVENTS IN 'master-bin.000005' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000005 # Gtid_list # # #
@@ -46,6 +53,7 @@ master-bin.000004 #
master-bin.000005 #
INSERT INTO t1 VALUES(5);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -63,7 +71,9 @@ OK
SELECT IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2));
IF(@current_pos1=@current_pos2, "OK", CONCAT(@current_pos1, " != ", @current_pos2))
OK
+connection server_1;
INSERT INTO t1 VALUES (6);
+connection server_2;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -74,7 +84,9 @@ a
5
6
*** MDEV-4490: Old-style master position points at the last GTID event after slave restart ***
+connection server_1;
INSERT INTO t1 VALUES (7);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -85,6 +97,8 @@ a
6
7
include/wait_for_slave_to_start.inc
+connection server_1;
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -95,10 +109,13 @@ a
6
7
*** MDEV-4486: Allow to start old-style replication even if mysql.gtid_slave_pos is unavailable
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid= no;
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (8);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -122,7 +139,9 @@ SET sql_log_bin=1;
include/start_slave.inc
Warnings:
Error 1286 Unknown storage engine 'InnoDB'
+connection server_1;
INSERT INTO t1 VALUES (9);
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -138,7 +157,9 @@ SET sql_log_bin= 0;
ALTER TABLE mysql.gtid_slave_pos ENGINE=MyISAM;
SET sql_log_bin= 1;
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (10);
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid= slave_pos;
include/start_slave.inc
@@ -147,19 +168,24 @@ SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id COUNT(*)
0 2
1 2
+connection server_1;
INSERT INTO t1 VALUES (11);
+connection server_2;
SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id COUNT(*)
0 2
1 2
include/start_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (12);
INSERT INTO t1 VALUES (13);
+connection server_2;
SELECT domain_id, COUNT(*) FROM mysql.gtid_slave_pos GROUP BY domain_id;
domain_id COUNT(*)
0 2
1 2
*** MDEV-4650: show variables; ERROR 1946 (HY000): Failed to load replication slave GTID position ***
+connection server_2;
SET sql_log_bin=0;
RENAME TABLE mysql.gtid_slave_pos TO mysql.gtid_slave_pos_old;
SET sql_log_bin=1;
@@ -185,5 +211,6 @@ SHOW VARIABLES LIKE 'gtid_slave_pos';
Variable_name Value
gtid_slave_pos 0-1-2
include/start_slave.inc
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_strict.result b/mysql-test/suite/rpl/r/rpl_gtid_strict.result
index 150ea000ff2..1088eff1932 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_strict.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_strict.result
@@ -1,15 +1,18 @@
include/rpl_init.inc [topology=1->2]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
SET sql_log_bin= 0;
call mtr.add_suppression("Error writing file .*errno: 1950");
SET sql_log_bin= 1;
SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode= 1;
+connection server_2;
include/stop_slave.inc
SET @old_gtid_strict_mode= @@GLOBAL.gtid_strict_mode;
SET GLOBAL gtid_strict_mode=1;
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
include/show_binlog_events.inc
@@ -100,6 +103,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO t2 VALUES (2)
master-bin.000001 # Query # # COMMIT
*** Test that slave stops if it tries to apply a GTID that would create out-of-order binlog GTID sequence numbers. ***
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -112,7 +116,9 @@ call mtr.add_suppression("An attempt was made to binlog GTID .* which would crea
call mtr.add_suppression("The binlog on the master is missing the GTID [-0-9]+ requested by the slave");
SET sql_log_bin= 1;
INSERT INTO t1 VALUES (5);
+connection server_1;
INSERT INTO t1 VALUES (6);
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1950]
STOP SLAVE IO_THREAD;
SET GLOBAL gtid_strict_mode=0;
@@ -125,7 +131,9 @@ a
5
6
INSERT INTO t1 VALUES (7);
+connection server_1;
CREATE TABLE t3 (a INT PRIMARY KEY);
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1950]
SHOW CREATE TABLE t3;
ERROR 42S02: Table 'test.t3' doesn't exist
@@ -140,7 +148,9 @@ Create Table CREATE TABLE `t3` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES (8);
+connection server_1;
INSERT INTO t2 VALUES (3);
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1950]
SELECT * FROM t2 ORDER BY a;
a
@@ -154,11 +164,14 @@ a
2
3
*** Check slave requests starting from a hole on the master. ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (10);
SET gtid_seq_no= 100;
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
+connection server_2;
SET GLOBAL gtid_slave_pos= "0-1-50";
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1236]
@@ -176,7 +189,9 @@ a
11
12
SET GLOBAL gtid_strict_mode= 1;
+connection server_1;
DROP TABLE t1, t2, t3;
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
+connection server_2;
SET GLOBAL gtid_strict_mode= @old_gtid_strict_mode;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_until.result b/mysql-test/suite/rpl/r/rpl_gtid_until.result
index c23faecc674..886f6cfd2cb 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_until.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_until.result
@@ -1,4 +1,5 @@
include/rpl_init.inc [topology=1->2]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE FUNCTION extract_gtid(d VARCHAR(100), s VARCHAR(100))
RETURNS VARCHAR(100) DETERMINISTIC
@@ -8,6 +9,7 @@ SET s= SUBSTR(s FROM LOCATE(CONCAT(",", d, "-"), s) + 1);
SET s= SUBSTR(s FROM 1 FOR LOCATE(",", s) - 1);
RETURN s;
END|
+connection server_2;
START SLAVE UNTIL master_gtid_pos = "";
ERROR HY000: Slave is already running
include/stop_slave_io.inc
@@ -22,9 +24,11 @@ include/stop_slave_io.inc
START SLAVE UNTIL master_gtid_pos = "";
ERROR HY000: START SLAVE UNTIL master_gtid_pos requires that slave is using GTID
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
+connection server_2;
START SLAVE UNTIL master_gtid_pos = "0-1-100,1-1-100,2-2-200,1-3-100,4-4-400";
ERROR HY000: GTID 1-3-100 and 1-1-100 conflict (duplicate domain id 1)
START SLAVE UNTIL master_log_file = "master-bin.000001", master_log_pos = 4, master_gtid_pos = "";
@@ -39,6 +43,8 @@ SELECT * FROM t1;
a
1
include/start_slave.inc
+connection server_1;
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -48,10 +54,14 @@ START SLAVE UNTIL master_gtid_pos = "1-10-100,2-20-200,0-1-300";
include/wait_for_slave_to_start.inc
Using_Gtid = 'Current_Pos'
Until_Condition = 'Gtid'
+connection server_1;
INSERT INTO t1 VALUES (3);
DELETE FROM t1 WHERE a=3;
+connection server_2;
include/stop_slave.inc
*** Test UNTIL condition in an earlier binlog than the start GTID. ***
+connection server_2;
+connection server_1;
SET gtid_domain_id = 1;
INSERT INTO t1 VALUES (3);
SET gtid_domain_id = 2;
@@ -79,6 +89,7 @@ master-bin.000001 #
master-bin.000002 #
master-bin.000003 #
master-bin.000004 #
+connection server_2;
START SLAVE UNTIL master_gtid_pos='1-1-3,2-1-4';
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
@@ -139,11 +150,14 @@ a
5
6
*** Test when the UNTIL position is right at the end of the binlog file prior to the starting position ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
FLUSH LOGS;
SET gtid_domain_id = 1;
INSERT INTO t1 VALUES (7);
SET gtid_domain_id = 0;
+connection server_2;
START SLAVE UNTIL master_gtid_pos='1-1-4';
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
@@ -165,9 +179,12 @@ a
6
7
*** Test when UNTIL condition is after a stand-alone event (not a transaction). ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
CREATE TABLE t3 (a INT);
DROP TABLE t3;
+connection server_2;
START SLAVE UNTIL master_gtid_pos='UNTIL_CONDITION';
include/wait_for_slave_to_stop.inc
SHOW CREATE TABLE t3;
@@ -177,10 +194,12 @@ t3 CREATE TABLE `t3` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
include/start_slave.inc
*** Test UNTIL condition that has not yet been logged. ***
+connection server_2;
include/stop_slave.inc
RESET SLAVE ALL;
RESET MASTER;
SET GLOBAL gtid_slave_pos='';
+connection server_1;
RESET MASTER;
INSERT INTO t1 VALUES (10);
INSERT INTO t1 VALUES (11);
@@ -188,12 +207,15 @@ INSERT INTO t1 VALUES (12);
DELETE FROM t1 WHERE a >= 10;
RESET MASTER;
INSERT INTO t1 VALUES (10);
+connection server_2;
CHANGE MASTER TO master_host = '127.0.0.1', master_port = SERVER_MYPORT_1,
master_user = "root", master_use_gtid = current_pos;
START SLAVE UNTIL master_gtid_pos = '0-1-2';
include/wait_for_slave_to_start.inc
+connection server_1;
INSERT INTO t1 VALUES (11);
INSERT INTO t1 VALUES (12);
+connection server_2;
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 ORDER BY a;
a
@@ -219,6 +241,7 @@ a
10
11
12
+connection server_1;
DROP TABLE t1;
DROP TABLE t2;
DROP FUNCTION extract_gtid;
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat.result b/mysql-test/suite/rpl/r/rpl_heartbeat.result
index b0f36558d10..c551d613efc 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat.result
@@ -1,4 +1,8 @@
+connect master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK;
+connection master;
reset master;
+connection slave;
set @restore_slave_net_timeout= @@global.slave_net_timeout;
set @@global.slave_net_timeout= 10;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
@@ -10,6 +14,7 @@ ERROR HY000: The requested value for the heartbeat period is either negative or
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 5.000
+connection slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.0009999;
Warnings:
Warning 1703 The requested value for the heartbeat period is less than 1 millisecond. The value is reset to 0, meaning that heartbeating will effectively be disabled.
@@ -42,20 +47,26 @@ Variable_name Slave_heartbeat_period
Value 4.000
set @@global.slave_net_timeout= 3 /* must be a warning */;
reset slave;
+connection master;
drop table if exists t1;
+connection slave;
set @@global.slave_net_timeout= 10;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root', master_heartbeat_period= 0.5;
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.500
start slave;
+connection master;
create table t1 (f1 int);
+connection slave;
include/check_slave_param.inc [Relay_Log_File]
show status like 'Slave_heartbeat_period';;
Variable_name Slave_heartbeat_period
Value 0.500
A heartbeat has been received by the slave
+connection master;
drop table t1;
+connection slave;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
include/stop_slave.inc
End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
index e0e6df064b9..92829cccb17 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_2slaves.result
@@ -2,40 +2,46 @@ include/rpl_init.inc [topology=1->2,1->3]
include/rpl_connect.inc [creating master]
include/rpl_connect.inc [creating slave_1]
include/rpl_connect.inc [creating slave_2]
+connection slave_1;
include/stop_slave.inc
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 0.1;
include/start_slave.inc
+connection slave_2;
include/stop_slave.inc
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD = 1;
include/start_slave.inc
+connection slave_1;
Slave has received heartbeat event
+connection slave_2;
include/assert.inc [slave_1 should have received more heartbeats than slave_2]
include/rpl_stop_slaves.inc
include/rpl_change_topology.inc [new topology=1->3->2]
include/rpl_start_slaves.inc
+connection slave_1;
include/stop_slave.inc
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
slave_1 has received heartbeat event
-[on master]
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on master', '');
SHOW TABLES;
Tables_in_test
t1
-[on slave_2]
+connection slave_2;
SHOW TABLES;
Tables_in_test
t1
-[on slave_1]
+connection slave_1;
SHOW TABLES;
Tables_in_test
-[on master]
+connection master;
creating updates on master and send to slave_2 during 5 second
-[on slave_1]
+connection slave_1;
include/assert.inc [slave_1 should have received heartbeats]
*** Clean up ***
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
index 91ed6d7a0cb..d087fe3b344 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_basic.result
@@ -2,13 +2,16 @@ include/master-slave.inc
[connection master]
*** Preparing ***
+connection slave;
include/stop_slave.inc
RESET SLAVE;
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
+connection master;
RESET MASTER;
SET @restore_slave_net_timeout=@@global.slave_net_timeout;
SET @restore_event_scheduler=@@global.event_scheduler;
+connection slave;
*** Default value ***
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root';
slave_net_timeout/slave_heartbeat_timeout=2.0000
@@ -62,11 +65,15 @@ SET @@global.slave_net_timeout=@restore_slave_net_timeout;
RESET SLAVE;
*** Update slave_net_timeout on master ***
+connection master;
SET @@global.slave_net_timeout=500;
+connection slave;
SET @@global.slave_net_timeout=200;
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20;
include/start_slave.inc
+connection master;
+connection slave;
SHOW VARIABLES LIKE 'slave_net_timeout';
Variable_name Value
slave_net_timeout 200
@@ -76,12 +83,16 @@ Slave_heartbeat_period 100.000
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
include/stop_slave.inc
RESET SLAVE;
+connection master;
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
*** Start/stop slave ***
+connection slave;
SET @@global.slave_net_timeout=100;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=20;
include/start_slave.inc
+connection master;
+connection slave;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 20.000
@@ -91,6 +102,7 @@ Variable_name Value
Slave_heartbeat_period 20.000
*** Reload slave ***
+connection slave;
SET @@global.slave_net_timeout=50;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=30;
include/rpl_restart_server.inc [server_number=2]
@@ -108,6 +120,8 @@ SHOW STATUS LIKE 'slave_received_heartbeats';
Variable_name Value
Slave_received_heartbeats 0
include/start_slave.inc
+connection master;
+connection slave;
SHOW GLOBAL STATUS LIKE 'slave_heartbeat_period';
Variable_name Value
Slave_heartbeat_period 0.000
@@ -172,6 +186,8 @@ RESET SLAVE;
*** Running slave ***
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
+connection master;
+connection slave;
Heartbeat event received
*** Stopped slave ***
@@ -201,9 +217,13 @@ include/wait_for_slave_sql_to_start.inc
Heartbeat event received
*** Stopped SQL thread by error ***
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
+connection slave;
INSERT INTO t1 VALUES (1, 'on slave', NULL);
+connection master;
INSERT INTO t1 VALUES (1, 'on master', NULL);
+connection slave;
call mtr.add_suppression("Slave SQL.*Duplicate entry .1. for key .PRIMARY.. on query.* error.* 1062");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
Heartbeat events are received while sql thread stopped (1 means 'yes'): 1
@@ -211,32 +231,42 @@ include/stop_slave.inc
DROP TABLE t1;
*** Master send to slave ***
+connection master;
CREATE EVENT e1
ON SCHEDULE EVERY 1 SECOND
DO
BEGIN
UPDATE test.t1 SET a = a + 1 WHERE a < 10;
END|
+connection slave;
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=5;
include/start_slave.inc
+connection master;
SET @@global.event_scheduler=1;
+connection slave;
Number of received heartbeat events: 0
+connection master;
DELETE FROM t1;
DROP EVENT e1;
+connection slave;
*** Flush logs on slave ***
STOP SLAVE;
RESET SLAVE;
DROP TABLE t1;
+connection master;
DROP TABLE t1;
RESET MASTER;
+connection slave;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.5;
include/start_slave.inc
Heartbeat events are received while rotation of relay logs (1 means 'yes'): 1
*** Compressed protocol ***
+connection master;
SET @@global.slave_compressed_protocol=1;
+connection slave;
include/stop_slave.inc
RESET SLAVE;
SET @@global.slave_compressed_protocol=1;
@@ -244,17 +274,22 @@ CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='
include/start_slave.inc
Heartbeat event received
SET @@global.slave_compressed_protocol=0;
+connection master;
SET @@global.slave_compressed_protocol=0;
*** Reset master ***
+connection slave;
STOP SLAVE;
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
+connection master;
RESET MASTER;
+connection slave;
Heartbeat events are received after reset of master (1 means 'yes'): 1
*** Reload master ***
+connection slave;
STOP SLAVE;
RESET SLAVE;
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_PORT, MASTER_USER='root', MASTER_CONNECT_RETRY=20, MASTER_HEARTBEAT_PERIOD=0.1;
@@ -268,24 +303,32 @@ Heartbeat event received
include/rpl_reset.inc
include/stop_slave.inc
include/rpl_change_topology.inc [new topology=1->2->1]
+connection master;
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=1;
include/start_slave.inc
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10));
INSERT INTO t1 VALUES(1, 'on master');
+connection slave;
CHANGE MASTER TO MASTER_HEARTBEAT_PERIOD=0.1;
include/start_slave.inc
INSERT INTO t1 VALUES(2, 'on slave');
+connection master;
SELECT * FROM t1 ORDER BY a;
a b
1 on master
2 on slave
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 on master
2 on slave
+connection master;
Heartbeat event received on master
+connection slave;
Heartbeat event received on slave
*** Clean up ***
+connection master;
DROP TABLE t1;
+connection slave;
SET @@global.slave_net_timeout=@restore_slave_net_timeout;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result b/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result
index b9dec686e4a..cf26c3bf04a 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_debug.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
set @restore_slave_net_timeout= @@global.slave_net_timeout;
set @@global.slave_net_timeout= 10;
@@ -11,13 +12,18 @@ SET GLOBAL debug_dbug="+d,simulate_slave_heartbeat_network_error";
CALL mtr.add_suppression('SET @master_heartbeat_period to master failed with error');
CALL mtr.add_suppression('Master command COM_REGISTER_SLAVE failed: failed registering on master, reconnecting to try again');
include/start_slave.inc
+connection master;
drop table if exists t1;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1);
+connection slave;
+connection slave;
SELECT * FROM t1;
a
1
+connection master;
drop table t1;
+connection slave;
include/stop_slave.inc
SET GLOBAL debug_dbug=@save_dbug;
set @@global.slave_net_timeout= @restore_slave_net_timeout;
diff --git a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
index a73c99bd99b..ff7178ae700 100644
--- a/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_heartbeat_ssl.result
@@ -2,6 +2,8 @@ include/master-slave.inc
[connection master]
*** Heartbeat over SSL ***
+connection master;
+connection slave;
include/stop_slave.inc
RESET SLAVE;
CHANGE MASTER TO
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime.result b/mysql-test/suite/rpl/r/rpl_hrtime.result
index 697cc7aa7fd..99d412d4843 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime.result
@@ -16,6 +16,8 @@ a b c
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
+connection slave;
+connection slave;
set time_zone='+03:00';
select * from t1;
a b c
@@ -24,6 +26,7 @@ a b c
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
+connection master;
drop table t1;
include/rpl_end.inc
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
diff --git a/mysql-test/suite/rpl/r/rpl_hrtime_row.result b/mysql-test/suite/rpl/r/rpl_hrtime_row.result
index 458002b0b79..9f6ac704ff3 100644
--- a/mysql-test/suite/rpl/r/rpl_hrtime_row.result
+++ b/mysql-test/suite/rpl/r/rpl_hrtime_row.result
@@ -16,6 +16,8 @@ a b c
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
+connection slave;
+connection slave;
set time_zone='+03:00';
select * from t1;
a b c
@@ -24,5 +26,6 @@ a b c
2022-02-02 02:02:02.6543 2022-02-02 02:02:02 2022-02-02 02:02:02.00
2022-02-02 02:02:02.6543 0 0000-00-00 00:00:00.00
0000-00-00 00:00:00.0000 0 2022-02-02 02:02:02.65
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_idempotency.result b/mysql-test/suite/rpl/r/rpl_idempotency.result
index 38b955d7697..a31657d3ea1 100644
--- a/mysql-test/suite/rpl/r/rpl_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_idempotency.result
@@ -4,14 +4,18 @@ call mtr.add_suppression("Slave SQL.*Can.t find record in .t[12].* error.* 1032"
call mtr.add_suppression("Slave SQL.*Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451");
call mtr.add_suppression("Slave SQL.*Cannot add or update a child row: a foreign key constraint fails .* error.* 1452");
call mtr.add_suppression("Slave SQL.*Could not execute Write_rows event on table test.* Duplicate entry .1. for key .PRIMARY.* error.* 1062");
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
+connection slave;
SET @old_slave_exec_mode= @@global.slave_exec_mode;
SET @@global.slave_exec_mode= IDEMPOTENT;
+connection slave;
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
+connection master;
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
SELECT * FROM t1 ORDER BY a;
@@ -22,6 +26,7 @@ SELECT * FROM t2 ORDER BY a;
a
-3
-1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
-3
@@ -32,20 +37,24 @@ a
-1
include/check_slave_no_error.inc
INSERT IGNORE INTO t1 VALUES (-2);
+connection master;
INSERT IGNORE INTO t1 VALUES (-2);
SELECT * FROM t1 ORDER BY a;
a
-3
-2
-1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
-3
-2
-1
include/check_slave_no_error.inc
+connection slave;
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
+connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
SELECT * FROM t1 ORDER BY a;
@@ -57,6 +66,7 @@ SELECT * FROM t2 ORDER BY a;
a
-3
1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
-3
@@ -67,6 +77,8 @@ a
-3
1
include/check_slave_no_error.inc
+connection master;
DROP TABLE t1, t2;
+connection slave;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_grant.result b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
index 40baaa60b01..f3d69112efd 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_grant.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_grant.result
@@ -1,21 +1,25 @@
include/master-slave.inc
[connection master]
+connection master;
set global sql_mode="";
set local sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+connection slave;
set global sql_mode="";
set local sql_mode="";
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+connection master;
grant select on *.* to rpl_ignore_grant@localhost;
grant drop on test.* to rpl_ignore_grant@localhost;
show grants for rpl_ignore_grant@localhost;
Grants for rpl_ignore_grant@localhost
GRANT SELECT ON *.* TO 'rpl_ignore_grant'@'localhost'
GRANT DROP ON `test`.* TO 'rpl_ignore_grant'@'localhost'
+connection slave;
show grants for rpl_ignore_grant@localhost;
ERROR 42000: There is no such grant defined for user 'rpl_ignore_grant' on host 'localhost'
select count(*) from mysql.user where user=_binary'rpl_ignore_grant';
@@ -25,16 +29,21 @@ select count(*) from mysql.db where user=_binary'rpl_ignore_grant';
count(*)
0
grant select on *.* to rpl_ignore_grant@localhost;
+connection master;
set password for rpl_ignore_grant@localhost=password("does it work?");
+connection slave;
select password<>_binary'' from mysql.user where user=_binary'rpl_ignore_grant';
password<>_binary''
0
+connection master;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
+connection slave;
delete from mysql.user where user=_binary'rpl_ignore_grant';
delete from mysql.db where user=_binary'rpl_ignore_grant';
flush privileges;
set global sql_mode=default;
+connection master;
set global sql_mode=default;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_revoke.result b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
index 84e1a3b40c7..c86f2f4e4df 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_revoke.result
@@ -1,10 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;
select_priv
N
+connection slave;
grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
revoke select on *.* from 'user_foo'@'%';
select select_priv from mysql.user where user='user_foo' /* slave:must be N */;
@@ -14,14 +16,19 @@ grant select on *.* to 'user_foo'@'%' identified by 'user_foopass';
select select_priv from mysql.user where user='user_foo' /* slave:must be Y */;
select_priv
Y
+connection master;
revoke select on *.* from 'user_foo';
select select_priv from mysql.user where user='user_foo' /* master:must be N */;
select_priv
N
+connection slave;
select select_priv from mysql.user where user='user_foo' /* slave:must get Y */;
select_priv
Y
+connection slave;
revoke select on *.* FROM 'user_foo';
+connection master;
delete from mysql.user where user="user_foo";
+connection slave;
delete from mysql.user where user="user_foo";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table.result b/mysql-test/suite/rpl/r/rpl_ignore_table.result
index aa5f6d3e6db..732d1746dbd 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table.result
@@ -4,17 +4,20 @@ call mtr.add_suppression("Can't find record in 't.'");
call mtr.add_suppression("Can't find record in 'user'");
call mtr.add_suppression("Can't find record in 'tables_priv'");
**** Test case for BUG#16487 ****
-**** Master ****
+connection master;
CREATE TABLE test.t4 (a int);
CREATE TABLE test.t1 (a int);
UPDATE test.t4 NATURAL JOIN test.t1 SET t1.a=5;
-**** Slave ****
+connection slave;
SELECT * FROM t4;
a
+connection master;
DROP TABLE t1;
DROP TABLE t4;
+connection slave;
**** Test case for BUG#25482 ****
**** Adding GRANTS on master ****
+connection master;
create table test.t1(a int);
create table test.t4(a int);
set sql_mode="";
@@ -67,6 +70,7 @@ show grants for mysqltest5@somehost;
Grants for mysqltest5@somehost
GRANT USAGE ON *.* TO 'mysqltest5'@'somehost'
set sql_mode="";
+connection slave;
**** Checking grants on slave ****
show grants for mysqltest2@localhost;
Grants for mysqltest2@localhost
@@ -91,6 +95,7 @@ GRANT INSERT ON `test`.* TO 'mysqltest6'@'localhost'
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
**** Revoking grants on master ****
+connection master;
REVOKE SELECT ON test.t1 FROM mysqltest1@localhost;
REVOKE SELECT ON mysqltest2.t2 FROM mysqltest4@localhost;
REVOKE select(a) on t4
@@ -106,6 +111,7 @@ GRANT INSERT, INSERT (a), UPDATE (a), REFERENCES (a) ON `test`.`t4` TO 'mysqltes
show grants for mysqltest4@localhost;
Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
+connection slave;
**** Checking grants on slave ****
show grants for mysqltest1@localhost;
ERROR 42000: There is no such grant defined for user 'mysqltest1' on host 'localhost'
@@ -119,14 +125,18 @@ Grants for mysqltest4@localhost
GRANT USAGE ON *.* TO 'mysqltest4'@'localhost' IDENTIFIED BY PASSWORD '*196BDEDE2AE4F84CA44C47D54D78478C7E2BD7B7'
set global slave_exec_mode='IDEMPOTENT';
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table mysql.* error.* 1032");
+connection master;
drop table t1, mysqltest2.t2;
drop table t4;
drop database mysqltest2;
delete from mysql.user where user like "mysqltest%";
delete from mysql.db where user like "mysqltest%";
delete from mysql.columns_priv where user like "mysqltest%";
+connection slave;
delete from mysql.tables_priv where user like "mysqltest%";
+connection master;
delete from mysql.tables_priv where user like "mysqltest%";
+connection master;
DROP TABLE IF EXISTS t5;
CREATE TABLE t5 (
word varchar(50) collate utf8_unicode_ci NOT NULL default ''
@@ -137,11 +147,15 @@ INSERT INTO t5 (word) VALUES ('TEST’');
SELECT HEX(word) FROM t5;
HEX(word)
54455354E28099
+connection slave;
set @@global.slave_exec_mode= default;
+connection slave;
SELECT HEX(word) FROM t5;
HEX(word)
54455354E28099
SELECT * FROM tmptbl504451f4258$1;
ERROR 42S02: Table 'test.tmptbl504451f4258$1' doesn't exist
+connection master;
DROP TABLE t5;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ignore_table_update.result b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
index c3882d0b98f..d4efa2dc42e 100644
--- a/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
+++ b/mysql-test/suite/rpl/r/rpl_ignore_table_update.result
@@ -1,10 +1,12 @@
include/master-slave.inc
[connection master]
+connection slave;
use test;
drop table if exists mysqltest_foo;
drop table if exists mysqltest_bar;
create table mysqltest_foo (n int);
insert into mysqltest_foo values(4);
+connection master;
use test;
create table mysqltest_foo (n int);
insert into mysqltest_foo values(5);
@@ -12,9 +14,12 @@ create table mysqltest_bar (m int);
insert into mysqltest_bar values(15);
create table t1 (k int);
insert into t1 values(55);
+connection slave;
select mysqltest_foo.n,mysqltest_bar.m,t1.k from mysqltest_foo,mysqltest_bar,t1;
n m k
4 15 55
+connection master;
drop table mysqltest_foo,mysqltest_bar,t1;
+connection slave;
drop table mysqltest_foo,mysqltest_bar,t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_incident.result b/mysql-test/suite/rpl/r/rpl_incident.result
index 7cb8168c6a9..e0c41c71e44 100644
--- a/mysql-test/suite/rpl/r/rpl_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_incident.result
@@ -16,6 +16,7 @@ a
2
3
4
+connection slave;
call mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master.* 1590");
include/wait_for_slave_sql_error.inc [errno=1590]
Last_SQL_Error = 'The incident LOST_EVENTS occurred on the master. Message: <none>'
@@ -34,5 +35,7 @@ a
3
4
include/check_slave_is_running.inc
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave.result b/mysql-test/suite/rpl/r/rpl_init_slave.result
index fcf7114879c..a90de76f139 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave.result
@@ -1,8 +1,11 @@
include/master-slave.inc
[connection master]
set global max_connections=151;
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+connection master;
+connection slave;
show variables like 'init_slave';
Variable_name Value
init_slave set global max_connections=500
@@ -10,17 +13,21 @@ show variables like 'max_connections';
Variable_name Value
max_connections 500
reset master;
+connection master;
show variables like 'init_slave';
Variable_name Value
init_slave
show variables like 'max_connections';
Variable_name Value
max_connections 151
+connection slave;
set @my_global_init_connect= @@global.init_connect;
set global init_connect="set @c=1";
show variables like 'init_connect';
Variable_name Value
init_connect set @c=1
+connection master;
+connection slave;
set global init_connect= @my_global_init_connect;
set global max_connections= default;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
index 57c0bb129fa..91742814b4c 100644
--- a/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_init_slave_errors.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
stop slave;
reset slave;
+connection slave;
SET GLOBAL debug_dbug= "d,simulate_io_slave_error_on_init,simulate_sql_slave_error_on_init";
start slave;
include/wait_for_slave_sql_error.inc [errno=1593]
Last_SQL_Error = 'Failed during slave thread initialization'
call mtr.add_suppression("Failed during slave.* thread initialization");
SET GLOBAL debug_dbug= "";
+connection slave;
reset slave;
SET GLOBAL init_slave= "garbage";
start slave;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
index 6f685c35901..ee8c585444e 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug28430.result
@@ -108,6 +108,8 @@ CALL test.proc_byrange();
commit;
SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
Master byrange 500
+connection slave;
+connection slave;
show create table test.byrange_tbl;
Table byrange_tbl
Create Table CREATE TABLE `byrange_tbl` (
@@ -139,6 +141,7 @@ SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
Slave bykey 500
SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
Slave byrange 500
+connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_bykey;
DROP PROCEDURE test.proc_byrange;
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
index d06e6681e81..d4640a36a7d 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug30888.result
@@ -27,6 +27,8 @@ SET del_count = del_count - 2;
END WHILE;
END|
CALL test.proc_norm();
+connection slave;
+connection master;
DROP PROCEDURE test.proc_norm;
DROP TABLE test.regular_tbl;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_bug68220.result b/mysql-test/suite/rpl/r/rpl_innodb_bug68220.result
index b8e9262c771..a9c8c6d612f 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_bug68220.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_bug68220.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
select variable_value into @master_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select variable_value into @master_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
select variable_value into @master_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
@@ -8,6 +9,7 @@ select variable_value into @master_system_rows_read from information_schema.glob
select variable_value into @master_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
select variable_value into @master_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
select variable_value into @master_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
+connection slave;
select variable_value into @slave_rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select variable_value into @slave_rows_updated from information_schema.global_status where variable_name = 'innodb_rows_updated';
select variable_value into @slave_rows_deleted from information_schema.global_status where variable_name = 'innodb_rows_deleted';
@@ -16,11 +18,12 @@ select variable_value into @slave_system_rows_read from information_schema.globa
select variable_value into @slave_system_rows_updated from information_schema.global_status where variable_name = 'innodb_system_rows_updated';
select variable_value into @slave_system_rows_deleted from information_schema.global_status where variable_name = 'innodb_system_rows_deleted';
select variable_value into @slave_system_rows_inserted from information_schema.global_status where variable_name = 'innodb_system_rows_inserted';
+connection master;
CREATE DATABASE testdb;
USE testdb;
CREATE TABLE testdb.t1 (i int NOT NULL PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO testdb.t1 VALUES (1);
-==========MASTER==========
+connection master;
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @master_rows_read;
@rows_read - @master_rows_read
@@ -53,7 +56,7 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @master_system_rows_inserted;
@system_rows_inserted - @master_system_rows_inserted
0
-==========SLAVE===========
+connection slave;
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @slave_rows_read;
@rows_read - @slave_rows_read
@@ -86,8 +89,10 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @slave_system_rows_inserted;
@system_rows_inserted - @slave_system_rows_inserted
0
+connection master;
UPDATE t1 SET i=2 WHERE i=1;
-==========MASTER==========
+connection slave;
+connection master;
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @master_rows_read;
@rows_read - @master_rows_read
@@ -120,7 +125,7 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @master_system_rows_inserted;
@system_rows_inserted - @master_system_rows_inserted
0
-==========SLAVE===========
+connection slave;
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @slave_rows_read;
@rows_read - @slave_rows_read
@@ -153,8 +158,9 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @slave_system_rows_inserted;
@system_rows_inserted - @slave_system_rows_inserted
0
+connection master;
DELETE FROM t1 WHERE i=2;
-==========MASTER==========
+connection master;
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @master_rows_read;
@rows_read - @master_rows_read
@@ -187,7 +193,7 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @master_system_rows_inserted;
@system_rows_inserted - @master_system_rows_inserted
0
-==========SLAVE===========
+connection slave;
select variable_value into @rows_read from information_schema.global_status where variable_name = 'innodb_rows_read';
select @rows_read - @slave_rows_read;
@rows_read - @slave_rows_read
@@ -220,6 +226,8 @@ select variable_value into @system_rows_inserted from information_schema.global_
select @system_rows_inserted - @slave_system_rows_inserted;
@system_rows_inserted - @slave_system_rows_inserted
0
+connection master;
DROP TABLE t1;
DROP DATABASE testdb;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
index 46305bfedc7..650d0787333 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_ddl.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-==========MASTER==========
+connection master;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -10,7 +10,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-==========SLAVE===========
+connection slave;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -20,6 +20,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
+connection master;
******************** DDL for database ********************
DROP DATABASE IF EXISTS test_rpl;
@@ -29,14 +30,14 @@ ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci;
DROP DATABASE test_rpl_1;
CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci;
-==========MASTER==========
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
-==========SLAVE===========
+connection slave;
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
+connection master;
USE test_rpl;
******************** DDL for tables ********************
@@ -47,7 +48,6 @@ ALTER TABLE t0 ADD INDEX index1 (b);
ALTER TABLE t0 DROP COLUMN c;
RENAME TABLE t0 TO t1;
CREATE TABLE t2 LIKE t1;
-==========MASTER==========
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`),
KEY `index1` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE TABLE t1;
Table Create Table
@@ -82,12 +82,12 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`),
KEY `index1` (`b`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+connection master;
******************** DDL for indexes ********************
ALTER TABLE t2 ADD COLUMN d datetime;
CREATE INDEX index2 on t2 (d);
CREATE INDEX index3 on t2 (a, d);
-==========MASTER==========
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -107,7 +107,7 @@ t2 CREATE TABLE `t2` (
KEY `index2` (`d`),
KEY `index3` (`a`,`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE TABLE t1;
Table Create Table
@@ -128,6 +128,7 @@ t2 CREATE TABLE `t2` (
KEY `index2` (`d`),
KEY `index3` (`a`,`d`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+connection master;
ALTER TABLE t2 DROP COLUMN d;
@@ -170,5 +171,8 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d
+connection slave;
+connection master;
drop database test_rpl;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
index 5871e858d27..1f140c3e2a5 100644
--- a/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_innodb_mixed_dml.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-==========MASTER==========
+connection master;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -10,7 +10,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-==========SLAVE===========
+connection slave;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -20,6 +20,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
+connection master;
CREATE DATABASE test_rpl;
******************** PREPARE TESTING ********************
@@ -33,7 +34,6 @@ INSERT INTO t2 VALUES(1, 't2, text 1');
******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
DELETE FROM t2 WHERE b <> UUID();
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -45,7 +45,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -58,6 +58,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -68,7 +69,6 @@ INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
DELETE FROM t2 WHERE a = 2;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -81,7 +81,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -95,6 +95,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -105,7 +106,6 @@ a b
10 line A
20 line B
30 line C
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
3
@@ -119,7 +119,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -134,6 +134,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -145,7 +146,6 @@ REPLACE INTO t1 VALUES(1, 't1, text 11');
REPLACE INTO t1 VALUES(2, UUID());
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
2
@@ -158,7 +158,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -172,6 +172,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -211,7 +212,6 @@ DELETE FROM t2;
******************** TRUNCATE ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -223,7 +223,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -236,8 +236,8 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
TRUNCATE t1;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -248,7 +248,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -260,6 +260,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -267,7 +268,6 @@ DELETE FROM t2;
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -280,7 +280,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -294,8 +294,8 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
+connection master;
UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test';
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -308,7 +308,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -322,6 +322,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -341,7 +342,6 @@ USE test_rpl;
START TRANSACTION;
INSERT INTO t1 VALUES (1, 'start');
COMMIT;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -353,7 +353,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -366,10 +366,10 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (2, 'rollback');
ROLLBACK;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -381,7 +381,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -394,12 +394,12 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (3, 'before savepoint s1');
SAVEPOINT s1;
INSERT INTO t1 VALUES (4, 'after savepoint s1');
ROLLBACK TO SAVEPOINT s1;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
2
@@ -412,7 +412,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -425,6 +425,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
@@ -433,7 +434,6 @@ INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
RELEASE SAVEPOINT s2;
COMMIT;
DELETE FROM t1 WHERE a = 7;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
4
@@ -448,7 +448,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -464,6 +464,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -479,73 +480,73 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
******************** CREATE USER ********************
CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
+connection master;
******************** GRANT ********************
GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y
+connection master;
******************** REVOKE ********************
REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
+connection master;
******************** SET PASSWORD ********************
SET PASSWORD FOR 'user_test_rpl'@'localhost' = '*0000000000000000000000000000000000000000';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *0000000000000000000000000000000000000000 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *0000000000000000000000000000000000000000 N
+connection master;
******************** RENAME USER ********************
RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
+connection master;
******************** DROP USER ********************
DROP USER 'user_test_rpl_2'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
+connection master;
INSERT INTO t1 VALUES(100, 'test');
******************** ANALYZE ********************
@@ -580,14 +581,14 @@ SHOW VARIABLES LIKE 'test_rpl_var';
Variable_name Value
******************** SHOW ********************
-==========MASTER==========
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
-==========SLAVE===========
+connection slave;
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
+connection master;
******************** PROCEDURE ********************
CREATE PROCEDURE p1 ()
@@ -603,7 +604,6 @@ CALL p1();
INSERT INTO t1 VALUES(202, 'test 202');
CALL p2();
DELETE FROM t1 WHERE a = 202;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
2
@@ -616,7 +616,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -630,6 +630,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
ALTER PROCEDURE p1 COMMENT 'p1';
DROP PROCEDURE p1;
DROP PROCEDURE p2;
@@ -642,7 +643,6 @@ FOR EACH ROW BEGIN
INSERT INTO t2 SET a = NEW.a, b = NEW.b;
END|
INSERT INTO t1 VALUES (1, 'test');
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -655,7 +655,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -669,6 +669,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
+connection master;
DELETE FROM t1;
DELETE FROM t2;
DROP TRIGGER tr1;
@@ -678,16 +679,15 @@ DROP TRIGGER tr1;
GRANT EVENT ON *.* TO 'root'@'localhost';
INSERT INTO t1 VALUES(1, 'test1');
CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1;
-==========MASTER==========
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========MASTER==========
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -699,7 +699,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -712,7 +712,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========MASTER==========
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -724,7 +724,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -737,17 +737,17 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
ALTER EVENT e1 RENAME TO e2;
-==========MASTER==========
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========MASTER==========
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -759,7 +759,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -772,14 +772,15 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DROP EVENT e2;
-==========MASTER==========
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -788,14 +789,13 @@ INSERT INTO t1 VALUES(1, 'test1');
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
-==========MASTER==========
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci
SELECT * FROM v1 ORDER BY a;
a b
1 test1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@@ -803,15 +803,15 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM v1 ORDER BY a;
a b
1 test1
+connection master;
ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2;
-==========MASTER==========
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci
SELECT * FROM v1 ORDER BY a;
a b
2 test2
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@@ -819,6 +819,7 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM v1 ORDER BY a;
a b
2 test2
+connection master;
DROP VIEW v1;
DROP VIEW v2;
DELETE FROM t1;
@@ -1128,5 +1129,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid # # COMMIT /* XID */
+connection slave;
+connection master;
drop database test_rpl;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert.result b/mysql-test/suite/rpl/r/rpl_insert.result
index b8e5bfad5d5..1e790387e71 100644
--- a/mysql-test/suite/rpl/r/rpl_insert.result
+++ b/mysql-test/suite/rpl/r/rpl_insert.result
@@ -6,15 +6,20 @@ include/master-slave.inc
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
CREATE TABLE t1 (id INT, name VARCHAR(64)) ENGINE=MyISAM;
+connection slave;
+connection master;
SELECT COUNT(*) FROM mysqlslap.t1;
COUNT(*)
5000
+connection slave;
SELECT COUNT(*) FROM mysqlslap.t1;
COUNT(*)
5000
#
# Cleanup
#
+connection master;
USE test;
DROP SCHEMA mysqlslap;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
index 56c994cfd76..1946228f401 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
+++ b/mysql-test/suite/rpl/r/rpl_insert_delayed,stmt.rdiff
@@ -1,6 +1,6 @@
---- suite/rpl/r/rpl_insert_delayed.result 2012-09-18 01:37:45.317521958 +0300
-+++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2012-09-18 01:36:16.637514667 +0300
-@@ -15,17 +15,17 @@
+--- suite/rpl/r/rpl_insert_delayed.result 2016-03-25 19:44:43.408210896 +0400
++++ suite/rpl/r/rpl_insert_delayed,stmt.reject 2016-03-25 23:55:18.396360848 +0400
+@@ -18,19 +18,19 @@
insert delayed into t1 values(10, "my name");
flush table t1;
insert delayed into t1 values(10, "is Bond"), (20, "James Bond");
@@ -10,21 +10,25 @@
id name
10 my name
-20 James Bond
+ connection slave;
select * from t1;
id name
10 my name
-20 James Bond
+ connection master;
delete from t1 where id!=10;
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
+ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
flush table t1;
select * from t1;
id name
-@@ -38,17 +38,31 @@
- USE test;
- DROP SCHEMA mysqlslap;
+@@ -47,21 +47,38 @@
+ connection slave;
use test;
+ connection master;
++connection slave;
+FLUSH LOGS;
++connection master;
+FLUSH LOGS;
CREATE TABLE t1(a int, UNIQUE(a));
INSERT DELAYED IGNORE INTO t1 VALUES(1);
@@ -35,6 +39,7 @@
select * from t1;
a
1
+ connection slave;
On slave
+include/show_binlog_events.inc
+Log_name Pos Event_type Server_id End_log_pos Info
@@ -47,8 +52,12 @@
select * from t1;
a
1
+ connection master;
drop table t1;
+ connection slave;
+FLUSH LOGS;
++connection master;
+FLUSH LOGS;
+ connection master;
End of 5.0 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_delayed.result b/mysql-test/suite/rpl/r/rpl_insert_delayed.result
index 8e9ceb3c00c..bbc61ed07ec 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_delayed.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_delayed.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE SCHEMA IF NOT EXISTS mysqlslap;
USE mysqlslap;
CREATE TABLE t1 (id INT primary key auto_increment, name VARCHAR(64)) ENGINE=MyISAM;
@@ -7,10 +8,12 @@ FLUSH TABLE t1;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
+connection slave;
use mysqlslap;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
+connection master;
truncate table t1;
insert delayed into t1 values(10, "my name");
flush table t1;
@@ -20,10 +23,12 @@ select * from t1;
id name
10 my name
20 James Bond
+connection slave;
select * from t1;
id name
10 my name
20 James Bond
+connection master;
delete from t1 where id!=10;
insert delayed into t1 values(20, "is Bond"), (10, "James Bond");
flush table t1;
@@ -31,13 +36,17 @@ select * from t1;
id name
10 my name
20 is Bond
+connection slave;
select * from t1;
id name
10 my name
20 is Bond
+connection master;
USE test;
DROP SCHEMA mysqlslap;
+connection slave;
use test;
+connection master;
CREATE TABLE t1(a int, UNIQUE(a));
INSERT DELAYED IGNORE INTO t1 VALUES(1);
INSERT DELAYED IGNORE INTO t1 VALUES(1);
@@ -45,10 +54,14 @@ flush table t1;
select * from t1;
a
1
+connection slave;
On slave
select * from t1;
a
1
+connection master;
drop table t1;
+connection slave;
+connection master;
End of 5.0 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id.result b/mysql-test/suite/rpl/r/rpl_insert_id.result
index 05ef04e8a1d..00b41109884 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id.result
@@ -9,13 +9,16 @@
#
include/master-slave.inc
[connection master]
+connection master;
SET @old_concurrent_insert= @@global.concurrent_insert;
SET @@global.concurrent_insert= 0;
+connection master;
create table t1(a int auto_increment, key(a)) engine=myisam;
create table t2(b int auto_increment, c int, key(b)) engine=myisam;
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
+connection slave;
select * from t1 ORDER BY a;
a
1
@@ -25,6 +28,7 @@ a
select * from t2 ORDER BY b;
b c
1 4
+connection master;
drop table t1;
drop table t2;
create table t1(a int auto_increment, key(a)) engine=myisam;
@@ -35,6 +39,7 @@ 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;
+connection slave;
select * from t1;
a
10
@@ -45,6 +50,7 @@ select * from t2;
b c
5 0
6 11
+connection master;
#
# check if INSERT SELECT in auto_increment is well replicated (bug #490)
#
@@ -63,6 +69,7 @@ b c
7 11
8 12
9 13
+connection slave;
select * from t1 ORDER BY a;
a
10
@@ -76,21 +83,28 @@ b c
7 11
8 12
9 13
+connection master;
drop table t1;
drop table t2;
+connection slave;
#
# 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 ) engine=myisam;
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
Got one of the listed errors
+connection slave;
+connection master;
drop table t1;
+connection slave;
#
# Bug#14553: NULL in WHERE resets LAST_INSERT_ID
#
+connection master;
set @@session.sql_auto_is_null=1;
create table t1(a int auto_increment, key(a)) engine=myisam;
create table t2(a int) engine=myisam;
@@ -100,9 +114,12 @@ insert into t2 (a) select a from t1 where a is null;
select * from t2;
a
1
+connection slave;
+connection slave;
select * from t2;
a
1
+connection master;
drop table t1;
drop table t2;
#
@@ -113,6 +130,7 @@ drop table t2;
#
# The solution is not to reset last_insert_id on enter to sub-statement.
#
+connection master;
drop function if exists bug15728;
drop function if exists bug15728_insert;
drop table if exists t1, t2;
@@ -178,6 +196,7 @@ id last_id
1 3
2 4
3 5
+connection slave;
select * from t1;
id last_id
1 0
@@ -191,6 +210,7 @@ id last_id
1 3
2 4
3 5
+connection master;
drop function bug15728;
drop function bug15728_insert;
drop table t1,t2;
@@ -211,20 +231,24 @@ insert into t1 values(null,100);
select * from t1 order by n;
n b
1 100
+connection slave;
insert into t1 values(null,200),(null,300);
delete from t1 where b <> 100;
select * from t1 order by n;
n b
1 100
+connection master;
replace into t1 values(null,100),(null,350);
select * from t1 order by n;
n b
2 100
3 350
+connection slave;
select * from t1 order by n;
n b
2 100
3 350
+connection master;
insert into t1 values (NULL,400),(3,500),(NULL,600) on duplicate key UPDATE n=1000;
select * from t1 order by n;
n b
@@ -232,12 +256,14 @@ n b
4 400
1000 350
1001 600
+connection slave;
select * from t1 order by n;
n b
2 100
4 400
1000 350
1001 600
+connection master;
drop table t1;
create table t1 (n int primary key auto_increment not null,
b int, unique(b)) engine=myisam;
@@ -245,21 +271,27 @@ insert into t1 values(null,100);
select * from t1 order by n;
n b
1 100
+connection slave;
insert into t1 values(null,200),(null,300);
delete from t1 where b <> 100;
select * from t1 order by n;
n b
1 100
+connection master;
insert into t1 values(null,100),(null,350) on duplicate key update n=2;
select * from t1 order by n;
n b
2 100
3 350
+connection slave;
select * from t1 order by n;
n b
2 100
3 350
+connection master;
drop table t1;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b)) ENGINE=myisam;
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
@@ -267,10 +299,12 @@ SELECT * FROM t1 ORDER BY a;
a b
1 10
2 2
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 10
2 2
+connection master;
drop table t1;
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
@@ -309,6 +343,7 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
+connection slave;
SELECT * FROM t1 ORDER BY id;
id field_1 field_2 field_3
1 1 a 1a
@@ -317,7 +352,9 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
+connection master;
drop table t1, t2;
+connection master;
DROP PROCEDURE IF EXISTS p1;
DROP TABLE IF EXISTS t1, t2;
SELECT LAST_INSERT_ID(0);
@@ -345,12 +382,14 @@ id last_id
SELECT * FROM t2 ORDER BY id;
id last_id
1 0
+connection slave;
SELECT * FROM t1 ORDER BY id;
id last_id
0 1
SELECT * FROM t2 ORDER BY id;
id last_id
1 0
+connection master;
DROP PROCEDURE p1;
DROP TABLE t1, t2;
DROP PROCEDURE IF EXISTS p1;
@@ -396,7 +435,9 @@ INSERT INTO t1 VALUES (NULL, f2());
INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());
UPDATE t1 SET j= -1 WHERE i IS NULL;
INSERT INTO t1 (i) VALUES (NULL);
+connection master1;
INSERT INTO t1 (i) VALUES (NULL);
+connection master;
SELECT f3();
f3()
0
@@ -426,6 +467,7 @@ i
5
6
16
+connection slave;
SELECT * FROM t1;
i j
1 -1
@@ -452,19 +494,23 @@ i
5
6
16
+connection master;
DROP PROCEDURE p1;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP FUNCTION f3;
DROP TABLE t1, t2;
+connection slave;
#
# End of 5.0 tests
#
+connection master;
create table t2 (
id int not null auto_increment,
last_id int,
primary key (id)
) engine=myisam;
+connection master;
truncate table t2;
create table t1 (id tinyint primary key) engine=myisam;
create function insid() returns int
@@ -491,6 +537,7 @@ select * from t2 order by id;
id last_id
4 0
8 0
+connection slave;
select * from t1 order by id;
id
0
@@ -498,6 +545,7 @@ select * from t2 order by id;
id last_id
4 0
8 0
+connection master;
drop table t1;
drop function insid;
truncate table t2;
@@ -517,12 +565,14 @@ n b
select * from t2 order by id;
id last_id
1 3
+connection slave;
select * from t1 order by n;
n b
1 10
select * from t2 order by id;
id last_id
1 3
+connection master;
drop table t1, t2;
drop procedure foo;
SET @@global.concurrent_insert= @old_concurrent_insert;
diff --git a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
index 467b8c1e5cc..50abd9799d6 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_id_pk.result
@@ -6,6 +6,7 @@ create table t2(b int auto_increment, c int, primary key(b));
insert into t1 values (1),(2),(3);
insert into t1 values (null);
insert into t2 values (null,last_insert_id());
+connection slave;
select * from t1 ORDER BY a;
a
1
@@ -15,6 +16,7 @@ a
select * from t2 ORDER BY b;
b c
1 4
+connection master;
drop table t1;
drop table t2;
create table t1(a int auto_increment, key(a)) engine=innodb;
@@ -25,6 +27,7 @@ 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;
+connection slave;
select * from t1;
a
10
@@ -35,6 +38,7 @@ select * from t2;
b c
5 0
6 11
+connection master;
drop table t2;
drop table t1;
create table t1(a int auto_increment, primary key(a));
@@ -50,6 +54,7 @@ b c
7 11
8 12
9 13
+connection slave;
select * from t1 ORDER BY a;
a
10
@@ -63,12 +68,17 @@ b c
7 11
8 12
9 13
+connection master;
drop table t1;
drop table t2;
+connection slave;
+connection master;
SET TIMESTAMP=1000000000;
CREATE TABLE t1 ( a INT UNIQUE );
SET FOREIGN_KEY_CHECKS=0;
INSERT INTO t1 VALUES (1),(1);
Got one of the listed errors
+connection slave;
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_insert_ignore.result b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
index 1598b3c059f..9c621169a66 100644
--- a/mysql-test/suite/rpl/r/rpl_insert_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_insert_ignore.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection master;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
@@ -22,7 +23,9 @@ 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;
include/assert.inc [Count of elements in t1 should be 6.]
+connection slave;
include/diff_tables.inc [master:test.t1 , slave:test.t1]
+connection master;
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
include/assert.inc [Count of elements in t1 should be 6.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
@@ -39,7 +42,10 @@ INSERT INTO t2 VALUES (1);
INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
include/assert.inc [Sum of elements in t1 should be 1.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+connection master;
drop table t1, t2;
+connection slave;
+connection master;
CREATE TABLE t1 (
a int unsigned not null auto_increment primary key,
b int unsigned,
@@ -61,7 +67,9 @@ 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;
include/assert.inc [Count of elements in t1 should be 6.]
+connection slave;
include/diff_tables.inc [master:test.t1 , slave:test.t1]
+connection master;
INSERT IGNORE INTO t1 SELECT NULL, t2.b FROM t2 ORDER BY t2.a;
include/assert.inc [Count of elements in t1 should be 6.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
@@ -78,5 +86,7 @@ INSERT INTO t2 VALUES (1);
INSERT INTO t1 SELECT t2.a FROM t2 ORDER BY t2.a ON DUPLICATE KEY UPDATE t1.a= t1.a;
include/assert.inc [Sum of elements in t1 should be 1.]
include/assert.inc [In SBR or MIXED modes, the event in the binlog should be the same that was executed. In RBR mode, binlog position should stay unchanged.]
+connection master;
drop table t1, t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_invoked_features.result b/mysql-test/suite/rpl/r/rpl_invoked_features.result
index 514483e7995..fcd79136e09 100644
--- a/mysql-test/suite/rpl/r/rpl_invoked_features.result
+++ b/mysql-test/suite/rpl/r/rpl_invoked_features.result
@@ -263,6 +263,7 @@ a b
101 101
102 102
103 103
+connection slave;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
@@ -423,6 +424,7 @@ a b
101 101
102 102
103 103
+connection master;
UPDATE t1 SET c='';
UPDATE t2 SET c='';
@@ -432,8 +434,10 @@ UPDATE t12 SET c='';
UPDATE t13 SET c='';
ALTER TABLE t3 ORDER BY a;
ALTER TABLE t13 ORDER BY a;
+connection slave;
+connection master;
DROP VIEW IF EXISTS v1,v11;
DROP TABLE IF EXISTS t1,t2,t3,t11,t12,t13;
@@ -443,4 +447,5 @@ DROP FUNCTION IF EXISTS f1;
DROP FUNCTION IF EXISTS f2;
DROP EVENT IF EXISTS e1;
DROP EVENT IF EXISTS e11;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix.result b/mysql-test/suite/rpl/r/rpl_ip_mix.result
index 4d3999549b3..e139f863c8a 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix.result
@@ -1,6 +1,6 @@
#################### IP: ::1 ###########################
-connect (master,::1,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -15,8 +15,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
-connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -31,8 +31,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
-connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -47,8 +47,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
-connect (master,::1,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
diff --git a/mysql-test/suite/rpl/r/rpl_ip_mix2.result b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
index 3f536fc3efd..70599d097a7 100644
--- a/mysql-test/suite/rpl/r/rpl_ip_mix2.result
+++ b/mysql-test/suite/rpl/r/rpl_ip_mix2.result
@@ -1,6 +1,6 @@
#################### IP: ::1 ###########################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,::1,root,,test,SLAVE_MYPORT);
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -15,8 +15,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT);
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -31,8 +31,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT);
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -47,8 +47,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,::1,root,,test,SLAVE_MYPORT);
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
diff --git a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
index e1a0c6d4772..b1b16fb0738 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv4_as_ipv6.result
@@ -1,6 +1,6 @@
#################### IP: 127.0.0.1 ###########################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -14,8 +14,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:FFFF:127.0.0.1 ###########################
-connect (master,0:0:0:0:0:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,0:0:0:0:0:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -29,8 +29,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:FFFF:127.0.0.1 ###########################
-connect (master,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,0000:0000:0000:0000:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -44,8 +44,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0000:0000:0:0000:FFFF:127.0.0.1 ###########################
-connect (master,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,0:0000:0000:0:0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -59,8 +59,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0::0000:FFFF:127.0.0.1 ###########################
-connect (master,0::0000:FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,0::0000:FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -74,8 +74,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: ::FFFF:127.0.0.1 ###########################
-connect (master,::FFFF:127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,::FFFF:127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -89,8 +89,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: ::FFFF:127.0.0.1 ###########################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
diff --git a/mysql-test/suite/rpl/r/rpl_ipv6.result b/mysql-test/suite/rpl/r/rpl_ipv6.result
index 04f0727b87f..f1c5619b66b 100644
--- a/mysql-test/suite/rpl/r/rpl_ipv6.result
+++ b/mysql-test/suite/rpl/r/rpl_ipv6.result
@@ -1,6 +1,6 @@
#################### IP: ::1 ###########################
-connect (master,::1,root,,test,MASTER_MYPORT);
-connect (slave,::1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -14,8 +14,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0000:0000:0000:0000:0000:0000:0000:0001 ###########################
-connect (master,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,MASTER_MYPORT);
-connect (slave,0000:0000:0000:0000:0000:0000:0000:0001,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -29,8 +29,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: 0:0:0:0:0:0:0:1 ###########################
-connect (master,0:0:0:0:0:0:0:1,root,,test,MASTER_MYPORT);
-connect (slave,0:0:0:0:0:0:0:1,root,,test,SLAVE_MYPORT);
+connect master,$IPv6,root,,test,$MASTER_MYPORT;
+connect slave,$IPv6,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
@@ -44,8 +44,8 @@ disconnect slave;
disconnect master;
connection default;
#################### IP: ::1 mix #######################
-connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
-connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT;
connection master;
reset master;
show master status;
diff --git a/mysql-test/suite/rpl/r/rpl_killed_ddl.result b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
index a02c9b599bf..b5b302bc3eb 100644
--- a/mysql-test/suite/rpl/r/rpl_killed_ddl.result
+++ b/mysql-test/suite/rpl/r/rpl_killed_ddl.result
@@ -51,95 +51,175 @@ END;
//
CREATE INDEX i1 ON t1 (a);
CREATE VIEW v1 AS SELECT a FROM t1 WHERE a < 100;
-[on master]
-[on master1]
+connection slave;
+connection master1;
+connection master;
+connection master1;
CREATE DATABASE d2;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP DATABASE d1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP DATABASE IF EXISTS d2;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
CREATE EVENT e2
ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY
DO INSERT INTO test.t1 VALUES (2);
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP EVENT e1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP EVENT IF EXISTS e2;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
CREATE FUNCTION f2 () RETURNS INT DETERMINISTIC
RETURN 1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
ALTER FUNCTION f1 SQL SECURITY INVOKER;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP FUNCTION f1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
CREATE PROCEDURE p2 (OUT rows INT)
BEGIN
SELECT COUNT(*) INTO rows FROM t2;
END;
//
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
ALTER PROCEDURE p1 SQL SECURITY INVOKER COMMENT 'return rows of table t1';
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP PROCEDURE p1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
CREATE TABLE t2 (b int);
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
ALTER TABLE t1 ADD (d int);
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
RENAME TABLE t3 TO t4;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
CREATE INDEX i2 on t1 (a);
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP INDEX i1 on t1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
+connection master;
CREATE TABLE IF NOT EXISTS t4 (a int);
+connection master1;
CREATE TRIGGER tr2 BEFORE INSERT ON t4
FOR EACH ROW BEGIN
DELETE FROM t1 WHERE a=NEW.a;
END;
//
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP TRIGGER tr1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP TRIGGER IF EXISTS tr2;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
CREATE VIEW v2 AS SELECT a FROM t1 WHERE a > 100;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP VIEW v1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP VIEW IF EXISTS v2;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP TABLE t1;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
DROP TABLE IF EXISTS t2;
source include/kill_query.inc;
+connection master;
include/rpl_diff.inc
+connection master;
+connection master1;
+connection master;
DROP DATABASE IF EXISTS d1;
DROP DATABASE IF EXISTS d2;
DROP DATABASE IF EXISTS d3;
diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
index ea738b710fd..3cbb590b9a7 100644
--- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
+++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result
@@ -4,11 +4,14 @@ include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT,
UNIQUE(b));
+connection slave;
+connection master;
INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10;
SELECT * FROM t1;
a b
1 10
2 2
+connection slave;
call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432");
include/wait_for_slave_sql_error.inc [errno=1105]
Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10''
@@ -17,10 +20,13 @@ a b
stop slave;
include/wait_for_slave_to_stop.inc
reset slave;
+connection master;
reset master;
drop table t1;
+connection slave;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
CREATE TABLE t1 (
id bigint(20) unsigned NOT NULL auto_increment,
field_1 int(10) unsigned NOT NULL,
@@ -39,6 +45,8 @@ INSERT INTO t2 (field_a, field_b, field_c) VALUES (2, 'b', '2b');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (3, 'c', '3c');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (4, 'd', '4d');
INSERT INTO t2 (field_a, field_b, field_c) VALUES (5, 'e', '5e');
+connection slave;
+connection master;
INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
FROM t2
@@ -64,6 +72,7 @@ id field_1 field_2 field_3
4 4 d 4d
5 5 e 5e
6 6 f 6f
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1105]
Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1 (field_1, field_2, field_3)
SELECT t2.field_a, t2.field_b, t2.field_c
@@ -72,7 +81,9 @@ ON DUPLICATE KEY UPDATE
t1.field_3 = t2.field_c''
SELECT * FROM t1;
id field_1 field_2 field_3
+connection master;
drop table t1, t2;
+connection slave;
drop table t1, t2;
include/stop_slave_io.inc
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata.result b/mysql-test/suite/rpl/r/rpl_loaddata.result
index eaf3fb6a947..e759f34bb9d 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata.result
@@ -12,6 +12,7 @@ create temporary table t2 (day date,id int(9),category enum('a','b','c'),name va
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;
+connection slave;
select * from t1;
a b
1 10
@@ -21,20 +22,26 @@ day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
2003-03-22 2416 a bbbbb
+connection master;
drop table t1;
drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
+connection slave;
insert into t1 values(1,10);
+connection master;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062");
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0");
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
include/check_slave_no_error.inc
+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;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
include/stop_slave_io.inc
change master to master_user='test';
@@ -42,14 +49,17 @@ change master to master_user='root';
include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
+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;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
include/check_slave_no_error.inc
+connection master;
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -61,25 +71,30 @@ select * from t2;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
+connection slave;
start slave;
select * from t2;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
alter table t2 drop key day;
+connection master;
delete from t2;
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;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
+connection slave;
include/wait_for_slave_sql_error.inc [errno=0]
drop table t1, t2;
+connection master;
drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
DROP TABLE t1;
include/rpl_reset.inc
+connection master;
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -95,15 +110,21 @@ LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48
### assertion: works without fully qualified name on current database
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
### create connection without default database
-### connect (conn2,localhost,root,,*NO-ONE*);
+connect conn2,localhost,root,,*NO-ONE*;
+connection conn2;
### assertion: works without stating the default database
LOAD DATA LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
-### disconnect and switch back to master connection
+disconnect conn2;
+connection master;
+connection slave;
use b48297_db1;
include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
+connection master;
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
+connection slave;
include/rpl_reset.inc
+connection master;
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -114,5 +135,7 @@ Field 1 'Field 2'
Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
+connection slave;
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
index 6b60bffa365..b89f7005405 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_charset.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1 (a varchar(10) character set utf8);
load data infile '../../std_data/loaddata6.dat' into table t1;
set @@character_set_database=koi8r;
@@ -21,6 +22,7 @@ C3BF
C3BF
D0AA
D0AA
+connection slave;
select hex(a) from t1;
hex(a)
C3BF
@@ -30,46 +32,52 @@ C3BF
C3BF
D0AA
D0AA
+connection master;
drop table t1;
+connection slave;
-------------test bug#45516------------------
+connection master;
DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE mysqltest CHARSET UTF8;
USE mysqltest;
CREATE TABLE t (cl varchar(100)) CHARSET UTF8;
LOAD DATA LOCAL INFILE './std_data/loaddata_utf8.dat' INTO TABLE t
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
-----------content on master----------
SELECT hex(cl) FROM t;
hex(cl)
E4B880E4BA8CE4B889
E59B9BE4BA94E585AD
E4B883E585ABE4B99D
-----------content on slave----------
+connection slave;
USE mysqltest;
SELECT hex(cl) FROM t;
hex(cl)
E4B880E4BA8CE4B889
E59B9BE4BA94E585AD
E4B883E585ABE4B99D
+connection master;
DROP DATABASE mysqltest;
+connection slave;
+connection master;
DROP DATABASE IF EXISTS mysqltest;
CREATE DATABASE mysqltest CHARSET UTF8;
USE mysqltest;
CREATE TABLE t (cl varchar(100)) CHARSET UTF8;
LOAD DATA INFILE '../../std_data/loaddata_utf8.dat' INTO TABLE t
FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
-----------content on master----------
SELECT hex(cl) FROM t;
hex(cl)
E4B880E4BA8CE4B889
E59B9BE4BA94E585AD
E4B883E585ABE4B99D
-----------content on slave----------
+connection slave;
USE mysqltest;
SELECT hex(cl) FROM t;
hex(cl)
E4B880E4BA8CE4B889
E59B9BE4BA94E585AD
E4B883E585ABE4B99D
+connection master;
DROP DATABASE mysqltest;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
index 8ce630f7bc2..3f8c684cdad 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_fatal.result
@@ -1,10 +1,16 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1 (a INT, b INT);
INSERT INTO t1 VALUES (1,10);
+connection slave;
+connection master;
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE t1;
+connection slave;
call mtr.add_suppression("Slave SQL.*Fatal error: Not enough memory, error.* 1593");
include/wait_for_slave_sql_error_and_skip.inc [errno=1593]
Last_SQL_Error = 'Fatal error: Not enough memory'
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_m.result b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
index 538592f0d43..8e2bc2f0b1c 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_m.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_m.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
drop database if exists mysqltest;
+connection master;
USE test;
CREATE TABLE t1(a INT, b INT, UNIQUE(b));
LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE test.t1;
@@ -14,6 +15,7 @@ LOAD DATA INFILE '../../std_data/rpl_loaddata.dat' INTO TABLE mysqltest.t1;
SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
+connection slave;
SHOW DATABASES;
Database
information_schema
@@ -32,6 +34,8 @@ t1
SELECT COUNT(*) FROM mysqltest.t1;
COUNT(*)
2
+connection master;
DROP DATABASE mysqltest;
DROP TABLE IF EXISTS test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_map.result b/mysql-test/suite/rpl/r/rpl_loaddata_map.result
index 50e5e351590..cc67c8d4660 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_map.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_map.result
@@ -21,11 +21,12 @@ master-bin.000001 # Append_block # # ;file_id=#;block_len=#
master-bin.000001 # Execute_load_query # # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/bug30435_5k.txt' INTO TABLE `t2` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`id`) ;file_id=#
master-bin.000001 # Query # # COMMIT
==== Verify results on slave ====
-[on slave]
+connection slave;
select count(*) from t2 /* 5 000 */;
count(*)
5000
==== Clean up ====
-[on master]
+connection master;
drop table t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_s.result b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
index 377c3bff558..1eb37dd4899 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_s.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_s.result
@@ -1,11 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
reset master;
+connection master;
create table test.t1(a int, b int, unique(b));
load data infile '../../std_data/rpl_loaddata.dat' into table test.t1;
+connection slave;
select count(*) from test.t1;
count(*)
2
include/show_binlog_events.inc
+connection master;
drop table test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
index 24a1a35470d..d7a9a5981dc 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_simple.result
@@ -74,6 +74,7 @@ Aberdeen
Abernathy
aberrant
aberration
+connection slave;
SELECT * FROM t1 ORDER BY word;
word
Aarhus
@@ -146,5 +147,7 @@ Aberdeen
Abernathy
aberrant
aberration
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result b/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
index c3b3c2232a6..0a7c255c779 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddata_symlink.result
@@ -6,9 +6,13 @@ select * from t1;
a b
1 10
2 15
+connection slave;
+connection slave;
select * from t1;
a b
1 10
2 15
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
index 16fd3f19c4a..f0d24df2cb2 100644
--- a/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
+++ b/mysql-test/suite/rpl/r/rpl_loaddatalocal.result
@@ -4,10 +4,14 @@ create table t1(a int);
select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
truncate table t1;
load data local infile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' into table t1;
+connection slave;
select a,count(*) from t1 group by a;
a count(*)
1 10000
+connection master;
drop table t1;
+connection slave;
+connection master;
create table t1(a int);
insert into t1 values (1), (2), (2), (3);
select * into outfile 'MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' from t1;
@@ -21,14 +25,17 @@ a
1
2
3
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
+connection master;
drop table t1;
+connection slave;
==== Bug22504 Initialize ====
-[on master]
+connection master;
SET sql_mode='ignore_space';
CREATE TABLE t1(a int);
insert into t1 values (1), (2), (3), (4);
@@ -41,7 +48,7 @@ a
2
3
4
-[on slave]
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -49,14 +56,14 @@ a
3
4
==== Clean up ====
-[on master]
+connection master;
DROP TABLE t1;
-[on slave]
+connection slave;
Bug #43746:
"return wrong query string when parse 'load data infile' sql statement"
-[master]
+connection master;
SELECT @@SESSION.sql_mode INTO @old_mode;
SET sql_mode='ignore_space';
CREATE TABLE t1(a int);
@@ -75,31 +82,32 @@ LOAD DATA/*!10000 LOCAL */INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO/* empty */TA
LOAD/*!999999 special comments that do not expand */DATA/*!999999 code from the future */LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql'/*!999999 have flux capacitor */INTO/*!999999 will travel */TABLE t1;
SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER';
LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
-[slave]
+connection slave;
Bug #59267:
"LOAD DATA LOCAL INFILE not executed on slave with SBR"
-[master]
+connection master;
SELECT * INTO OUTFILE 'MYSQLD_DATADIR/bug59267.sql' FROM t1;
TRUNCATE TABLE t1;
LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
SELECT 'Master', COUNT(*) FROM t1;
Master COUNT(*)
Master 44
-[slave]
+connection slave;
SELECT 'Slave', COUNT(*) FROM t1;
Slave COUNT(*)
Slave 44
-[master]
+connection master;
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
-[slave]
+connection slave;
+connection master;
Bug #60580/#11902767:
"statement improperly replicated crashes slave sql thread"
-[master]
+connection master;
CREATE TABLE t1(f1 INT, f2 INT);
CREATE TABLE t2(f1 INT, f2 TIMESTAMP);
INSERT INTO t2 VALUES(1, '2011-03-22 21:01:28');
@@ -113,13 +121,14 @@ LOAD DATA LOCAL INFILE 'MYSQLD_DATADIR/bug60580.csv' INTO TABLE t1 (@f1) SET f2
SELECT * FROM t1;
f1 f2
NULL NULL
-[slave]
+connection slave;
SELECT * FROM t1;
f1 f2
NULL NULL
-[master]
+connection master;
DROP VIEW v1;
DROP TABLE t1, t2, t3;
-[slave]
+connection slave;
+connection master;
include/rpl_end.inc
# End of 5.1 tests
diff --git a/mysql-test/suite/rpl/r/rpl_loadfile.result b/mysql-test/suite/rpl/r/rpl_loadfile.result
index 640d1f72bf5..2afe510ddeb 100644
--- a/mysql-test/suite/rpl/r/rpl_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_loadfile.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@@ -115,6 +116,8 @@ Abernathy
aberrant
aberration
+connection slave;
+connection slave;
SELECT * FROM test.t1 ORDER BY blob_column;
a blob_column
1 abase
@@ -219,9 +222,12 @@ Abernathy
aberrant
aberration
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
+connection slave;
include/rpl_reset.inc
+connection master;
SELECT repeat('x',20) INTO OUTFILE 'MYSQLTEST_VARDIR/tmp/bug_39701.data';
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (t text);
@@ -229,10 +235,16 @@ CREATE PROCEDURE p(file varchar(4096))
BEGIN
INSERT INTO t1 VALUES (LOAD_FILE(file));
END|
+connection slave;
include/stop_slave.inc
+connection master;
CALL p('MYSQLTEST_VARDIR/tmp/bug_39701.data');
+connection slave;
include/start_slave.inc
+connection master;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
DROP PROCEDURE p;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_locale.result b/mysql-test/suite/rpl/r/rpl_locale.result
index 1f6bd40cd16..9c699642583 100644
--- a/mysql-test/suite/rpl/r/rpl_locale.result
+++ b/mysql-test/suite/rpl/r/rpl_locale.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1 (s1 char(10));
set lc_time_names= 'de_DE';
insert into t1 values (date_format('2001-01-01','%W'));
@@ -9,9 +10,13 @@ select * from t1;
s1
Montag
Monday
+connection slave;
+connection slave;
select * from t1;
s1
Montag
Monday
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result
index 610d18a88c6..7f5f34bf831 100644
--- a/mysql-test/suite/rpl/r/rpl_log_pos.result
+++ b/mysql-test/suite/rpl/r/rpl_log_pos.result
@@ -7,12 +7,14 @@ call mtr.add_suppression ("Error in Log_event::read_log_event");
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
+connection slave;
include/stop_slave.inc
change master to master_log_pos=MASTER_LOG_POS;
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
include/stop_slave_sql.inc
+connection master;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 # <Binlog_Do_DB> <Binlog_Ignore_DB>
@@ -20,6 +22,7 @@ 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);
+connection slave;
change master to master_log_pos=MASTER_LOG_POS;
start slave;
select * from t1 ORDER BY n;
@@ -27,6 +30,8 @@ n
1
2
3
+connection master;
drop table t1;
+connection slave;
End of 5.0 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result
index 573517d6af8..e03606874b8 100644
--- a/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result
+++ b/mysql-test/suite/rpl/r/rpl_lost_events_on_rotate.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
SET @debug_saved= @@GLOBAL.DEBUG_DBUG;
CREATE TABLE t (i INT);
SET GLOBAL DEBUG_DBUG= "d,wait_after_binlog_EOF";
@@ -7,7 +8,9 @@ INSERT INTO t VALUES (1);
INSERT INTO t VALUES (2);
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL signal.rotate_finished';
+connection slave;
include/diff_tables.inc [master:t,slave:t]
+connection master;
SET @@GLOBAL.DEBUG_DBUG= @debug_saved;
SET DEBUG_SYNC= 'RESET';
DROP TABLE t;
diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
index d5331d0fc93..78a86437867 100644
--- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
+++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result
@@ -2,22 +2,30 @@ include/master-slave.inc
[connection master]
FLUSH LOGS;
CREATE TABLE t1(c1 INT);
+connection slave;
+connection master;
FLUSH LOGS;
call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log');
+connection slave;
include/wait_for_slave_io_error.inc [errno=1236]
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000002' at XXX, the last byte read from 'master-bin.000002' at XXX.''
+connection master;
CREATE TABLE t2(c1 INT);
FLUSH LOGS;
CREATE TABLE t3(c1 INT);
FLUSH LOGS;
CREATE TABLE t4(c1 INT);
+connection slave;
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
+connection master;
+connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
t3
t4
+connection master;
DROP TABLE t1, t2, t3, t4;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_many_optimize.result b/mysql-test/suite/rpl/r/rpl_many_optimize.result
index 53be9b48c7b..82b1f685ea8 100644
--- a/mysql-test/suite/rpl/r/rpl_many_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_many_optimize.result
@@ -3,4 +3,5 @@ include/master-slave.inc
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2);
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
index 9c19062255c..6b60fcb1507 100644
--- a/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
+++ b/mysql-test/suite/rpl/r/rpl_mariadb_slave_capability.result
@@ -1,15 +1,23 @@
include/master-slave.inc
[connection master]
+connection master;
set @old_master_binlog_checksum= @@global.binlog_checksum;
set @old_slave_dbug= @@global.debug_dbug;
+connection slave;
include/stop_slave.inc
# Test slave with no capability gets dummy event, which is ignored.
SET @@global.debug_dbug='+d,simulate_slave_capability_none';
include/start_slave.inc
+connection master;
FLUSH LOGS;
CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (0);
+connection slave;
+connection master;
ALTER TABLE t1 ORDER BY a;
+connection slave;
+connection slave;
+connection master;
SET SESSION binlog_annotate_row_events = ON;
DELETE FROM t1;
INSERT INTO t1 /* A comment just to make the annotate event sufficiently long that the dummy event will need to get padded with spaces so that we can test that this works */ VALUES(1);
@@ -25,6 +33,8 @@ master-bin.000002 # Annotate_rows # # INSERT INTO t1 /* A comment just to make t
master-bin.000002 # Table_map # # table_id: # (test.t1)
master-bin.000002 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000002 # Query # # COMMIT
+connection slave;
+connection slave;
SELECT * FROM t1;
a
1
@@ -42,6 +52,7 @@ slave-relay-bin.000005 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-relay-bin.000005 # Query # # COMMIT
set @@global.debug_dbug= @old_slave_dbug;
# Test dummy event is checksummed correctly.
+connection master;
set @@global.binlog_checksum = CRC32;
TRUNCATE t1;
INSERT INTO t1 VALUES(2);
@@ -52,6 +63,8 @@ master-bin.000003 # Annotate_rows # # INSERT INTO t1 VALUES(2)
master-bin.000003 # Table_map # # table_id: # (test.t1)
master-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000003 # Query # # COMMIT
+connection slave;
+connection slave;
SELECT * FROM t1;
a
2
@@ -63,16 +76,24 @@ slave-relay-bin.000007 # Table_map # # table_id: # (test.t1)
slave-relay-bin.000007 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-relay-bin.000007 # Query # # COMMIT
*** MDEV-5754: MySQL 5.5 slaves cannot replicate from MariaDB 10.0 ***
+connection master;
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
+connect con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
INSERT INTO t2 VALUES (1);
+connection master;
SET debug_sync='now WAIT_FOR master_queued1';
+connect con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
INSERT INTO t2 VALUES (2);
+connection master;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
SET debug_sync='RESET';
+connection con2;
SET debug_sync='RESET';
+connection master;
SET debug_sync='RESET';
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -84,6 +105,7 @@ master-bin.000003 # Gtid # # BEGIN GTID #-#-# cid=#
master-bin.000003 # Table_map # # table_id: # (test.t2)
master-bin.000003 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000003 # Xid # # COMMIT /* XID */
+connection slave;
SELECT * FROM t2 ORDER BY a;
a
1
@@ -93,7 +115,11 @@ a
include/stop_slave.inc
SET @@global.debug_dbug='+d,simulate_slave_capability_old_53';
include/start_slave.inc
+connection master;
ALTER TABLE t1 ORDER BY a;
+connection slave;
+connection slave;
+connection master;
UPDATE t1 SET a = 3;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -102,6 +128,8 @@ master-bin.000003 # Annotate_rows # # UPDATE t1 SET a = 3
master-bin.000003 # Table_map # # table_id: # (test.t1)
master-bin.000003 # Update_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000003 # Query # # COMMIT
+connection slave;
+connection slave;
SELECT * FROM t1;
a
3
@@ -120,6 +148,8 @@ select @@global.replicate_annotate_row_events;
0
set @@global.debug_dbug= @old_slave_dbug;
Clean up.
+connection master;
set @@global.binlog_checksum = @old_master_binlog_checksum;
DROP TABLE t1, t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
index 78bda5a1c6f..18298986069 100644
--- a/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
+++ b/mysql-test/suite/rpl/r/rpl_master_pos_wait.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
select master_pos_wait('master-bin.999999',0,2);
master_pos_wait('master-bin.999999',0,2)
-1
@@ -9,9 +10,12 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select master_pos_wait('master-bin.999999',0,2) AS `master_pos_wait('master-bin.999999',0,2)`
select master_pos_wait('master-bin.999999',0);
+connection slave1;
stop slave sql_thread;
+connection slave;
master_pos_wait('master-bin.999999',0)
NULL
+connection master;
"*** must be empty ***"
show slave status;
"*** must be NULL ***"
@@ -19,6 +23,7 @@ select master_pos_wait('foo', 98);
master_pos_wait('foo', 98)
NULL
*** MDEV-7130: MASTER_POS_WAIT(log_name,log_pos,timeout,"connection_name") hangs, does not respect the timeout ***
+connection slave;
include/stop_slave.inc
reset slave all;
change master 'my_slave' to master_port=MASTER_MYPORT, master_host='127.0.0.1', master_user='root';
diff --git a/mysql-test/suite/rpl/r/rpl_mdev359.result b/mysql-test/suite/rpl/r/rpl_mdev359.result
index 337a35a7a92..278922f3a83 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev359.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev359.result
@@ -2,11 +2,15 @@ include/master-slave.inc
[connection master]
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
SET GLOBAL rpl_semi_sync_master_enabled = ON;
+connection master1;
SET DEBUG_SYNC = "rpl_semisync_master_commit_trx_before_lock SIGNAL m1_ready WAIT_FOR m1_cont";
INSERT INTO t1 SELECT * FROM t1;
+connection master;
SET DEBUG_SYNC= "now WAIT_FOR m1_ready";
SET GLOBAL rpl_semi_sync_master_enabled = OFF;
SET DEBUG_SYNC= "now SIGNAL m1_cont";
+connection master1;
+connection master;
DROP TABLE t1;
SET DEBUG_SYNC= "RESET";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev382.result b/mysql-test/suite/rpl/r/rpl_mdev382.result
index 2e3faaba7b6..a21d6fe6a5f 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev382.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev382.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1 (a int primary key) engine=innodb;
create table t2 (a int primary key) engine=myisam;
begin;
@@ -32,6 +33,9 @@ master-bin.000001 # Query 1 # use `test`; insert into t1 values (2)
master-bin.000001 # Query 1 # ROLLBACK TO `a``; create database couldbebadthingshere; savepoint ``dummy`
master-bin.000001 # Query 1 # use `test`; insert into t1 values (3)
master-bin.000001 # Xid 1 # COMMIT /* XID */
+connection slave;
+connection slave;
+connection master;
BEGIN;
insert into t1 values(10);
set sql_mode = 'ANSI_QUOTES';
@@ -80,6 +84,7 @@ master-bin.000001 # Query 1 # SAVEPOINT `d``d`
master-bin.000001 # Query 1 # use `test`; insert into t1 values(18)
master-bin.000001 # Xid 1 # COMMIT /* XID */
*** Test correct USE statement in SHOW BINLOG EVENTS ***
+connection master;
set sql_mode = 'ANSI_QUOTES';
CREATE DATABASE "db1`; select 'oops!'";
use "db1`; select 'oops!'";
@@ -209,10 +214,14 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+connection slave;
+connection slave;
SELECT * FROM `db1``; select 'oops!'`.`t``1`;
a`1 b`2 c`3
fo\o bar |b"a'z!
+connection master;
DROP TABLE `db1``; select 'oops!'`.`t``1`;
+connection master;
drop table t1,t2;
*** Test truncation of long SET expression in LOAD DATA ***
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(1000));
@@ -229,10 +238,13 @@ master-bin.000001 # Gtid 1 # BEGIN GTID #-#-#
master-bin.000001 # Begin_load_query 1 # ;file_id=#;block_len=8
master-bin.000001 # Execute_load_query 1 # use `test`; LOAD DATA INFILE 'MYSQLTEST_VARDIR/tmp/file.txt' INTO TABLE `t1` FIELDS TERMINATED BY ',' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' (`a`, @`b`) SET `b`= CONCAT(@b, '| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|', @b) ;file_id=#
master-bin.000001 # Query 1 # COMMIT
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 X| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|X
2 A| 123456789A123456789B123456789C123456789D123456789E123456789F123456789G123456789H123456789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P123456789Q123456789R123456789123456789T123456789U123456789V123456789W123456789X123456789Y123456789Z123456789|A
+connection master;
DROP TABLE t1;
*** Test user variables whose names require correct quoting ***
use `db1``; select 'oops!'`;
@@ -304,10 +316,13 @@ DELIMITER ;
ROLLBACK /* added by mysqlbinlog */;
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
+connection slave;
+connection slave;
SELECT * FROM `db1``; select 'oops!'`.t1 ORDER BY a1;
a1 a2 a3 a4 b c d
-9223372036854775808 42 9223372036854775807 18446744073709551615 -1.234560123456789e125 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-9223372036854775807 4200 9223372036854775806 18446744073709551614 -6.172800617283945e124 -1234501234567890123456789012345678901234567890123456789.0123456789 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+connection master;
DROP TABLE t1;
*** Test correct quoting in foreign key error message ***
use `db1``; select 'oops!'`;
@@ -319,7 +334,9 @@ ERROR 42000: Cannot truncate a table referenced in a foreign key constraint (`db
DROP TABLE `t``2`;
DROP TABLE `t``1`;
*** Test correct quoting of DELETE FROM statement binlogged for HEAP table that is emptied due to server restart
+connection slave;
include/stop_slave.inc
+connection master;
CREATE TABLE `db1``; select 'oops!'`.`t``1` (`a``` INT PRIMARY KEY) ENGINE=heap;
INSERT INTO `db1``; select 'oops!'`.`t``1` VALUES (1), (2), (5);
SELECT * FROM `db1``; select 'oops!'`.`t``1` ORDER BY 1;
@@ -327,6 +344,9 @@ a`
1
2
5
+connection default;
+connection server_1;
+connection master;
set timestamp=1000000000;
# The table should be empty on the master.
SELECT * FROM `db1``; select 'oops!'`.`t``1`;
@@ -336,11 +356,18 @@ show binlog events in 'master-bin.000002' from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000002 # Gtid 1 # GTID #-#-#
master-bin.000002 # Query 1 # DELETE FROM `db1``; select 'oops!'`.`t``1`
+connection slave;
include/start_slave.inc
+connection master;
+connection slave;
+connection slave;
# The table should be empty on the slave also.
SELECT * FROM `db1``; select 'oops!'`.`t``1`;
a`
+connection master;
DROP TABLE `db1``; select 'oops!'`.`t``1`;
+connection slave;
+connection master;
use test;
DROP DATABASE `db1``; select 'oops!'`;
*** Test correct quoting of mysqlbinlog --rewrite-db option ***
diff --git a/mysql-test/suite/rpl/r/rpl_mdev6020.result b/mysql-test/suite/rpl/r/rpl_mdev6020.result
index 0855f578cfc..b0cb392b04c 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev6020.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev6020.result
@@ -1,8 +1,11 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
+connection master;
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
+connection slave;
SET SQL_LOG_BIN=0;
ALTER TABLE mysql.gtid_slave_pos ENGINE = InnoDB;
SET SQL_LOG_BIN=1;
@@ -12,9 +15,11 @@ SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=12;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4;
include/start_slave.inc
+connection master;
SET SQL_LOG_BIN=0;
ALTER TABLE mysql.gtid_slave_pos ENGINE = InnoDB;
SET SQL_LOG_BIN=1;
+connection slave;
SELECT @@gtid_slave_pos;
@@gtid_slave_pos
0-1-1381
@@ -46,4 +51,5 @@ DROP TABLE table2_int_autoinc;
DROP TABLE table2_key_pk_parts_2_int_autoinc;
SET sql_log_bin=1;
include/start_slave.inc
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev6386.result b/mysql-test/suite/rpl/r/rpl_mdev6386.result
index fa49d9a9c03..00838127302 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev6386.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev6386.result
@@ -1,8 +1,11 @@
include/master-slave.inc
[connection master]
+connection master;
ALTER TABLE mysql.gtid_slave_pos ENGINE = InnoDB;
FLUSH LOGS;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) Engine=InnoDB;
+connection slave;
+connection slave;
include/stop_slave.inc
SET sql_log_bin= 0;
INSERT INTO t1 VALUES (1, 2);
@@ -14,6 +17,7 @@ a b
1 2
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=8;
+connection master;
CREATE TEMPORARY TABLE t2 LIKE t1;
INSERT INTO t2 VALUE (1, 1);
INSERT INTO t2 VALUE (2, 1);
@@ -31,6 +35,7 @@ a b
3 1
4 1
5 1
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1062]
STOP SLAVE IO_THREAD;
@@ -51,7 +56,9 @@ a b
3 1
4 1
5 1
+connection master;
DROP TABLE t1;
+connection slave;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads= @old_parallel;
include/start_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mdev8193.result b/mysql-test/suite/rpl/r/rpl_mdev8193.result
index ad92d32e7d4..b28ff7cf9eb 100644
--- a/mysql-test/suite/rpl/r/rpl_mdev8193.result
+++ b/mysql-test/suite/rpl/r/rpl_mdev8193.result
@@ -1,6 +1,8 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave_sql.inc
+connection master;
CALL mtr.add_suppression("Statement is unsafe because it uses a system function that may return a different value on the slave");
create table t1 (i int);
insert into t1 values (1),(2);
@@ -15,10 +17,12 @@ insert into t1 values (9),(10);
insert into t1 values (11),(12);
insert into t1 values (13),(14);
insert into t1 values (15),(16);
+connection slave;
set global slave_parallel_threads = 1;
start slave until master_log_file='MASTER_FILE', master_log_pos=MASTER_POS;
drop table t1;
include/stop_slave_io.inc
set global slave_parallel_threads = DEFAULT;
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_misc_functions.result b/mysql-test/suite/rpl/r/rpl_misc_functions.result
index 61006ecd714..6c20623d62b 100644
--- a/mysql-test/suite/rpl/r/rpl_misc_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_misc_functions.result
@@ -11,10 +11,12 @@ set sql_log_bin=1;
insert into t1 values(3, 0, 0, 0, password('does_this_work?'));
insert into t1 values(4, connection_id(), rand()*1000, rand()*1000, password('does_this_still_work?'));
select * into outfile 'rpl_misc_functions.outfile' from t1;
+connection slave;
create temporary table t2 like t1;
load data local infile 'MYSQLD_DATADIR/test/rpl_misc_functions.outfile' into table t2;
select * from t1, t2 where (t1.id=t2.id) and not(t1.i=t2.i and t1.r1=t2.r1 and t1.r2=t2.r2 and t1.p=t2.p);
id i r1 r2 p id i r1 r2 p
+connection master;
drop table t1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
@@ -38,7 +40,9 @@ CALL test_replication_sp2();
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
INSERT INTO t1 (col_a) VALUES (test_replication_sf());
+connection slave;
select * from t1 into outfile "../../tmp/t1_slave.txt";
+connection master;
create temporary table t1_slave select * from t1 where 1=0;
load data infile '../../tmp/t1_slave.txt' into table t1_slave;
select count(*) into @aux from t1 join t1_slave using (id)
@@ -46,8 +50,10 @@ where ABS(t1.col_a - t1_slave.col_a) < 0.0000001 ;
SELECT @aux;
@aux
12
+connection master;
DROP TABLE t1, t1_slave;
DROP PROCEDURE test_replication_sp1;
DROP PROCEDURE test_replication_sp2;
DROP FUNCTION test_replication_sf;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mix_found_rows.result b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
index 40e80e23047..13d57e50b7f 100644
--- a/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_mix_found_rows.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialize ====
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT);
CREATE TABLE logtbl (sect INT, test INT, count INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -12,37 +12,41 @@ INSERT INTO t1 SELECT 2*a+3 FROM t1;
INSERT INTO t1 SELECT 2*a+3 FROM t1;
INSERT INTO t1 SELECT 2*a+3 FROM t1;
==== Checking a procedure ====
-**** On Master ****
+connection master;
CREATE PROCEDURE just_log(sect INT, test INT) BEGIN
INSERT INTO logtbl VALUES (sect,test,FOUND_ROWS());
END $$
-**** On Master 1 ****
+connection slave;
+connection master1;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
a
7
CALL just_log(1,1);
-**** On Master ****
+connection master;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
a
7
CALL just_log(1,2);
-**** On Master 1 ****
+connection master1;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1;
a
1
CALL just_log(1,3);
-**** On Master ****
+connection slave;
+connection master;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
a
7
CALL just_log(1,4);
+connection slave;
+connection master;
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
sect test count
1 1 183
1 2 183
1 3 3
1 4 183
-**** On Slave ****
+connection slave;
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
sect test count
1 1 183
@@ -50,7 +54,7 @@ sect test count
1 3 3
1 4 183
==== Checking a stored function ====
-**** On Master ****
+connection master;
CREATE FUNCTION log_rows(sect INT, test INT)
RETURNS INT
BEGIN
@@ -84,6 +88,7 @@ SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
a
7
INSERT INTO t2 VALUES (2,5), (2,6);
+connection master;
DROP TRIGGER t2_tr;
CREATE PROCEDURE log_me_inner(sect INT, test INT)
BEGIN
@@ -115,6 +120,7 @@ sect test count
2 6 0
2 6 183
2 7 0
+connection slave;
SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test;
sect test count
2 1 3
@@ -127,9 +133,11 @@ sect test count
2 6 0
2 6 183
2 7 0
+connection master;
DROP TABLE t1, t2, logtbl;
DROP PROCEDURE just_log;
DROP PROCEDURE log_me;
DROP PROCEDURE log_me_inner;
DROP FUNCTION log_rows;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
index 80f76169472..388c8e67b68 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_binlog_max_cache_size.result
@@ -5,12 +5,15 @@ SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
SET GLOBAL max_binlog_stmt_cache_size = 4096;
SET GLOBAL binlog_stmt_cache_size = 4096;
+disconnect master;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
########################################################################################
# 1 - SINGLE STATEMENT
########################################################################################
+connection master;
*** Single statement on transactional table ***
Got one of the listed errors
*** Single statement on non-transactional table ***
@@ -23,6 +26,7 @@ include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -49,10 +53,12 @@ INSERT INTO t1 (a, data) VALUES (27, 's');;
INSERT INTO t2 (a, data) VALUES (28, 's');;
INSERT INTO t1 (a, data) VALUES (29, 's');;
CREATE TABLE t5 (a int);
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -61,10 +67,12 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -75,10 +83,12 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -99,10 +109,12 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -117,10 +129,12 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -136,6 +150,7 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################
# 8 - Bug#55375(Regression Bug) Transaction bigger than
@@ -152,14 +167,20 @@ CALL mtr.add_suppression("Multi-statement transaction required more than 'max_bi
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
+connection master;
TRUNCATE t1;
+connection slave;
+connection master;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+disconnect master;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
BEGIN;
Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
COMMIT;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1197]
SELECT count(*) FROM t1;
count(*)
@@ -171,12 +192,15 @@ SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/start_slave.inc
+connection master;
+connection slave;
SELECT count(*) FROM t1;
count(*)
128
########################################################################################
# CLEAN
########################################################################################
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result b/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
index 2b5b31201cb..9e0626ff4a4 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_bit_pk.result
@@ -25,5 +25,8 @@ INSERT INTO `t7` ( `bit` ) VALUES ( 0 );
DELETE FROM `t7` WHERE `bit` < 2 LIMIT 4;
INSERT INTO `t8` ( `bit` ) VALUES ( 0 );
DELETE FROM `t8` WHERE `bit` < 2 LIMIT 4;
+connection slave;
+connection master;
DROP TABLE t1, t2, t3, t4, t5, t6, t7, t8;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
index 5a258647b07..ceb4fdf39d5 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_ddl_dml.result
@@ -3,17 +3,21 @@ include/master-slave.inc
create table t1 (n int auto_increment primary key);
set insert_id = 2000;
insert into t1 values (NULL),(NULL),(NULL);
+connection slave;
select * from t1;
n
2000
2001
2002
+connection master;
show slave hosts;
Server_id Host Port Master_id
2 127.0.0.1 9999 1
drop table t1;
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
create table t2(id int auto_increment primary key, created datetime);
SET TIME_ZONE= '+03:00';
set timestamp=12345;
@@ -24,6 +28,7 @@ id created
create table t3 like t2;
create temporary table t4 like t2;
create table t5 select * from t4;
+connection slave;
start slave;
include/wait_for_slave_to_start.inc
select * from t2;
@@ -42,6 +47,8 @@ t5 CREATE TABLE `t5` (
`id` int(11) NOT NULL DEFAULT '0',
`created` datetime DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection master;
drop table t2,t3,t5;
drop temporary table t4;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
index da807748cee..9b9beb5cfd1 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_drop_create_temp_table.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
SET @commands= 'configure';
+connection master;
CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb;
CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam;
CREATE TABLE tt_error_1 ( id INT, PRIMARY KEY (id) ) ENGINE = Innodb;
@@ -54,6 +55,7 @@ SET @commands= '';
#########################################################################
# 1 - Tables dropped by "DROP TEMPORARY TABLE"
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1206,6 +1208,7 @@ master-bin.000001 # Query # # ROLLBACK
#########################################################################
# 2 - Tables dropped by "DROP TABLE"
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1541,6 +1544,7 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* gen
#########################################################################
# 3 - CREATE TEMPORARY TABLE
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1820,6 +1824,7 @@ master-bin.000001 # Query # # ROLLBACK
#########################################################################
# 4 - CHANGING TEMPORARY TABLES
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -2116,10 +2121,13 @@ master-bin.000001 # Query # # COMMIT
###################################################################################
# CHECK CONSISTENCY
###################################################################################
+connection master;
+connection slave;
#########################################################################
# CLEAN
#########################################################################
SET @commands= 'clean';
+connection master;
DROP TABLE IF EXISTS tt_xx_1;
DROP TABLE IF EXISTS nt_xx_1;
DROP TABLE IF EXISTS tt_error_1;
@@ -2136,5 +2144,6 @@ DROP TEMPORARY TABLE IF EXISTS tt_tmp_1;
DROP TEMPORARY TABLE IF EXISTS nt_tmp_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
+connection slave;
SET @commands= '';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
index 328c3c3423f..d9c0bf53a5d 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_implicit_commit_binlog.result
@@ -4,6 +4,7 @@ set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
#########################################################################
+connection master;
CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb;
CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb;
CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;
diff --git a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
index 63a5493f045..94c385faab6 100644
--- a/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_mixed_mixing_engines.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
rpl_mixing_engines.inc [commands=configure]
+connection master;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -109,6 +110,7 @@ END|
#########################################################################
# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
#########################################################################
+connection master;
@@ -13196,4 +13198,5 @@ DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_delete.result b/mysql-test/suite/rpl/r/rpl_multi_delete.result
index ea1d87a3960..62a0d74225d 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_delete.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete.result
@@ -10,10 +10,13 @@ a
select * from t2;
a
1
+connection slave;
select * from t1;
a
select * from t2;
a
1
+connection master;
drop table t1,t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_delete2.result b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
index c693a43a550..0a316ec3452 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_delete2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_delete2.result
@@ -1,9 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
set sql_log_bin=0;
create database mysqltest_from;
set sql_log_bin=1;
+connection slave;
create database mysqltest_to;
+connection master;
use mysqltest_from;
drop table if exists a;
CREATE TABLE a (i INT);
@@ -16,10 +19,12 @@ delete alias FROM a alias where alias.i=2;
select * from a;
i
3
+connection slave;
use mysqltest_to;
select * from a;
i
3
+connection master;
create table t1 (a int primary key);
create table t2 (a int);
insert into t1 values (1);
@@ -30,12 +35,15 @@ a
select * from t2;
a
1
+connection slave;
select * from t1;
ERROR 42S02: Table 'mysqltest_to.t1' doesn't exist
select * from t2;
ERROR 42S02: Table 'mysqltest_to.t2' doesn't exist
+connection master;
set sql_log_bin=0;
drop database mysqltest_from;
set sql_log_bin=1;
+connection slave;
drop database mysqltest_to;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_engine.result b/mysql-test/suite/rpl/r/rpl_multi_engine.result
index 34b3789df5f..c39d9f5f374 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_engine.result
@@ -1,10 +1,14 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection master;
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 NOT NULL DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP,PRIMARY KEY(id));
+connection slave;
+connection master;
alter table t1 engine=myisam;
show create table t1;
Table Create Table
@@ -20,6 +24,8 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
+connection slave;
alter table t1 engine=myisam;
show create table t1;
Table Create Table
@@ -35,25 +41,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection slave;
alter table t1 engine=innodb;
show create table t1;
Table Create Table
@@ -69,25 +83,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection slave;
alter table t1 engine=memory;
show create table t1;
Table Create Table
@@ -103,25 +125,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection master;
alter table t1 engine=memory;
show create table t1;
Table Create Table
@@ -137,6 +167,8 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
+connection slave;
+connection slave;
alter table t1 engine=myisam;
show create table t1;
Table Create Table
@@ -152,25 +184,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection slave;
alter table t1 engine=innodb;
show create table t1;
Table Create Table
@@ -186,25 +226,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection slave;
alter table t1 engine=memory;
show create table t1;
Table Create Table
@@ -220,25 +268,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection master;
alter table t1 engine=innodb;
show create table t1;
Table Create Table
@@ -254,6 +310,8 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+connection slave;
+connection slave;
alter table t1 engine=myisam;
show create table t1;
Table Create Table
@@ -269,25 +327,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection slave;
alter table t1 engine=innodb;
show create table t1;
Table Create Table
@@ -303,25 +369,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection slave;
alter table t1 engine=memory;
show create table t1;
Table Create Table
@@ -337,24 +411,33 @@ t1 CREATE TABLE `t1` (
`t` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MEMORY DEFAULT CHARSET=latin1
+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;
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
+connection slave;
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
+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;
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
+connection slave;
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
+connection master;
DELETE FROM 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
+connection slave;
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
+connection master;
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update.result b/mysql-test/suite/rpl/r/rpl_multi_update.result
index 74fb7952a2a..b27610aeae3 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update.result
@@ -21,5 +21,7 @@ a b
1 0
2 1
UPDATE t1, t2 SET t1.b = t2.b WHERE t1.a = t2.a;
+connection slave;
+connection master;
drop table t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update2.result b/mysql-test/suite/rpl/r/rpl_multi_update2.result
index 03ed5de473d..74e8622d574 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update2.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update2.result
@@ -30,6 +30,7 @@ SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 4
@@ -38,16 +39,23 @@ SELECT * FROM t2 ORDER BY a;
a b
1 0
2 1
+connection master;
drop table t1,t2;
+connection slave;
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;
a
3
+connection slave;
+connection slave;
select * from t1;
a
3
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update3.result b/mysql-test/suite/rpl/r/rpl_multi_update3.result
index 273352fe5ed..2ebbbb56616 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update3.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update3.result
@@ -31,6 +31,8 @@ SELECT * FROM t2 ORDER BY a;
a b
1 6
2 6
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 0
@@ -39,9 +41,11 @@ SELECT * FROM t2 ORDER BY a;
a b
1 6
2 6
+connection master;
drop table t1,t2;
-------- Test 1 for BUG#9361 --------
+connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
@@ -66,15 +70,19 @@ WHERE b2 = 'baz')
AND a.a3 IS NULL
AND a.a4 = 'foo'
AND a.a5 = 'bar';
+connection slave;
+connection slave;
SELECT * FROM t1;
a1 a2 a3 a4 a5
No 1 NULL foo bar
SELECT * FROM t2;
b1 b2
1 baz
+connection master;
DROP TABLE t1, t2;
-------- Test 2 for BUG#9361 --------
+connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
@@ -115,9 +123,12 @@ FROM t3
WHERE y = 34
)
WHERE b.x = 23;
+connection slave;
+connection slave;
SELECT * FROM t1;
i j x y z
1 2 23 24 71
+connection master;
DROP TABLE t1, t2, t3;
DROP TABLE IF EXISTS t1;
Warnings:
@@ -175,6 +186,7 @@ idpro price nbprice
1 1.0000 3
2 1.0000 2
3 2.0000 1
+connection slave;
select "-- SLAVE AFTER JOIN --" as "";
-- SLAVE AFTER JOIN --
@@ -191,5 +203,6 @@ idpro price nbprice
1 1.0000 3
2 1.0000 2
3 2.0000 1
+connection master;
DROP TABLE t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_multi_update4.result b/mysql-test/suite/rpl/r/rpl_multi_update4.result
index 0c4857bed60..256c1c503ab 100644
--- a/mysql-test/suite/rpl/r/rpl_multi_update4.result
+++ b/mysql-test/suite/rpl/r/rpl_multi_update4.result
@@ -1,8 +1,11 @@
include/master-slave.inc
[connection master]
+connection master;
drop database if exists d1;
drop database if exists d2;
+connection slave;
drop database if exists d2;
+connection master;
create database d1;
create table d1.t0 (id int);
create database d2;
@@ -13,10 +16,13 @@ insert into t1 values (1), (2), (3), (4), (5);
insert into t2 select id + 3 from t1;
update t1 join t2 using (id) set t1.id = 0;
insert into d1.t0 values (0);
+connection slave;
use d1;
select * from t0 where id=0;
id
0
+connection master;
drop database d1;
drop database d2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
index 9e360beba2c..1f352e68bc7 100644
--- a/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
+++ b/mysql-test/suite/rpl/r/rpl_mysql_upgrade.result
@@ -2,12 +2,21 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("table or database name 'mysqltest-1'");
+connection master;
DROP DATABASE IF EXISTS `#mysql50#mysqltest-1`;
CREATE DATABASE `#mysql50#mysqltest-1`;
+connection slave;
+connection master;
+connection slave;
+connection master;
Master position is not changed
+connection slave;
STOP SLAVE SQL_THREAD;
include/wait_for_slave_sql_to_stop.inc
+connection master;
+connection master;
Master position has been changed
DROP DATABASE `mysqltest-1`;
+connection slave;
DROP DATABASE `#mysql50#mysqltest-1`;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_name_const.result b/mysql-test/suite/rpl/r/rpl_name_const.result
index 89a48bad09b..7e91cf474ab 100644
--- a/mysql-test/suite/rpl/r/rpl_name_const.result
+++ b/mysql-test/suite/rpl/r/rpl_name_const.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialize ====
-[on master]
+connection master;
create table t1 (id int);
==== create a procedure that has a column aliase in a subquery ====
drop procedure if exists test_procedure;
@@ -14,12 +14,12 @@ from
end;$$
==== enable the binary log, then call the procedure ====
call test_procedure(1234);
-[on slave]
+connection slave;
select * from t1 order by id;
id
1234
==== Clean up ====
-[on master]
+connection master;
drop table t1;
drop procedure test_procedure;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
index 5811617e71e..55d7a164324 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_mixed_mixing_engines.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
rpl_mixing_engines.inc [commands=configure]
+connection master;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -109,6 +110,7 @@ END|
#########################################################################
# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
#########################################################################
+connection master;
@@ -13588,4 +13590,5 @@ DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
index 7831919c8b6..775ae83c618 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_row_mixing_engines.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
rpl_mixing_engines.inc [commands=configure]
+connection master;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -109,6 +110,7 @@ END|
#########################################################################
# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
#########################################################################
+connection master;
@@ -15464,4 +15466,5 @@ DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
index 8a110048d80..b4b972a231d 100644
--- a/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_non_direct_stm_mixing_engines.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
rpl_mixing_engines.inc [commands=configure]
+connection master;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -109,6 +110,7 @@ END|
#########################################################################
# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
#########################################################################
+connection master;
@@ -12685,4 +12687,5 @@ DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result b/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
index ebbc657fcfd..630bfa226cf 100644
--- a/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
+++ b/mysql-test/suite/rpl/r/rpl_nondeterministic_functions.result
@@ -3,6 +3,7 @@ include/master-slave.inc
CALL mtr.add_suppression('Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT');
CREATE TABLE t1 (a VARCHAR(1000));
INSERT INTO t1 VALUES (CONNECTION_ID());
+connection master1;
INSERT INTO t1 VALUES (CONNECTION_ID());
INSERT INTO t1 VALUES
(CURDATE()),
@@ -19,6 +20,8 @@ INSERT INTO t1 VALUES
(UTC_TIMESTAMP());
INSERT INTO t1 VALUES (RAND());
INSERT INTO t1 VALUES (LAST_INSERT_ID());
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
index 1eaeaba05bb..2d53a525f2c 100644
--- a/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_not_null_innodb.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -12,6 +13,7 @@ CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
@@ -23,6 +25,7 @@ PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, 1);
INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
INSERT INTO t1(a,b) VALUES (3, null);
@@ -40,20 +43,24 @@ INSERT INTO t4(a,b) VALUES (3, null);
INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
+connection master;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
2 1111-11-11
3 NULL
+connection slave;
SELECT * FROM t3 ORDER BY a;
a b c
1 NULL 500
2 1111-11-11 500
3 NULL 500
+connection master;
SELECT * FROM t4 ORDER BY a;
a b c
1 NULL 1
@@ -61,6 +68,7 @@ a b c
3 NULL NULL
4 NULL 4
5 NULL NULL
+connection slave;
SELECT * FROM t4 ORDER BY a;
a b
1 NULL
@@ -69,26 +77,33 @@ a b
4 NULL
5 NULL
************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
+connection slave;
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= Innodb;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= Innodb;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
INSERT INTO t1(a,b) VALUES (3, null);
@@ -96,6 +111,8 @@ INSERT INTO t1(a,c) VALUES (4, b'01');
INSERT INTO t1(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be different.
+connection slave;
+connection master;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
a b+0 c+0
1 NULL 1
@@ -103,6 +120,7 @@ a b+0 c+0
3 NULL NULL
4 NULL 1
5 NULL NULL
+connection slave;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
a b+0 c+0
1 NULL 1
@@ -111,6 +129,7 @@ a b+0 c+0
4 NULL 1
5 NULL NULL
************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
@@ -118,8 +137,11 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
# UNCOMMENT THIS AFTER FIXING BUG#43992
@@ -127,6 +149,7 @@ DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (NON-STRICT MODE)
################################################################################
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
@@ -135,6 +158,7 @@ PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT NOT NULL,
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
@@ -145,6 +169,7 @@ CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT DEFAULT 500,
PRIMARY KEY(`a`)) ENGINE=Innodb DEFAULT CHARSET=LATIN1;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a) VALUES (1);
INSERT INTO t1(a, b) VALUES (2, NULL);
INSERT INTO t1(a, b) VALUES (3, 1);
@@ -159,26 +184,33 @@ REPLACE INTO t3(a, b) VALUES (5, null);
REPLACE INTO t3(a, b) VALUES (3, null);
UPDATE t3 SET b = NULL where a = 4;
************* SHOWING THE RESULT SETS *************
+connection master;
+connection slave;
+connection master;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
3 1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c
1 0 0
2 0 0
3 1 0
+connection master;
SELECT * FROM t2 ORDER BY a;
a b
1 NULL
2 NULL
3 1
+connection slave;
SELECT * FROM t2 ORDER BY a;
a b c
1 0 NULL
2 0 NULL
3 1 NULL
+connection master;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
@@ -186,6 +218,7 @@ a b
3 NULL
4 NULL
5 NULL
+connection slave;
SELECT * FROM t3 ORDER BY a;
a b c
1 0 500
@@ -193,7 +226,9 @@ a b c
3 0 500
4 0 500
5 0 500
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
index ec17e3bfafa..93c13e9943f 100644
--- a/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_not_null_myisam.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -12,6 +13,7 @@ CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
@@ -23,6 +25,7 @@ PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, 1);
INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
INSERT INTO t1(a,b) VALUES (3, null);
@@ -40,20 +43,24 @@ INSERT INTO t4(a,b) VALUES (3, null);
INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
+connection master;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
2 1111-11-11
3 NULL
+connection slave;
SELECT * FROM t3 ORDER BY a;
a b c
1 NULL 500
2 1111-11-11 500
3 NULL 500
+connection master;
SELECT * FROM t4 ORDER BY a;
a b c
1 NULL 1
@@ -61,6 +68,7 @@ a b c
3 NULL NULL
4 NULL 4
5 NULL NULL
+connection slave;
SELECT * FROM t4 ORDER BY a;
a b
1 NULL
@@ -69,26 +77,33 @@ a b
4 NULL
5 NULL
************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
+connection slave;
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= MyISAM;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= MyISAM;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
INSERT INTO t1(a,b) VALUES (3, null);
@@ -96,6 +111,8 @@ INSERT INTO t1(a,c) VALUES (4, b'01');
INSERT INTO t1(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be different.
+connection slave;
+connection master;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
a b+0 c+0
1 NULL 1
@@ -103,6 +120,7 @@ a b+0 c+0
3 NULL NULL
4 NULL 1
5 NULL NULL
+connection slave;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
a b+0 c+0
1 NULL 1
@@ -111,6 +129,7 @@ a b+0 c+0
4 NULL 1
5 NULL NULL
************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
@@ -118,8 +137,11 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
# UNCOMMENT THIS AFTER FIXING BUG#43992
@@ -127,6 +149,7 @@ DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (NON-STRICT MODE)
################################################################################
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
@@ -135,6 +158,7 @@ PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT NOT NULL,
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
@@ -145,6 +169,7 @@ CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT DEFAULT 500,
PRIMARY KEY(`a`)) ENGINE=MyISAM DEFAULT CHARSET=LATIN1;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a) VALUES (1);
INSERT INTO t1(a, b) VALUES (2, NULL);
INSERT INTO t1(a, b) VALUES (3, 1);
@@ -159,26 +184,33 @@ REPLACE INTO t3(a, b) VALUES (5, null);
REPLACE INTO t3(a, b) VALUES (3, null);
UPDATE t3 SET b = NULL where a = 4;
************* SHOWING THE RESULT SETS *************
+connection master;
+connection slave;
+connection master;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
3 1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c
1 0 0
2 0 0
3 1 0
+connection master;
SELECT * FROM t2 ORDER BY a;
a b
1 NULL
2 NULL
3 1
+connection slave;
SELECT * FROM t2 ORDER BY a;
a b c
1 0 NULL
2 0 NULL
3 1 NULL
+connection master;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
@@ -186,6 +218,7 @@ a b
3 NULL
4 NULL
5 NULL
+connection slave;
SELECT * FROM t3 ORDER BY a;
a b c
1 0 500
@@ -193,7 +226,9 @@ a b c
3 0 500
4 0 500
5 0 500
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_old_decimal.result b/mysql-test/suite/rpl/r/rpl_old_decimal.result
index 3e2fa3bf241..733bf4f92ef 100644
--- a/mysql-test/suite/rpl/r/rpl_old_decimal.result
+++ b/mysql-test/suite/rpl/r/rpl_old_decimal.result
@@ -1,9 +1,13 @@
include/master-slave.inc
[connection master]
+connection slave;
CREATE TABLE t1dec102 (a DECIMAL(10,2));
+connection master;
INSERT INTO t1dec102 VALUES(999.99);
call mtr.add_suppression("Slave SQL.*Column 0 of table .* cannot be converted from type.* Error_code: 1677");
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1dec102' cannot be converted from type 'decimal(0,?)/*old*/' to type 'decimal(10,2)''
+connection master;
DROP TABLE t1dec102;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_old_master.result b/mysql-test/suite/rpl/r/rpl_old_master.result
index df5bbe34256..dd3de4d327b 100644
--- a/mysql-test/suite/rpl/r/rpl_old_master.result
+++ b/mysql-test/suite/rpl/r/rpl_old_master.result
@@ -1,14 +1,19 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
+connection master;
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
+connection slave;
SET @old_parallel= @@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_host='127.0.0.1', master_port=SERVER_MYPORT_1, master_user='root', master_log_file='master-bin.000001', master_log_pos=4;
include/start_slave.inc
+connection master;
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1);
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 1
@@ -23,5 +28,6 @@ include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel;
DROP TABLE t1;
include/start_slave.inc
+connection master;
DROP TABLE t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_optimize.result b/mysql-test/suite/rpl/r/rpl_optimize.result
index 260ee30ac06..d53ddbe23d3 100644
--- a/mysql-test/suite/rpl/r/rpl_optimize.result
+++ b/mysql-test/suite/rpl/r/rpl_optimize.result
@@ -18,8 +18,13 @@ INSERT INTO t1 (a) SELECT null FROM t1;
INSERT INTO t1 (a) SELECT null FROM t1;
update t1 set b=(a/2*rand());
delete from t1 order by b limit 10000;
+connection slave;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+connection master;
+connection slave;
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result
index 07558053287..4a2a5d70d39 100644
--- a/mysql-test/suite/rpl/r/rpl_packet.result
+++ b/mysql-test/suite/rpl/r/rpl_packet.result
@@ -4,15 +4,21 @@ call mtr.add_suppression("Slave I/O: Got a packet bigger than 'slave_max_allowed
call mtr.add_suppression("Log entry on master is longer than slave_max_allowed_packet");
drop database if exists DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
create database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+connection master;
SET @@global.max_allowed_packet=1024;
SET @@global.net_buffer_length=1024;
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+disconnect master;
+connect master,localhost,root,,DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+connection master;
select @@net_buffer_length, @@max_allowed_packet;
@@net_buffer_length @@max_allowed_packet
1024 1024
create table `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1023');
+connection slave;
select count(*) from `DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________`.`t1` /* must be 1 */;
count(*)
1
@@ -22,24 +28,41 @@ Slave_running ON
select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
VARIABLE_NAME VARIABLE_VALUE
SLAVE_RUNNING ON
+connection master;
drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
+connection slave;
+connection master;
SET @@global.max_allowed_packet=4096;
SET @@global.net_buffer_length=4096;
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+disconnect master;
+connect master, localhost, root;
+connection master;
CREATE TABLE `t1` (`f1` LONGTEXT) ENGINE=MyISAM;
+connection slave;
+connection master;
INSERT INTO `t1`(`f1`) VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa2048');
+connection slave;
include/wait_for_slave_io_error.inc [errno=1153]
Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
include/stop_slave_sql.inc
include/rpl_reset.inc
+connection master;
DROP TABLE t1;
+connection slave;
+connection master;
CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM;
+connection slave;
+connection master;
INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet));
+connection slave;
include/wait_for_slave_io_error.inc [errno=1153]
Last_IO_Error = 'Got a packet bigger than 'slave_max_allowed_packet' bytes'
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
SET @max_allowed_packet_0= @@session.max_allowed_packet;
SHOW BINLOG EVENTS;
@@ -47,12 +70,14 @@ SET @max_allowed_packet_1= @@session.max_allowed_packet;
SHOW BINLOG EVENTS;
SET @max_allowed_packet_2= @@session.max_allowed_packet;
==== clean up ====
+connection master;
DROP TABLE t1;
SET @@global.max_allowed_packet= 1024;
Warnings:
Warning 1708 The value of 'max_allowed_packet' should be no less than the value of 'net_buffer_length'
SET @@global.net_buffer_length= 1024;
SET @@global.slave_max_allowed_packet= 1073741824;
+connection slave;
DROP TABLE t1;
RESET SLAVE;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel.result b/mysql-test/suite/rpl/r/rpl_parallel.result
index 631b071136b..1b149fb170e 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=10;
ERROR HY000: This operation cannot be performed as you have a running slave ''; run STOP SLAVE '' first
@@ -22,12 +23,16 @@ SELECT IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ",
IF(COUNT(*) >= 10, "OK", CONCAT("Found too few system user processes: ", COUNT(*)))
OK
*** Test long-running query in domain 1 can run in parallel with short queries in domain 0 ***
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
+connection server_2;
+connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
LOCK TABLE t1 WRITE;
+connection server_1;
SET gtid_domain_id=1;
INSERT INTO t1 VALUES (2);
SET gtid_domain_id=0;
@@ -38,6 +43,7 @@ INSERT INTO t2 VALUES (4);
INSERT INTO t2 VALUES (5);
COMMIT;
INSERT INTO t2 VALUES (6);
+connection server_2;
SELECT * FROM t2 ORDER by a;
a
1
@@ -46,16 +52,20 @@ a
4
5
6
+connection con_temp1;
SELECT * FROM t1;
a
1
UNLOCK TABLES;
+connection server_2;
SELECT * FROM t1 ORDER BY a;
a
1
2
*** Test two transactions in different domains committed in opposite order on slave but in a single group commit. ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
SET sql_log_bin=0;
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
RETURNS INT DETERMINISTIC
@@ -70,6 +80,7 @@ SET gtid_domain_id=1;
INSERT INTO t2 VALUES (foo(10,
'commit_before_enqueue SIGNAL ready1 WAIT_FOR cont1',
'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'));
+connection server_2;
FLUSH LOGS;
SET sql_log_bin=0;
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
@@ -91,6 +102,7 @@ SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
SET debug_sync='now WAIT_FOR ready1';
+connection server_1;
SET gtid_domain_id=2;
INSERT INTO t2 VALUES (foo(11,
'commit_before_enqueue SIGNAL ready3 WAIT_FOR cont3',
@@ -100,6 +112,7 @@ SELECT * FROM t2 WHERE a >= 10 ORDER BY a;
a
10
11
+connection server_2;
SET debug_sync='now WAIT_FOR ready3';
SET debug_sync='now SIGNAL cont3';
SET debug_sync='now WAIT_FOR ready4';
@@ -124,40 +137,55 @@ slave-bin.000002 # Query # # use `test`; INSERT INTO t2 VALUES (foo(10,
'commit_after_release_LOCK_prepare_ordered SIGNAL ready2'))
slave-bin.000002 # Xid # # COMMIT /* XID */
FLUSH LOGS;
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
SET debug_sync='RESET';
include/start_slave.inc
*** Test that group-committed transactions on the master can replicate in parallel on the slave. ***
+connection server_1;
SET debug_sync='RESET';
FLUSH LOGS;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t3 VALUES (1,1), (3,3), (5,5), (7,7);
+connection server_2;
+connection con_temp1;
BEGIN;
INSERT INTO t3 VALUES (2,102);
+connect con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
BEGIN;
INSERT INTO t3 VALUES (4,104);
+connect con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
SET binlog_format=statement;
INSERT INTO t3 VALUES (2, foo(12,
'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued1 WAIT_FOR slave_cont1',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connect con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
SET binlog_format=statement;
INSERT INTO t3 VALUES (4, foo(14,
'commit_after_release_LOCK_prepare_ordered SIGNAL slave_queued2',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connect con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
SET binlog_format=statement;
INSERT INTO t3 VALUES (6, foo(16,
'group_commit_waiting_for_prior SIGNAL slave_queued3',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
SET debug_sync='now SIGNAL master_cont1';
+connection con_temp3;
+connection con_temp4;
+connection con_temp5;
SET debug_sync='RESET';
+connection server_1;
SELECT * FROM t3 ORDER BY a;
a b
1 1
@@ -190,10 +218,15 @@ master-bin.000002 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
'group_commit_waiting_for_prior SIGNAL slave_queued3',
''))
master-bin.000002 # Xid # # COMMIT /* XID */
+connection server_2;
SET debug_sync='now WAIT_FOR slave_queued3';
+connection con_temp1;
ROLLBACK;
+connection server_2;
SET debug_sync='now WAIT_FOR slave_queued1';
+connection con_temp2;
ROLLBACK;
+connection server_2;
SET debug_sync='now WAIT_FOR slave_queued2';
SET debug_sync='now SIGNAL slave_cont1';
SELECT * FROM t3 ORDER BY a;
@@ -229,10 +262,12 @@ slave-bin.000003 # Query # # use `test`; INSERT INTO t3 VALUES (6, foo(16,
''))
slave-bin.000003 # Xid # # COMMIT /* XID */
*** Test STOP SLAVE in parallel mode ***
+connection server_2;
include/stop_slave.inc
SET debug_sync='RESET';
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
+connection server_1;
SET binlog_direct_non_transactional_updates=0;
SET sql_log_bin=0;
CALL mtr.add_suppression("Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction");
@@ -246,16 +281,22 @@ COMMIT;
INSERT INTO t3 VALUES(21, 21);
INSERT INTO t3 VALUES(22, 22);
SET binlog_format=@old_format;
+connection con_temp1;
BEGIN;
INSERT INTO t2 VALUES (21);
+connection server_2;
START SLAVE;
+connection con_temp2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
STOP SLAVE;
+connection con_temp1;
SET debug_sync='now WAIT_FOR wait_for_done_waiting';
ROLLBACK;
+connection con_temp2;
SET GLOBAL debug_dbug=@old_dbug;
SET debug_sync='RESET';
+connection server_2;
include/wait_for_slave_to_stop.inc
SELECT * FROM t1 WHERE a >= 20 ORDER BY a;
a
@@ -280,6 +321,7 @@ a b
20 20
21 21
22 22
+connection server_2;
include/stop_slave.inc
SET GLOBAL binlog_format=@old_format;
SET GLOBAL slave_parallel_threads=0;
@@ -287,12 +329,15 @@ SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** Test killing slave threads at various wait points ***
*** 1. Test killing transaction waiting in commit for previous transaction to commit ***
+connection con_temp3;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
SET binlog_format=statement;
INSERT INTO t3 VALUES (31, foo(31,
'commit_before_prepare_ordered WAIT_FOR t2_waiting',
'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con_temp4;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
SET binlog_format=statement;
BEGIN;
@@ -303,14 +348,21 @@ INSERT INTO t3 VALUES (33, foo(33,
'group_commit_waiting_for_prior SIGNAL t2_waiting',
'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connection con_temp5;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
SET binlog_format=statement;
INSERT INTO t3 VALUES (34, foo(34,
'',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
SET debug_sync='now SIGNAL master_cont1';
+connection con_temp3;
+connection con_temp4;
+connection con_temp5;
+connection server_1;
SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
a b
31 31
@@ -318,6 +370,7 @@ a b
33 33
34 34
SET debug_sync='RESET';
+connection server_2;
SET sql_log_bin=0;
CALL mtr.add_suppression("Query execution was interrupted");
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
@@ -346,7 +399,9 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_1;
INSERT INTO t3 VALUES (39,0);
+connection server_2;
include/start_slave.inc
SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
a b
@@ -370,18 +425,22 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_2;
include/stop_slave.inc
SET GLOBAL binlog_format=@old_format;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** 2. Same as (1), but without restarting IO thread after kill of SQL threads ***
+connection con_temp3;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
SET binlog_format=statement;
INSERT INTO t3 VALUES (41, foo(41,
'commit_before_prepare_ordered WAIT_FOR t2_waiting',
'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con_temp4;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
SET binlog_format=statement;
BEGIN;
@@ -392,14 +451,21 @@ INSERT INTO t3 VALUES (43, foo(43,
'group_commit_waiting_for_prior SIGNAL t2_waiting',
'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connection con_temp5;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
SET binlog_format=statement;
INSERT INTO t3 VALUES (44, foo(44,
'',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
SET debug_sync='now SIGNAL master_cont1';
+connection con_temp3;
+connection con_temp4;
+connection con_temp5;
+connection server_1;
SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
a b
41 41
@@ -407,6 +473,7 @@ a b
43 43
44 44
SET debug_sync='RESET';
+connection server_2;
SET debug_sync='now WAIT_FOR t2_query';
SET debug_sync='now SIGNAL t2_cont';
SET debug_sync='now WAIT_FOR t1_ready';
@@ -426,7 +493,9 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_1;
INSERT INTO t3 VALUES (49,0);
+connection server_2;
START SLAVE SQL_THREAD;
SELECT * FROM t3 WHERE a >= 40 ORDER BY a;
a b
@@ -450,21 +519,27 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_2;
include/stop_slave.inc
SET GLOBAL binlog_format=@old_format;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** 3. Same as (2), but not using gtid mode ***
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=no;
include/start_slave.inc
+connection server_1;
+connection con_temp3;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
SET binlog_format=statement;
INSERT INTO t3 VALUES (51, foo(51,
'commit_before_prepare_ordered WAIT_FOR t2_waiting',
'commit_after_prepare_ordered SIGNAL t1_ready WAIT_FOR t1_cont'));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con_temp4;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
SET binlog_format=statement;
BEGIN;
@@ -475,14 +550,21 @@ INSERT INTO t3 VALUES (53, foo(53,
'group_commit_waiting_for_prior SIGNAL t2_waiting',
'group_commit_waiting_for_prior_killed SIGNAL t2_killed'));
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connection con_temp5;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
SET binlog_format=statement;
INSERT INTO t3 VALUES (54, foo(54,
'',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
SET debug_sync='now SIGNAL master_cont1';
+connection con_temp3;
+connection con_temp4;
+connection con_temp5;
+connection server_1;
SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
a b
51 51
@@ -490,6 +572,7 @@ a b
53 53
54 54
SET debug_sync='RESET';
+connection server_2;
SET debug_sync='now WAIT_FOR t2_query';
SET debug_sync='now SIGNAL t2_cont';
SET debug_sync='now WAIT_FOR t1_ready';
@@ -512,7 +595,9 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_1;
INSERT INTO t3 VALUES (59,0);
+connection server_2;
START SLAVE SQL_THREAD;
SELECT * FROM t3 WHERE a >= 50 ORDER BY a;
a b
@@ -539,12 +624,14 @@ SET sql_log_bin=1;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_2;
include/stop_slave.inc
SET GLOBAL binlog_format=@old_format;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=4;
include/start_slave.inc
*** 4. Test killing thread that is waiting to start transaction until previous transaction commits ***
+connection server_1;
SET binlog_format=statement;
SET gtid_domain_id=2;
BEGIN;
@@ -555,7 +642,9 @@ INSERT INTO t3 VALUES (60, foo(60,
'rpl_parallel_end_of_group SIGNAL d2_done WAIT_FOR d2_cont'));
COMMIT;
SET gtid_domain_id=0;
+connection server_2;
SET debug_sync='now WAIT_FOR d2_query';
+connection server_1;
SET gtid_domain_id=1;
BEGIN;
INSERT INTO t3 VALUES (61, foo(61,
@@ -566,12 +655,16 @@ INSERT INTO t3 VALUES (62, foo(62,
'rpl_parallel_end_of_group SIGNAL d1_done WAIT_FOR d1_cont'));
COMMIT;
SET gtid_domain_id=0;
+connection server_2;
SET debug_sync='now WAIT_FOR d1_query';
+connection server_1;
SET gtid_domain_id=0;
INSERT INTO t3 VALUES (63, foo(63,
'ha_write_row_end SIGNAL d0_query WAIT_FOR d0_cont2',
'rpl_parallel_end_of_group SIGNAL d0_done WAIT_FOR d0_cont'));
+connection server_2;
SET debug_sync='now WAIT_FOR d0_query';
+connection server_1;
SET gtid_domain_id=3;
BEGIN;
INSERT INTO t3 VALUES (68, foo(68,
@@ -581,6 +674,7 @@ INSERT INTO t3 VALUES (69, foo(69,
'rpl_parallel_end_of_group SIGNAL d3_done WAIT_FOR d3_cont'));
COMMIT;
SET gtid_domain_id=0;
+connection server_2;
SET debug_sync='now WAIT_FOR d3_query';
SET debug_sync='now SIGNAL d2_cont2';
SET debug_sync='now WAIT_FOR d2_done';
@@ -590,19 +684,29 @@ SET debug_sync='now SIGNAL d0_cont2';
SET debug_sync='now WAIT_FOR d0_done';
SET debug_sync='now SIGNAL d3_cont2';
SET debug_sync='now WAIT_FOR d3_done';
+connection con_temp3;
SET binlog_format=statement;
INSERT INTO t3 VALUES (64, foo(64,
'rpl_parallel_before_mark_start_commit SIGNAL t1_waiting WAIT_FOR t1_cont', ''));
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2 WAIT_FOR master_cont2';
INSERT INTO t3 VALUES (65, foo(65, '', ''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connection con_temp4;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
INSERT INTO t3 VALUES (66, foo(66, '', ''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
+connection con_temp5;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued4';
INSERT INTO t3 VALUES (67, foo(67, '', ''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued4';
SET debug_sync='now SIGNAL master_cont2';
+connection con_temp3;
+connection con_temp4;
+connection con_temp5;
+connection server_1;
SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
a b
60 60
@@ -617,6 +721,7 @@ a b
69 69
70 70
SET debug_sync='RESET';
+connection server_2;
SET debug_sync='now SIGNAL d0_cont';
SET debug_sync='now WAIT_FOR t1_waiting';
SET debug_sync='now SIGNAL d3_cont';
@@ -652,7 +757,9 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_1;
UPDATE t3 SET b=b+1 WHERE a=60;
+connection server_2;
include/start_slave.inc
SELECT * FROM t3 WHERE a >= 60 ORDER BY a;
a b
@@ -682,6 +789,7 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_2;
include/stop_slave.inc
SET GLOBAL binlog_format=@old_format;
SET GLOBAL slave_parallel_threads=0;
@@ -690,16 +798,20 @@ include/start_slave.inc
*** 5. Test killing thread that is waiting for queue of max length to shorten ***
SET @old_max_queued= @@GLOBAL.slave_parallel_max_queued;
SET GLOBAL slave_parallel_max_queued=9000;
+connection server_1;
SET binlog_format=statement;
INSERT INTO t3 VALUES (80, foo(0,
'ha_write_row_end SIGNAL query_waiting WAIT_FOR query_cont', ''));
+connection server_2;
SET debug_sync='now WAIT_FOR query_waiting';
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_wait_queue_max";
+connection server_1;
SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
a b
80 0
81 10000
+connection server_2;
SET debug_sync='now WAIT_FOR wait_queue_ready';
KILL THD_ID;
SET debug_sync='now WAIT_FOR wait_queue_killed';
@@ -708,8 +820,10 @@ include/wait_for_slave_sql_error.inc [errno=1317,1927,1964]
STOP SLAVE IO_THREAD;
SET GLOBAL debug_dbug=@old_dbug;
SET GLOBAL slave_parallel_max_queued= @old_max_queued;
+connection server_1;
INSERT INTO t3 VALUES (82,0);
SET binlog_format=@old_format;
+connection server_2;
SET debug_sync='RESET';
include/start_slave.inc
SELECT * FROM t3 WHERE a >= 80 ORDER BY a;
@@ -717,50 +831,69 @@ a b
80 0
81 10000
82 0
+connection server_2;
include/stop_slave.inc
SET GLOBAL binlog_format=@old_format;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** MDEV-5788 Incorrect free of rgi->deferred_events in parallel replication ***
+connection server_2;
include/stop_slave.inc
SET GLOBAL replicate_ignore_table="test.t3";
SET GLOBAL slave_parallel_threads=2;
include/start_slave.inc
+connection server_1;
INSERT INTO t3 VALUES (100, rand());
INSERT INTO t3 VALUES (101, rand());
+connection server_2;
+connection server_1;
INSERT INTO t3 VALUES (102, rand());
INSERT INTO t3 VALUES (103, rand());
INSERT INTO t3 VALUES (104, rand());
INSERT INTO t3 VALUES (105, rand());
+connection server_2;
include/stop_slave.inc
SET GLOBAL replicate_ignore_table="";
include/start_slave.inc
+connection server_1;
INSERT INTO t3 VALUES (106, rand());
INSERT INTO t3 VALUES (107, rand());
+connection server_2;
SELECT * FROM t3 WHERE a >= 100 ORDER BY a;
a b
106 #
107 #
*** MDEV-5921: In parallel replication, an error is not correctly signalled to the next transaction ***
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
+connection server_1;
INSERT INTO t3 VALUES (110, 1);
+connection server_2;
SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
a b
110 1
SET sql_log_bin=0;
INSERT INTO t3 VALUES (111, 666);
SET sql_log_bin=1;
+connection server_1;
+connect con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
INSERT INTO t3 VALUES (111, 2);
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connect con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
INSERT INTO t3 VALUES (112, 3);
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
+connection con2;
SET debug_sync='RESET';
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1062]
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t3 WHERE a >= 110 ORDER BY a;
@@ -777,17 +910,26 @@ a b
111 2
112 3
***MDEV-5914: Parallel replication deadlock due to InnoDB lock conflicts ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
CREATE TABLE t4 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB;
INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+connection con1;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
UPDATE t4 SET b=NULL WHERE a=6;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con2;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
DELETE FROM t4 WHERE b <= 3;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
+connection con2;
SET debug_sync='RESET';
+connection server_2;
include/start_slave.inc
include/stop_slave.inc
SELECT * FROM t4 ORDER BY a;
@@ -797,16 +939,24 @@ a b
4 4
5 NULL
6 NULL
+connection server_1;
DELETE FROM t4;
INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+connection con1;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
INSERT INTO t4 VALUES (7, NULL);
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con2;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
DELETE FROM t4 WHERE b <= 3;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
+connection con2;
SET debug_sync='RESET';
+connection server_2;
include/start_slave.inc
include/stop_slave.inc
SELECT * FROM t4 ORDER BY a;
@@ -817,19 +967,27 @@ a b
5 NULL
6 6
7 NULL
+connection server_1;
DELETE FROM t4;
INSERT INTO t4 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
+connection con1;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
UPDATE t4 SET b=NULL WHERE a=6;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con2;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format='statement';
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
DELETE FROM t4 WHERE b <= 1;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
+connection con2;
SET @old_format=@@GLOBAL.binlog_format;
SET debug_sync='RESET';
+connection server_2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,disable_thd_need_ordering_with";
include/start_slave.inc
@@ -854,52 +1012,67 @@ WHERE CONCAT(domain_id, "-", server_id, "-", seq_no) = @last_gtid;
Is the row found?
ROW FOUND
*** MDEV-5938: Exec_master_log_pos not updated at log rotate in parallel replication ***
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=1;
SET DEBUG_SYNC= 'RESET';
include/start_slave.inc
+connection server_1;
CREATE TABLE t5 (a INT PRIMARY KEY, b INT);
INSERT INTO t5 VALUES (1,1);
INSERT INTO t5 VALUES (2,2), (3,8);
INSERT INTO t5 VALUES (4,16);
+connection server_2;
test_check
OK
test_check
OK
+connection server_1;
FLUSH LOGS;
+connection server_2;
test_check
OK
test_check
OK
*** MDEV_6435: Incorrect error handling when query binlogged partially on master with "killed" error ***
+connection server_1;
CREATE TABLE t6 (a INT) ENGINE=MyISAM;
CREATE TRIGGER tr AFTER INSERT ON t6 FOR EACH ROW SET @a = 1;
+connection con1;
SET @old_format= @@binlog_format;
SET binlog_format= statement;
SET debug_sync='sp_head_execute_before_loop SIGNAL ready WAIT_FOR cont';
INSERT INTO t6 VALUES (1), (2), (3);
+connection server_1;
SET debug_sync='now WAIT_FOR ready';
KILL QUERY CONID;
SET debug_sync='now SIGNAL cont';
+connection con1;
ERROR 70100: Query execution was interrupted
SET binlog_format= @old_format;
SET debug_sync='RESET';
+connection server_1;
SET debug_sync='RESET';
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1317]
STOP SLAVE IO_THREAD;
SET GLOBAL gtid_slave_pos= 'AFTER_ERROR_GTID_POS';
include/start_slave.inc
+connection server_1;
INSERT INTO t6 VALUES (4);
SELECT * FROM t6 ORDER BY a;
a
1
4
+connection server_2;
SELECT * FROM t6 ORDER BY a;
a
4
*** MDEV-6551: Some replication errors are ignored if slave_parallel_threads > 0 ***
+connection server_1;
INSERT INTO t2 VALUES (31);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET GLOBAL slave_parallel_threads= 0;
@@ -907,6 +1080,7 @@ include/start_slave.inc
SET sql_log_bin= 0;
INSERT INTO t2 VALUES (32);
SET sql_log_bin= 1;
+connection server_1;
INSERT INTO t2 VALUES (32);
FLUSH LOGS;
INSERT INTO t2 VALUES (33);
@@ -918,7 +1092,9 @@ a
33
34
include/save_master_gtid.inc
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1062]
+connection server_2;
include/stop_slave_io.inc
SET GLOBAL slave_parallel_threads=10;
START SLAVE;
@@ -941,9 +1117,11 @@ a
33
34
*** MDEV-6775: Wrong binlog order in parallel replication ***
+connection server_1;
DELETE FROM t4;
INSERT INTO t4 VALUES (1,NULL), (3,NULL), (4,4), (5, NULL), (6, 6);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
@@ -952,18 +1130,24 @@ SET @old_format=@@GLOBAL.binlog_format;
SET GLOBAL binlog_format=ROW;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
+connection con1;
SET @old_format= @@binlog_format;
SET binlog_format= statement;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
UPDATE t4 SET b=NULL WHERE a=6;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con2;
SET @old_format= @@binlog_format;
SET binlog_format= statement;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
DELETE FROM t4 WHERE b <= 3;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
SET binlog_format= @old_format;
+connection con2;
SET binlog_format= @old_format;
SET debug_sync='RESET';
SELECT * FROM t4 ORDER BY a;
@@ -973,6 +1157,7 @@ a b
4 4
5 NULL
6 NULL
+connection server_2;
include/start_slave.inc
SET debug_sync= 'now WAIT_FOR waiting';
SELECT * FROM t4 ORDER BY a;
@@ -990,7 +1175,9 @@ SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** MDEV-7237: Parallel replication: incorrect relaylog position after stop/start the slave ***
+connection server_1;
INSERT INTO t2 VALUES (40);
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=no;
SET @old_dbug= @@GLOBAL.debug_dbug;
@@ -998,6 +1185,7 @@ SET GLOBAL debug_dbug="+d,rpl_parallel_scheduled_gtid_0_x_100";
SET GLOBAL debug_dbug="+d,rpl_parallel_wait_for_done_trigger";
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
+connection server_1;
INSERT INTO t2 VALUES (41);
INSERT INTO t2 VALUES (42);
SET @old_format= @@binlog_format;
@@ -1010,15 +1198,19 @@ FLUSH LOGS;
INSERT INTO t2 VALUES (45);
SET gtid_seq_no=100;
INSERT INTO t2 VALUES (46);
+connection con_temp2;
BEGIN;
SELECT * FROM t2 WHERE a=40 FOR UPDATE;
a
40
+connection server_2;
include/start_slave.inc
SET debug_sync= 'now WAIT_FOR scheduled_gtid_0_x_100';
STOP SLAVE;
+connection con_temp2;
SET debug_sync= 'now WAIT_FOR wait_for_done_waiting';
ROLLBACK;
+connection server_2;
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t2 WHERE a >= 40 ORDER BY a;
a
@@ -1041,27 +1233,35 @@ SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
*** MDEV-7326 Server deadlock in connection with parallel replication ***
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=3;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
include/start_slave.inc
+connection server_1;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format= STATEMENT;
INSERT INTO t1 VALUES (foo(50,
"rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
"rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+connection server_2;
SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+connection server_1;
INSERT INTO t2 VALUES (foo(50,
"rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
"rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+connection server_2;
SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+connection server_1;
INSERT INTO t1 VALUES (foo(51,
"rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
"rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+connection server_2;
SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
SET DEBUG_SYNC= "now SIGNAL t1_cont1";
SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+connection server_1;
INSERT INTO t1 VALUES (52);
SET BINLOG_FORMAT= @old_format;
SELECT * FROM t2 WHERE a>=50 ORDER BY a;
@@ -1072,11 +1272,14 @@ a
50
51
52
+connection server_2;
SET DEBUG_SYNC= "now SIGNAL prep_cont";
SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
SET DEBUG_SYNC= "now SIGNAL t2_cont1";
SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+connection server_1;
+connection server_2;
SELECT * FROM t2 WHERE a>=50 ORDER BY a;
a
50
@@ -1092,31 +1295,43 @@ SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** MDEV-7326 Server deadlock in connection with parallel replication ***
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=3;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
include/start_slave.inc
+connection server_1;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format= STATEMENT;
INSERT INTO t1 VALUES (foo(60,
"rpl_parallel_start_waiting_for_prior SIGNAL t3_ready",
"rpl_parallel_end_of_group SIGNAL prep_ready WAIT_FOR prep_cont"));
+connection server_2;
SET DEBUG_SYNC= "now WAIT_FOR prep_ready";
+connection server_1;
INSERT INTO t2 VALUES (foo(60,
"rpl_parallel_simulate_temp_err_xid SIGNAL t1_ready1 WAIT_FOR t1_cont1",
"rpl_parallel_retry_after_unmark SIGNAL t1_ready2 WAIT_FOR t1_cont2"));
+connection server_2;
SET DEBUG_SYNC= "now WAIT_FOR t1_ready1";
+connection con_temp3;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
SET binlog_format=statement;
INSERT INTO t1 VALUES (foo(61,
"rpl_parallel_before_mark_start_commit SIGNAL t2_ready1 WAIT_FOR t2_cont1",
"rpl_parallel_after_mark_start_commit SIGNAL t2_ready2"));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connection con_temp4;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
INSERT INTO t6 VALUES (62);
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
SET debug_sync='now SIGNAL master_cont1';
+connection con_temp3;
+connection con_temp4;
+connection server_1;
SET debug_sync='RESET';
SET BINLOG_FORMAT= @old_format;
SELECT * FROM t2 WHERE a>=60 ORDER BY a;
@@ -1129,14 +1344,18 @@ a
SELECT * FROM t6 WHERE a>=60 ORDER BY a;
a
62
+connection server_2;
SET DEBUG_SYNC= "now WAIT_FOR t2_ready1";
SET DEBUG_SYNC= "now SIGNAL t1_cont1";
SET DEBUG_SYNC= "now WAIT_FOR t1_ready2";
+connection server_2;
SET DEBUG_SYNC= "now SIGNAL prep_cont";
SET DEBUG_SYNC= "now WAIT_FOR t3_ready";
SET DEBUG_SYNC= "now SIGNAL t2_cont1";
SET DEBUG_SYNC= "now WAIT_FOR t2_ready2";
SET DEBUG_SYNC= "now SIGNAL t1_cont2";
+connection server_1;
+connection server_2;
SELECT * FROM t2 WHERE a>=60 ORDER BY a;
a
60
@@ -1154,10 +1373,12 @@ SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** MDEV-7335: Potential parallel slave deadlock with specific binlog corruption ***
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=1;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,slave_discard_xid_for_gtid_0_x_1000";
+connection server_1;
INSERT INTO t2 VALUES (101);
INSERT INTO t2 VALUES (102);
INSERT INTO t2 VALUES (103);
@@ -1190,6 +1411,7 @@ INSERT INTO t2 VALUES (128);
INSERT INTO t2 VALUES (129);
INSERT INTO t2 VALUES (130);
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t2 WHERE a >= 100 ORDER BY a;
@@ -1228,6 +1450,7 @@ SET GLOBAL debug_dbug=@old_dbug;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** MDEV-6676 - test syntax of @@slave_parallel_mode ***
+connection server_2;
Parallel_Mode = 'conservative'
include/stop_slave.inc
SET GLOBAL slave_parallel_mode='aggressive';
@@ -1235,8 +1458,10 @@ Parallel_Mode = 'aggressive'
SET GLOBAL slave_parallel_mode='conservative';
Parallel_Mode = 'conservative'
*** MDEV-6676 - test that empty parallel_mode does not replicate in parallel ***
+connection server_1;
INSERT INTO t2 VALUES (1040);
include/save_master_gtid.inc
+connection server_2;
SET GLOBAL slave_parallel_mode='none';
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,slave_crash_if_parallel_apply";
@@ -1248,6 +1473,7 @@ a
include/stop_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
*** MDEV-6676 - test disabling domain-based parallel replication ***
+connection server_1;
SET gtid_domain_id = 1;
INSERT INTO t2 VALUES (1041);
INSERT INTO t2 VALUES (1042);
@@ -1265,6 +1491,7 @@ INSERT INTO t2 VALUES (1045);
INSERT INTO t2 VALUES (1046);
SET gtid_domain_id = 0;
include/save_master_gtid.inc
+connection server_2;
SET GLOBAL slave_parallel_mode=minimal;
include/start_slave.inc
include/sync_with_master_gtid.inc
@@ -1282,14 +1509,17 @@ SET GLOBAL slave_parallel_mode='conservative';
include/start_slave.inc
*** MDEV-7847: "Slave worker thread retried transaction 10 time(s) in vain, giving up", followed by replication hanging ***
*** MDEV-7882: Excessive transaction retry in parallel replication ***
+connection server_1;
CREATE TABLE t7 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t8 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=40;
SELECT @old_retries:=@@GLOBAL.slave_transaction_retries;
@old_retries:=@@GLOBAL.slave_transaction_retries
10
SET GLOBAL slave_transaction_retries= 5;
+connection server_1;
INSERT INTO t7 VALUES (1,1), (2,2), (3,3), (4,4), (5,5);
SET @old_dbug= @@SESSION.debug_dbug;
SET @commit_id= 42;
@@ -1481,6 +1711,7 @@ a b
98 98
99 99
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t7 ORDER BY a;
@@ -1568,9 +1799,11 @@ SET GLOBAL slave_transaction_retries= @old_retries;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+connection server_2;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+connection server_1;
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10000;
@@ -1586,6 +1819,7 @@ a b
120 0
121 0
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t3 WHERE a >= 120 ORDER BY a;
@@ -1596,9 +1830,11 @@ include/stop_slave.inc
SET GLOBAL debug_dbug= @old_dbug;
include/start_slave.inc
*** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+connection server_2;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+connection server_1;
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @old_server_id= @@SESSION.server_id;
@@ -1615,6 +1851,7 @@ a b
130 0
131 0
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t3 WHERE a >= 130 ORDER BY a;
@@ -1625,12 +1862,15 @@ include/stop_slave.inc
SET GLOBAL debug_dbug= @old_dbug;
include/start_slave.inc
*** MDEV-8031: Parallel replication stops on "connection killed" error (probably incorrectly handled deadlock kill) ***
+connection server_1;
INSERT INTO t3 VALUES (201,0), (202,0);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_mdev8031';
+connection server_1;
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10200;
@@ -1661,6 +1901,7 @@ a b
204 4
205 3
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
@@ -1674,11 +1915,13 @@ include/stop_slave.inc
SET GLOBAL debug_dbug= @old_dbug;
include/start_slave.inc
*** Check getting deadlock killed inside open_binlog() during retry. ***
+connection server_2;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_retry_event_group_open_binlog_kill';
SET @old_max= @@GLOBAL.max_relay_log_size;
SET GLOBAL max_relay_log_size= 4096;
+connection server_1;
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
SET @commit_id= 10210;
@@ -1692,6 +1935,7 @@ a b
204 7
205 5
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t3 WHERE a>=200 ORDER BY a;
@@ -1706,10 +1950,12 @@ SET GLOBAL debug_dbug= @old_debg;
SET GLOBAL max_relay_log_size= @old_max;
include/start_slave.inc
*** MDEV-8302: Duplicate key with parallel replication ***
+connection server_2;
include/stop_slave.inc
/* Inject a small sleep which makes the race easier to hit. */
SET @old_dbug=@@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,inject_mdev8302";
+connection server_1;
INSERT INTO t7 VALUES (100,1), (101,2), (102,3), (103,4), (104,5);
SET @old_dbug= @@SESSION.debug_dbug;
SET @commit_id= 20000;
@@ -1728,6 +1974,7 @@ a b
103 3
104 4
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t7 ORDER BY a;
@@ -1746,6 +1993,7 @@ include/stop_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
include/start_slave.inc
*** MDEV-8725: Assertion on ROLLBACK statement in the binary log ***
+connection server_1;
BEGIN;
INSERT INTO t2 VALUES (2000);
INSERT INTO t1 VALUES (2000);
@@ -1757,16 +2005,19 @@ a
SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
a
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
a
2000
SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
a
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
SET DEBUG_SYNC= 'RESET';
+connection server_1;
DROP function foo;
DROP TABLE t1,t2,t3,t4,t5,t6,t7,t8;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/rpl/r/rpl_parallel2.result b/mysql-test/suite/rpl/r/rpl_parallel2.result
index f79661ee6fb..7f9a5654c64 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel2.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel2.result
@@ -1,18 +1,24 @@
include/rpl_init.inc [topology=1->2]
*** MDEV-5509: Incorrect value for Seconds_Behind_Master if parallel replication ***
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=5;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave");
+connection server_2;
+connection server_1;
INSERT INTO t1 VALUES (1,sleep(2));
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+connection server_2;
include/wait_for_slave_param.inc [Seconds_Behind_Master]
Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
Seconds_Behind_Master = '0'
*** MDEV-8294: Inconsistent behavior of slave parallel threads at runtime ***
+connection server_1;
INSERT INTO t1 VALUES (10,0);
SET sql_log_bin= 0;
DELETE FROM t1 WHERE a=10;
@@ -21,6 +27,7 @@ INSERT INTO t1 VALUES (10,0);
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a b
10 0
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1062]
SET GLOBAL slave_parallel_threads=8;
STOP SLAVE;
@@ -30,9 +37,12 @@ SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a b
10 0
*** MDEV-7818: Deadlock occurring with parallel replication and FTWRL ***
+connection server_1;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,0), (2,0), (3,0);
+connection server_2;
include/stop_slave.inc
+connection server_1;
SET @old_dbug= @@SESSION.debug_dbug;
SET @commit_id= 4242;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
@@ -58,14 +68,22 @@ INSERT INTO t2 VALUES (16,0);
INSERT INTO t2 VALUES (17,0);
INSERT INTO t2 VALUES (18,0);
INSERT INTO t2 VALUES (19,0);
+connection server_2;
+connect s1, 127.0.0.1, root,, test, $SLAVE_MYPORT,;
BEGIN;
SELECT * FROM t2 WHERE a=2 FOR UPDATE;
a b
2 0
+connection server_2;
include/start_slave.inc
+connect s2, 127.0.0.1, root,, test, $SLAVE_MYPORT,;
FLUSH TABLES WITH READ LOCK;
+connection s1;
COMMIT;
+connection s1;
STOP SLAVE;
+connection s2;
+connection server_1;
SELECT * FROM t2 ORDER BY a;
a b
1 0
@@ -87,13 +105,16 @@ a b
17 0
18 0
19 0
+connection s2;
UNLOCK TABLES;
SELECT "after UNLOCK TABLES" as state;
state
after UNLOCK TABLES
+connection s1;
SELECT "after reap of STOP SLAVE" as state;
state
after reap of STOP SLAVE
+connection server_2;
include/wait_for_slave_to_stop.inc
include/start_slave.inc
SELECT * FROM t2 ORDER BY a;
@@ -118,15 +139,25 @@ a b
18 0
19 0
*** MDEV-8318: Assertion `!pool->busy' failed in pool_mark_busy(rpl_parallel_thread_pool*) on concurrent FTWRL ***
+connection server_1;
LOCK TABLE t2 WRITE;
+connect m1,localhost,root,,test;
+connection m1;
FLUSH TABLES WITH READ LOCK;
+connect m2,localhost,root,,test;
FLUSH TABLES WITH READ LOCK;
+connection server_1;
KILL QUERY CID;
+connection m1;
ERROR 70100: Query execution was interrupted
+connection server_1;
UNLOCK TABLES;
+connection m2;
UNLOCK TABLES;
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_charset.result b/mysql-test/suite/rpl/r/rpl_parallel_charset.result
index 8929c209934..d4c4738704f 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_charset.result
@@ -1,9 +1,11 @@
include/rpl_init.inc [topology=1->2]
*** MDEV-6156: Parallel replication incorrectly caches charset between worker threads ***
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=5;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(100) CHARACTER SET utf8);
SHOW CREATE TABLE t1;
Table Create Table
@@ -57,6 +59,7 @@ a b
18 Rødgrød med fløde 8
19 Rødgrød med fløde 9
20 Rødgrød med fløde 10
+connection server_2;
SET character_set_results=utf8;
SELECT * FROM t1 ORDER BY a;
a b
@@ -80,8 +83,10 @@ a b
18 Rødgrød med fløde 8
19 Rødgrød med fløde 9
20 Rødgrød med fløde 10
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result b/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result
index d681fd7546d..e05e824eed3 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_mdev6589.result
@@ -1,25 +1,30 @@
include/master-slave.inc
[connection master]
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=current_pos;
include/start_slave.inc
*** MDEV-6589: Incorrect relay log start position when restarting SQL thread after error in parallel replication ***
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY) ENGINE=MyISAM;
CREATE TABLE t2 (a int PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
+connection server_2;
SELECT * FROM t1;
a
1
SELECT * FROM t2;
a
1
+connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
SET sql_log_bin=0;
BEGIN;
INSERT INTO t2 VALUES (5);
+connection server_1;
SET gtid_domain_id=0;
INSERT INTO t1 VALUES (2);
INSERT INTO t2 VALUES (3);
@@ -81,11 +86,14 @@ a
15
16
include/save_master_gtid.inc
+connection server_2;
SELECT MASTER_GTID_WAIT('WAIT_POS');
MASTER_GTID_WAIT('WAIT_POS')
0
+connection con_temp1;
COMMIT;
SET sql_log_bin=1;
+connection server_2;
include/wait_for_slave_sql_error.inc [errno=1062]
SELECT * FROM t1 ORDER BY a;
a
@@ -138,10 +146,12 @@ a
14
15
16
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
SET DEBUG_SYNC= 'RESET';
+connection server_1;
DROP TABLE t1,t2;
SET DEBUG_SYNC= 'RESET';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result b/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
index ae9389c6266..2d7d3087faf 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multilevel.result
@@ -1,18 +1,22 @@
include/rpl_init.inc [topology=1->2->3->4]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=slave_pos;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='optimistic';
+connection server_3;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=slave_pos;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='optimistic';
+connection server_4;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
@@ -20,6 +24,7 @@ CHANGE MASTER TO master_use_gtid=slave_pos;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='optimistic';
*** MDEV-6676: Test that @@skip_parallel_replication is preserved in slave binlog ***
+connection server_1;
INSERT INTO t1 VALUES(1,1);
BEGIN;
INSERT INTO t1 VALUES(2,1);
@@ -43,6 +48,7 @@ a b
2 11
3 1
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -52,6 +58,7 @@ a b
3 1
status
Ok, no retry
+connection server_3;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -61,6 +68,7 @@ a b
3 1
status
Ok, no retry
+connection server_4;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -71,56 +79,86 @@ a b
status
Ok, no retry
*** MDEV-6676: Test that the FL_WAITED flag in GTID is preserved in slave binlog ***
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
SET GLOBAL slave_parallel_mode='optimistic';
+connection server_3;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
SET GLOBAL slave_parallel_mode='optimistic';
+connection server_4;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=slave_pos;
SET GLOBAL slave_parallel_mode='optimistic';
+connection server_1;
BEGIN;
UPDATE t1 SET b=b+1 WHERE a=2;
+connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting1";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting1";
+connect con_temp2,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting2";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting2";
+connect con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting3";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting3";
+connect con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting4";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting4";
+connect con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting5";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting5";
+connect con_temp6,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting6";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting6";
+connect con_temp7,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting7";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting7";
+connect con_temp8,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync="thd_report_wait_for SIGNAL waiting8";
UPDATE t1 SET b=b+1 WHERE a=2;
+connection server_1;
SET debug_sync="now WAIT_FOR waiting8";
COMMIT;
SET debug_sync="RESET";
+connection con_temp1;
COMMIT;
+connection con_temp2;
COMMIT;
+connection con_temp3;
COMMIT;
+connection con_temp4;
COMMIT;
+connection con_temp5;
COMMIT;
+connection con_temp6;
COMMIT;
+connection con_temp7;
COMMIT;
+connection con_temp8;
+connection server_1;
SELECT * FROM t1 ORDER BY a;
a b
1 1
2 20
3 1
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -130,6 +168,7 @@ a b
3 1
status
Ok, no retry
+connection server_3;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -139,6 +178,7 @@ a b
3 1
status
Ok, no retry
+connection server_4;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -148,17 +188,21 @@ a b
3 1
status
Ok, no retry
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_3;
include/stop_slave.inc
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_4;
include/stop_slave.inc
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result b/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result
index 47bf2ff887f..674cd7a32b4 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_multilevel2.result
@@ -1,10 +1,12 @@
include/rpl_init.inc [topology=1->2->3]
*** MDEV-7668: Intermediate master groups CREATE with INSERT, causing parallel replication failure ***
+connection server_1;
SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
SET GLOBAL binlog_direct_non_transactional_updates=OFF;
SET SESSION binlog_direct_non_transactional_updates=OFF;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+connection server_2;
include/stop_slave.inc
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
SET GLOBAL slave_parallel_threads=10;
@@ -16,10 +18,12 @@ SET @old_updates= @@GLOBAL.binlog_direct_non_transactional_updates;
SET GLOBAL binlog_direct_non_transactional_updates=OFF;
SET SESSION binlog_direct_non_transactional_updates=OFF;
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_3;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=current_pos;
+connection server_1;
BEGIN;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY) ENGINE=MEMORY;
COMMIT;
@@ -27,25 +31,30 @@ INSERT INTO t2 VALUES (1);
INSERT INTO t1 SELECT a, a*10 FROM t2;
DROP TABLE t2;
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a b
1 10
+connection server_3;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
a b
1 10
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
SET GLOBAL binlog_commit_wait_count=@old_commit_count;
SET GLOBAL binlog_commit_wait_usec=@old_commit_usec;
SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
include/start_slave.inc
+connection server_3;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
SET GLOBAL binlog_direct_non_transactional_updates= @old_updates;
CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table");
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_no_log_slave_updates.result b/mysql-test/suite/rpl/r/rpl_parallel_no_log_slave_updates.result
index 0f0b6c9f02a..e966023c30f 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_no_log_slave_updates.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_no_log_slave_updates.result
@@ -1,10 +1,12 @@
include/rpl_init.inc [topology=1->2]
*** Test killing transaction waiting in commit for previous transaction to commit, when not using 2-phase commit ***
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=slave_pos;
include/start_slave.inc
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
SET sql_log_bin=0;
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
@@ -15,6 +17,7 @@ END
||
SET sql_log_bin=1;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
+connection server_2;
SET sql_log_bin=0;
CREATE FUNCTION foo(x INT, d1 VARCHAR(500), d2 VARCHAR(500))
RETURNS INT DETERMINISTIC
@@ -29,12 +32,15 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connect con_temp3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
SET binlog_format=statement;
INSERT INTO t3 VALUES (31, foo(31,
'ha_commit_one_phase WAIT_FOR t2_waiting',
'commit_one_phase_2 SIGNAL t1_ready WAIT_FOR t1_cont'));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connect con_temp4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
SET binlog_format=statement;
BEGIN;
@@ -45,20 +51,28 @@ INSERT INTO t3 VALUES (33, foo(33,
'wait_for_prior_commit_waiting SIGNAL t2_waiting',
'wait_for_prior_commit_killed SIGNAL t2_killed'));
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connect con_temp5,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
SET binlog_format=statement;
INSERT INTO t3 VALUES (34, foo(34,
'',
''));
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
SET debug_sync='now SIGNAL master_cont1';
+connection con_temp3;
+connection con_temp4;
+connection con_temp5;
+connection server_1;
SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
a b
31 31
32 32
33 33
34 34
+connection server_2;
SET sql_log_bin=0;
CALL mtr.add_suppression("Query execution was interrupted");
CALL mtr.add_suppression("Commit failed due to failure of an earlier commit on which this one depends");
@@ -86,7 +100,9 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_1;
INSERT INTO t3 VALUES (39,0);
+connection server_2;
include/start_slave.inc
SELECT * FROM t3 WHERE a >= 30 ORDER BY a;
a b
@@ -110,14 +126,17 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
include/start_slave.inc
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
SET debug_sync = 'reset';
include/start_slave.inc
+connection server_1;
DROP function foo;
DROP TABLE t3;
SET debug_sync = 'reset';
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
index fc8a5edc997..7a51ba2b3c9 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -1,12 +1,15 @@
include/rpl_init.inc [topology=1->2]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=10;
CHANGE MASTER TO master_use_gtid=slave_pos;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='optimistic';
+connection server_1;
INSERT INTO t1 VALUES(1,1);
BEGIN;
INSERT INTO t1 VALUES(2,1);
@@ -34,6 +37,7 @@ a b
1 2
2 6
3 3
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -42,7 +46,9 @@ a b
2 6
3 3
*** Test a bunch of non-transactional/DDL event groups. ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
INSERT INTO t1 VALUES (4,4);
INSERT INTO t1 VALUES (5,5);
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -95,6 +101,7 @@ c
204
205
206
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -122,7 +129,9 @@ c
205
206
*** Test @@skip_parallel_replication. ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
UPDATE t1 SET b=10 WHERE a=3;
SET SESSION skip_parallel_replication=1;
UPDATE t1 SET b=20 WHERE a=3;
@@ -143,6 +152,7 @@ a b
4 4
5 5
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -155,38 +165,75 @@ a b
status
Ok, no retry
*** Test that we do not replicate in parallel transactions that had row lock waits on the master ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
+connect m1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m2,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m4,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m5,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m6,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m7,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connect m8,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
+connection default;
BEGIN;
UPDATE t1 SET b=b+1 WHERE a=3;
+connection m1;
SET debug_sync='thd_report_wait_for SIGNAL waiting1';
UPDATE t1 SET b=1001 WHERE a=3;
+connection default;
SET debug_sync='now WAIT_FOR waiting1';
+connection m2;
BEGIN;
UPDATE t1 SET b=1002 WHERE a=5;
SET debug_sync='thd_report_wait_for SIGNAL waiting2';
UPDATE t1 SET b=102 WHERE a=3;
+connection default;
SET debug_sync='now WAIT_FOR waiting2';
UPDATE t1 SET b=1000 WHERE a=1;
+connection m3;
SET debug_sync='thd_report_wait_for SIGNAL waiting3';
UPDATE t1 SET b=1003 WHERE a=5;
+connection default;
SET debug_sync='now WAIT_FOR waiting3';
+connection m4;
SET debug_sync='thd_report_wait_for SIGNAL waiting4';
UPDATE t1 SET b=1004 WHERE a=3;
+connection default;
SET debug_sync='now WAIT_FOR waiting4';
+connection m5;
SET debug_sync='thd_report_wait_for SIGNAL waiting5';
UPDATE t1 SET b=1005 WHERE a=5;
+connection default;
SET debug_sync='now WAIT_FOR waiting5';
+connection m6;
SET debug_sync='thd_report_wait_for SIGNAL waiting6';
UPDATE t1 SET b=1006 WHERE a=1;
+connection default;
SET debug_sync='now WAIT_FOR waiting6';
+connection m7;
SET debug_sync='thd_report_wait_for SIGNAL waiting7';
UPDATE t1 SET b=1007 WHERE a=5;
+connection default;
SET debug_sync='now WAIT_FOR waiting7';
+connection m8;
SET debug_sync='thd_report_wait_for SIGNAL waiting8';
UPDATE t1 SET b=1008 WHERE a=3;
+connection default;
SET debug_sync='now WAIT_FOR waiting8';
+connection default;
COMMIT;
+connection m1;
+connection m2;
COMMIT;
+connection m3;
+connection m4;
+connection m5;
+connection m6;
+connection m7;
+connection m8;
+connection default;
SET debug_sync='RESET';
SELECT * FROM t1 ORDER BY a;
a b
@@ -196,6 +243,7 @@ a b
4 4
5 1007
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -208,6 +256,7 @@ a b
status
Ok, no retry
*** Test that we replicate correctly when using READ COMMITTED and binlog_format=MIXED on the slave ***
+connection server_2;
include/stop_slave.inc
SET @old_format= @@GLOBAL.binlog_format;
SET GLOBAL binlog_format= MIXED;
@@ -215,6 +264,7 @@ SET @old_isolation= @@GLOBAL.tx_isolation;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=10;
+connection server_1;
DROP TABLE t1, t2;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
@@ -258,6 +308,7 @@ a b
9 8
10 10
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -288,16 +339,19 @@ SET GLOBAL binlog_format= @old_format;
SET GLOBAL tx_isolation= @old_isolation;
include/start_slave.inc
*** MDEV-7888: ANALYZE TABLE does wakeup_subsequent_commits(), causing wrong binlog order and parallel replication hang ***
+connection server_1;
DROP TABLE t1, t2, t3;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=MyISAM;
INSERT INTO t2 VALUES (1,1), (2,1), (3,1), (4,1), (5,1);
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_analyze_table_sleep';
+connection server_1;
ALTER TABLE t2 COMMENT "123abc";
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
@@ -363,6 +417,7 @@ SELECT * FROM t3 ORDER BY a;
a b
1 3
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -403,9 +458,11 @@ include/stop_slave.inc
SET GLOBAL debug_dbug= @old_debug;
include/start_slave.inc
*** MDEV-7929: record_gtid() for non-transactional event group calls wakeup_subsequent_commits() too early, causing slave hang. ***
+connection server_2;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug= '+d,inject_record_gtid_serverid_100_sleep';
+connection server_1;
ALTER TABLE t3 COMMENT "DDL statement 1";
INSERT INTO t1 VALUES (30,0);
INSERT INTO t1 VALUES (31,0);
@@ -438,6 +495,7 @@ a b
38 0
39 0
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
@@ -456,7 +514,9 @@ include/stop_slave.inc
SET GLOBAL debug_dbug= @old_debug;
include/start_slave.inc
*** MDEV-8113: ALTER TABLE causes slave hang in optimistic parallel replication ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
ALTER TABLE t2 ADD c INT;
INSERT INTO t2 (a,b) VALUES (50, 0);
INSERT INTO t2 (a,b) VALUES (51, 1);
@@ -482,6 +542,7 @@ a b
58 8
59 9
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t2 WHERE a >= 50 ORDER BY a;
@@ -496,9 +557,11 @@ a b
57 7
58 8
59 9
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1, t2, t3;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
index 91970f3eeb5..a15ca4e047b 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic_nobinlog.result
@@ -1,9 +1,11 @@
include/rpl_init.inc [topology=1->2]
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t2 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,0), (2,0), (3,0);
INSERT INTO t2 VALUES (1,0), (2,0);
+connection server_2;
SET @old_isolation= @@GLOBAL.tx_isolation;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
@@ -13,6 +15,7 @@ CHANGE MASTER TO master_use_gtid=slave_pos;
SET @old_parallel_mode=@@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode='aggressive';
*** Test that we replicate correctly when using READ COMMITTED and --log-slave-updates=0 on the slave ***
+connection server_1;
INSERT INTO t1 SELECT 4, COUNT(*) FROM t2;
INSERT INTO t2 SELECT 4, COUNT(*) FROM t1;
INSERT INTO t1 SELECT 5, COUNT(*) FROM t2;
@@ -51,6 +54,7 @@ a b
9 8
10 10
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -76,10 +80,12 @@ a b
8 7
9 8
10 10
+connection server_2;
include/stop_slave.inc
SET GLOBAL tx_isolation= @old_isolation;
SET GLOBAL slave_parallel_mode=@old_parallel_mode;
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1, t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_partition.result b/mysql-test/suite/rpl/r/rpl_parallel_partition.result
index e0cfe9882d2..30d39629cf4 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_partition.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_partition.result
@@ -1,11 +1,13 @@
include/master-slave.inc
[connection master]
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,inject_wakeup_subsequent_commits_sleep";
SET GLOBAL slave_parallel_threads=8;
*** MDEV-8147: Assertion `m_lock_type == 2' failed in handler::ha_close() during parallel replication ***
+connection server_1;
CREATE TABLE E (
pk INTEGER AUTO_INCREMENT,
col_int_nokey INTEGER /*! NULL */,
@@ -27,16 +29,21 @@ KEY (col_varchar_key, col_int_key)
) ENGINE=InnoDB;
ALTER TABLE `E` PARTITION BY KEY() PARTITIONS 5;
ALTER TABLE `E` REMOVE PARTITIONING;
+connection default;
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY);
+connection server_2;
include/start_slave.inc
include/stop_slave.inc
SET GLOBAL debug_dbug=@old_dbug;
SET GLOBAL slave_parallel_threads=0;
SET GLOBAL slave_parallel_threads=8;
include/start_slave.inc
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE `E`;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_retry.result b/mysql-test/suite/rpl/r/rpl_parallel_retry.result
index 0129814e6a8..c4c56489aa4 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_retry.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_retry.result
@@ -1,5 +1,6 @@
include/rpl_init.inc [topology=1->2]
*** Test retry of transactions that fail to replicate due to deadlock or similar temporary error. ***
+connection server_1;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
CREATE TABLE t1 (a int PRIMARY KEY, b INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1);
@@ -11,6 +12,7 @@ RETURN x;
END
||
SET sql_log_bin=1;
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=5;
@@ -30,6 +32,7 @@ END
||
SET sql_log_bin=1;
include/stop_slave.inc
+connection server_1;
SET gtid_seq_no = 100;
BEGIN;
INSERT INTO t1 VALUES (2,1);
@@ -41,6 +44,7 @@ a b
1 2
2 1
3 1
+connection server_2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_gtid_0_x_100";
include/start_slave.inc
@@ -54,6 +58,7 @@ a b
3 1
*** Test that double retry works when the first retry also fails with temp error ***
include/stop_slave.inc
+connection server_1;
SET gtid_seq_no = 100;
SET @old_server_id = @@server_id;
SET server_id = 10;
@@ -72,6 +77,7 @@ a b
4 1
5 1
6 1
+connection server_2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_gtid_0_x_100,rpl_parallel_simulate_double_temp_err_gtid_0_x_100";
include/start_slave.inc
@@ -88,6 +94,7 @@ a b
6 1
*** Test too many retries, eventually causing failure. ***
include/stop_slave.inc
+connection server_1;
SET gtid_seq_no = 100;
SET @old_server_id = @@server_id;
SET server_id = 11;
@@ -109,6 +116,7 @@ a b
7 1
8 1
9 1
+connection server_2;
SET sql_log_bin=0;
CALL mtr.add_suppression("Slave worker thread retried transaction 10 time\\(s\\) in vain, giving up");
CALL mtr.add_suppression("Slave: Deadlock found when trying to get lock; try restarting transaction");
@@ -142,11 +150,14 @@ a b
8 1
9 1
*** Test retry of event group that spans multiple relay log files. ***
+connection server_1;
CREATE TABLE t2 (a int PRIMARY KEY, b BLOB) ENGINE=InnoDB;
INSERT INTO t2 VALUES (1,"Hulubullu");
+connection server_2;
include/stop_slave.inc
SET @old_max= @@GLOBAL.max_relay_log_size;
SET GLOBAL max_relay_log_size=4096;
+connection server_1;
SET gtid_seq_no = 100;
SET @old_server_id = @@server_id;
SET server_id = 12;
@@ -162,6 +173,7 @@ a LENGTH(b)
1 9
2 5006
3 5012
+connection server_2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_gtid_0_x_100";
include/start_slave.inc
@@ -176,7 +188,9 @@ a LENGTH(b)
1 9
2 5006
3 5012
+connection server_1;
INSERT INTO t1 VALUES (11,11);
+connection server_2;
SELECT * FROM t1 WHERE a >= 10 ORDER BY a;
a b
10 4
@@ -189,7 +203,9 @@ a LENGTH(b)
4 5000
SET GLOBAL max_relay_log_size=@old_max;
*** MDEV-7065: Incorrect relay log position in parallel replication after retry of transaction ***
+connection server_2;
include/stop_slave.inc
+connection server_1;
BEGIN;
INSERT INTO t1 VALUES (100, 0);
INSERT INTO t1 VALUES (101, 0);
@@ -202,6 +218,7 @@ a b
101 0
102 0
103 0
+connection server_2;
SET @old_dbug= @@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,rpl_parallel_simulate_temp_err_xid";
include/start_slave.inc
@@ -215,12 +232,14 @@ a b
102 0
103 0
include/stop_slave_sql.inc
+connection server_1;
INSERT INTO t1 VALUES (104, 1);
INSERT INTO t1 VALUES (105, 1);
INSERT INTO t1 VALUES (106, 1);
INSERT INTO t1 VALUES (107, 1);
INSERT INTO t1 VALUES (108, 1);
INSERT INTO t1 VALUES (109, 1);
+connection server_2;
include/start_slave.inc
SELECT * FROM t1 WHERE a >= 100 ORDER BY a;
a b
@@ -235,13 +254,17 @@ a b
108 1
109 1
*** MDEV-6917: Parallel replication: "Commit failed due to failure of an earlier commit on which this one depends", but no prior failure seen **
+connection server_1;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT, KEY b_idx(b)) ENGINE=InnoDB;
INSERT INTO t3 VALUES (1,NULL), (2,2), (3,NULL), (4,4), (5, NULL), (6, 6);
CREATE TABLE t4 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format='statement';
+connection server_2;
include/stop_slave.inc
CHANGE MASTER TO master_use_gtid=no;
+connection server_1;
+connect con1,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format='statement';
BEGIN;
@@ -249,7 +272,9 @@ INSERT INTO t4 VALUES (10, foo(1, 'before_execute_sql_command WAIT_FOR t1_start'
UPDATE t3 SET b=NULL WHERE a=6;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued1 WAIT_FOR master_cont1';
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued1';
+connect con2,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format='statement';
BEGIN;
@@ -257,7 +282,9 @@ INSERT INTO t4 VALUES (20, foo(2, 'group_commit_waiting_for_prior SIGNAL t2_wait
DELETE FROM t3 WHERE b <= 3;
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued2';
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued2';
+connect con3,127.0.0.1,root,,test,$SERVER_MYPORT_1,;
SET @old_format= @@SESSION.binlog_format;
SET binlog_format='statement';
BEGIN;
@@ -265,12 +292,17 @@ INSERT INTO t4 VALUES (30, foo(3, 'before_execute_sql_command WAIT_FOR t3_start'
INSERT INTO t3 VALUES (7,7);
SET debug_sync='commit_after_release_LOCK_prepare_ordered SIGNAL master_queued3';
COMMIT;
+connection server_1;
SET debug_sync='now WAIT_FOR master_queued3';
SET debug_sync='now SIGNAL master_cont1';
+connection con1;
SET binlog_format=@old_format;
+connection con2;
SET binlog_format=@old_format;
+connection con3;
SET debug_sync='RESET';
SET binlog_format=@old_format;
+connection server_1;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
@@ -279,6 +311,7 @@ a b
5 NULL
6 NULL
7 7
+connection server_2;
SET @old_dbug=@@GLOBAL.debug_dbug;
SET GLOBAL debug_dbug="+d,thd_need_ordering_with_force";
include/start_slave.inc
@@ -298,10 +331,13 @@ a b
5 NULL
6 NULL
7 7
+connection server_1;
SET binlog_format=@old_format;
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1, t2, t3, t4;
DROP function foo;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result b/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result
index d454fa41111..204db2bae9f 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_show_binlog_events_purge_logs.result
@@ -1,12 +1,13 @@
include/master-slave.inc
[connection master]
-[connection slave]
+connection slave;
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
SHOW BINLOG EVENTS;
-[connection slave1]
+connection slave1;
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL end';
-[connection slave]
+connection slave;
SET DEBUG_SYNC= 'RESET';
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
index 1ccc87ada60..52efed22541 100644
--- a/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
+++ b/mysql-test/suite/rpl/r/rpl_parallel_temptable.result
@@ -1,54 +1,76 @@
include/rpl_init.inc [topology=1->2]
*** MDEV-6321: close_temporary_tables() in format description event not serialised correctly ***
+connection server_2;
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=5;
CHANGE MASTER TO master_use_gtid= current_pos;
include/start_slave.inc
+connection server_1;
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(100) CHARACTER SET utf8);
+connection server_2;
include/stop_slave.inc
+connection server_1;
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (1, 0);
CREATE TEMPORARY TABLE t2 (a int);
+connection default;
SET gtid_domain_id= 2;
CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY);
CREATE TEMPORARY TABLE t4 (a int);
INSERT INTO t3 VALUES (100);
INSERT INTO t4 SELECT a+1 FROM t3;
+connection server_1;
INSERT INTO t2 VALUES (2), (4), (6), (8), (10), (12), (14), (16), (18), (20);
INSERT INTO t2 VALUES (3), (6), (9), (12), (15), (18);
INSERT INTO t2 VALUES (4), (8), (12), (16), (20);
+connection default;
INSERT INTO t3 SELECT a+2 FROM t4;
INSERT INTO t4 SELECT a+4 FROM t3;
+connection server_1;
INSERT INTO t2 VALUES (5), (10), (15), (20);
INSERT INTO t2 VALUES (6), (12), (18);
INSERT INTO t2 VALUES (7), (14);
INSERT INTO t2 VALUES (8), (16);
INSERT INTO t2 VALUES (9), (18);
INSERT INTO t2 VALUES (10), (20);
+connection default;
INSERT INTO t3 SELECT a+8 FROM t4;
INSERT INTO t4 SELECT a+16 FROM t3;
+connection server_1;
INSERT INTO t2 VALUES (11);
INSERT INTO t2 VALUES (12);
INSERT INTO t2 VALUES (13);
+connection default;
INSERT INTO t3 SELECT a+32 FROM t4;
+connection server_1;
INSERT INTO t2 VALUES (14);
INSERT INTO t2 VALUES (15);
INSERT INTO t2 VALUES (16);
+connection default;
INSERT INTO t4 SELECT a+64 FROM t3;
+connection server_1;
INSERT INTO t2 VALUES (17);
INSERT INTO t2 VALUES (18);
INSERT INTO t2 VALUES (19);
+connection default;
INSERT INTO t3 SELECT a+128 FROM t4;
+connection server_1;
INSERT INTO t2 VALUES (20);
+connection default;
INSERT INTO t1 SELECT a, a MOD 7 FROM t3;
INSERT INTO t1 SELECT a, a MOD 7 FROM t4;
+connection server_1;
INSERT INTO t1 SELECT a, COUNT(*) FROM t2 GROUP BY a;
FLUSH TABLES;
SET SESSION debug_dbug="+d,crash_dispatch_command_before";
SELECT 1;
Got one of the listed errors
+connection default;
+connection default;
+connection server_1;
INSERT INTO t1 VALUES (0, 1);
+connection server_2;
include/start_slave.inc
SELECT * FROM t1 WHERE a <= 20 ORDER BY a;
a b
@@ -81,6 +103,7 @@ Variable_name Value
Slave_open_temp_tables 0
*** Test that if master logged partial event group before crash, we finish that group correctly before executing format description event ***
include/stop_slave.inc
+connection server_1;
CALL mtr.add_suppression("Statement accesses nontransactional table as well as transactional or temporary table, and writes to any of them");
SET gtid_domain_id= 1;
DELETE FROM t1;
@@ -88,19 +111,27 @@ ALTER TABLE t1 ENGINE=InnoDB;
CREATE TEMPORARY TABLE t2 (a INT PRIMARY KEY);
INSERT INTO t2 VALUES (1);
INSERT INTO t2 VALUES (2);
+connection default;
SET gtid_domain_id= 2;
CREATE TEMPORARY TABLE t3 (a INT PRIMARY KEY);
INSERT INTO t3 VALUES (10);
INSERT INTO t3 VALUES (20);
+connection server_1;
INSERT INTO t1 SELECT a, 'server_1' FROM t2;
+connection default;
INSERT INTO t1 SELECT a, 'default' FROM t3;
+connection server_1;
INSERT INTO t1 SELECT a+2, '+server_1' FROM t2;
FLUSH TABLES;
SET SESSION debug_dbug="+d,crash_before_writing_xid";
INSERT INTO t1 SELECT a+4, '++server_1' FROM t2;
Got one of the listed errors
+connection default;
+connection default;
+connection server_1;
INSERT INTO t1 VALUES (0, 1);
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 ORDER BY a;
@@ -115,8 +146,10 @@ a b
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connection server_1;
FLUSH LOGS;
*** MDEV-7936: Assertion `!table || table->in_use == _current_thd()' failed on parallel replication in optimistic mode ***
+connection server_1;
CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
SET @old_dbug= @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,binlog_force_commit_id";
@@ -131,6 +164,7 @@ a b
30 conservative
31 conservative
include/save_master_gtid.inc
+connection server_2;
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
a b
@@ -139,6 +173,7 @@ a b
include/stop_slave.inc
SET @old_mode= @@GLOBAL.slave_parallel_mode;
SET GLOBAL slave_parallel_mode=optimistic;
+connection server_1;
CREATE TEMPORARY TABLE t4 (a INT PRIMARY KEY) ENGINE=InnoDB;
INSERT INTO t4 VALUES (32);
INSERT INTO t4 VALUES (33);
@@ -151,6 +186,7 @@ a b
32 optimistic
33 optimistic
include/save_master_gtid.inc
+connection server_2;
include/start_slave.inc
include/sync_with_master_gtid.inc
SELECT * FROM t1 WHERE a >= 30 ORDER BY a;
@@ -162,8 +198,10 @@ a b
include/stop_slave.inc
SET GLOBAL slave_parallel_mode=@old_mode;
include/start_slave.inc
+connection server_2;
include/stop_slave.inc
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
include/start_slave.inc
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_partition_innodb.result b/mysql-test/suite/rpl/r/rpl_partition_innodb.result
index 558d4d37831..382e09ac888 100644
--- a/mysql-test/suite/rpl/r/rpl_partition_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_partition_innodb.result
@@ -93,6 +93,8 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection slave;
+connection slave;
show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
@@ -140,6 +142,7 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_partition_memory.result b/mysql-test/suite/rpl/r/rpl_partition_memory.result
index 4b67eea5f6c..999f36fb47f 100644
--- a/mysql-test/suite/rpl/r/rpl_partition_memory.result
+++ b/mysql-test/suite/rpl/r/rpl_partition_memory.result
@@ -93,6 +93,8 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection slave;
+connection slave;
show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
@@ -140,6 +142,7 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_partition_myisam.result b/mysql-test/suite/rpl/r/rpl_partition_myisam.result
index 7e39421c327..c760befed89 100644
--- a/mysql-test/suite/rpl/r/rpl_partition_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_partition_myisam.result
@@ -93,6 +93,8 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection slave;
+connection slave;
show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
@@ -140,6 +142,7 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
diff --git a/mysql-test/suite/rpl/r/rpl_password_boundaries.result b/mysql-test/suite/rpl/r/rpl_password_boundaries.result
index 462ab154a55..eeee4c9ad58 100644
--- a/mysql-test/suite/rpl/r/rpl_password_boundaries.result
+++ b/mysql-test/suite/rpl/r/rpl_password_boundaries.result
@@ -1,26 +1,27 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
-[ on master ]
+connection master;
set sql_log_bin=0;
grant replication slave on *.* to rpl32@127.0.0.1 identified by '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
set sql_log_bin=1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
change master to master_user='rpl32',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
include/start_slave.inc
-[ on master ]
+connection master;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
create table t1 (i int);
insert into t1 values (1);
-[ on slave: synchronized ]
-[ on master ]
+connection slave;
+[ synchronized ]
+connection master;
set sql_log_bin=0;
grant replication slave on *.* to rpl33@127.0.0.1 identified by '0123456789abcdef0123456789abcdef!';
set sql_log_bin=1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
ERROR HY000: String '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345' is too long for MASTER_PASSWORD (should be no longer than 96)
@@ -28,32 +29,37 @@ change master to master_user='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too long for MASTER_USER (should be no longer than 128)
change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbcccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc';
ERROR HY000: String 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbb' is too long for MASTER_HOST (should be no longer than 60)
-[ on master ]
+connection master;
set sql_log_bin=0;
grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
set sql_log_bin=1;
-[ on slave ]
+connection slave;
SET NAMES utf8;
change master to master_user='rpl16cyr',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль';
include/start_slave.inc
-[ on master ]
+connection master;
drop table if exists t1;
create table t1 (i int);
insert into t1 values (1);
-[ on slave: synchronized ]
-[ on master ]
+connection slave;
+[ synchronized ]
+connection master;
set sql_log_bin=0;
grant replication slave on *.* to rpl17mix@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль!';
set sql_log_bin=1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
change master to master_user='rpl17mix',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль!';
ERROR HY000: String 'воттакойужпарольвоттакойужпарольвот' is too long for MASTER_PASSWORD (should be no longer than 96)
-[ on master ]
+connection master;
set sql_log_bin=0;
drop user rpl32@127.0.0.1, rpl33@127.0.0.1, rpl16cyr@127.0.0.1, rpl17mix@127.0.0.1;
set sql_log_bin=1;
+connection slave;
change master to master_user='root',master_password='';
include/start_slave.inc
+connection master;
drop table if exists t1;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_performance_schema.result b/mysql-test/suite/rpl/r/rpl_performance_schema.result
index ffda66c5bb9..eb9db0755a9 100644
--- a/mysql-test/suite/rpl/r/rpl_performance_schema.result
+++ b/mysql-test/suite/rpl/r/rpl_performance_schema.result
@@ -1,4 +1,5 @@
include/master-slave.inc
[connection master]
UPDATE performance_schema.setup_instruments SET ENABLED="NO";
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_plugin_load.result b/mysql-test/suite/rpl/r/rpl_plugin_load.result
index b33e29ef668..390e79de89a 100644
--- a/mysql-test/suite/rpl/r/rpl_plugin_load.result
+++ b/mysql-test/suite/rpl/r/rpl_plugin_load.result
@@ -15,10 +15,13 @@ Verify that example engine is installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
EXAMPLE YES Example storage engine NO NO NO
-connection slave: Verify that example engine is not installed.
+connection slave;
+Verify that example engine is not installed.
+connection slave;
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
-connection master: Uninstall example engine.
+Uninstall example engine.
+connection master;
Get binlog position before uninstall plugin.
UNINSTALL PLUGIN example;
Get binlog position after uninstall plugin.
@@ -29,5 +32,6 @@ Delta
Verify that example engine is not installed.
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS
+connection slave;
include/rpl_end.inc
End of test
diff --git a/mysql-test/suite/rpl/r/rpl_ps.result b/mysql-test/suite/rpl/r/rpl_ps.result
index ca46f373610..57c2db05811 100644
--- a/mysql-test/suite/rpl/r/rpl_ps.result
+++ b/mysql-test/suite/rpl/r/rpl_ps.result
@@ -15,12 +15,15 @@ set @var2= 'insert into t1 values (concat("from-var-", ?))';
prepare stmt2 from @var2;
set @var1='from-master-3';
execute stmt2 using @var1;
+connection slave;
SELECT * FROM t1 ORDER BY n;
n
from-master-1
from-master-2-'',
from-var-from-master-3
+connection master;
drop table t1;
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
@@ -30,21 +33,21 @@ include/wait_for_slave_to_stop.inc
# statement breaks binlog.
#
########################################################################
-# Connection: slave
+connection slave;
START SLAVE;
-# Connection: master
+connection master;
CREATE DATABASE mysqltest1;
CREATE TABLE t1(db_name CHAR(32), db_col_name CHAR(32));
PREPARE stmt_d_1 FROM 'INSERT INTO t1 VALUES(DATABASE(), @@collation_database)';
EXECUTE stmt_d_1;
use mysqltest1;
EXECUTE stmt_d_1;
-# Connection: slave
+connection slave;
SELECT * FROM t1;
db_name db_col_name
test latin1_swedish_ci
test latin1_swedish_ci
-# Connection: master
+connection master;
DROP DATABASE mysqltest1;
use test;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
index e662dcc4feb..effebdddaba 100644
--- a/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
+++ b/mysql-test/suite/rpl/r/rpl_rbr_to_sbr.result
@@ -1,6 +1,5 @@
include/master-slave.inc
[connection master]
-**** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
@@ -15,7 +14,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-**** On Slave ****
+connection slave;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
@@ -27,5 +26,6 @@ slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
+connection master;
DROP TABLE IF EXISTS t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result b/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result
index e659c3ee283..5c0002a911a 100644
--- a/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result
+++ b/mysql-test/suite/rpl/r/rpl_read_new_relay_log_info.result
@@ -3,6 +3,7 @@ include/master-slave.inc
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
+connection slave;
==== Check that we can understand the new format of relay-log.info ====
include/stop_slave.inc
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result b/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result
index 7a9d3b795d8..217bc726e0e 100644
--- a/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result
+++ b/mysql-test/suite/rpl/r/rpl_read_old_relay_log_info.result
@@ -3,6 +3,7 @@ include/master-slave.inc
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
+connection slave;
==== Check that we still understand the old format of relay-log.info ====
include/stop_slave.inc
RESET SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_read_only.result b/mysql-test/suite/rpl/r/rpl_read_only.result
index 63e84e3258a..645411d4cf1 100644
--- a/mysql-test/suite/rpl/r/rpl_read_only.result
+++ b/mysql-test/suite/rpl/r/rpl_read_only.result
@@ -1,12 +1,19 @@
include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection master;
create user test;
+connection slave;
+connect master2,127.0.0.1,test,,test,$MASTER_MYPORT,;
+connect slave2,127.0.0.1,test,,test,$SLAVE_MYPORT,;
+connection master1;
create table t1(a int) engine=InnoDB;
create table t2(a int) engine=MyISAM;
insert into t1 values(1001);
insert into t2 values(2001);
+connection master;
set global read_only=1;
+connection master1;
select @@read_only;
@@read_only
1
@@ -16,6 +23,7 @@ a
select * from t2;
a
2001
+connection slave;
select @@read_only;
@@read_only
0
@@ -25,29 +33,39 @@ a
select * from t2;
a
2001
+connection master;
set global read_only=0;
+connection master1;
BEGIN;
+connection master2;
BEGIN;
+connection master;
select @@read_only;
@@read_only
0
set global read_only=1;
+connection master1;
*** On SUPER USER connection ***
insert into t1 values(1002);
insert into t2 values(2002);
+connection master2;
*** On regular USER connection ***
insert into t1 values(1003);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2003);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+connection master1;
*** SUPER USER COMMIT (must succeed) ***
COMMIT;
+connection master2;
*** regular USER COMMIT (must succeed - nothing to commit) ***
COMMIT;
+connection master;
select @@read_only;
@@read_only
1
set global read_only=0;
+connection master1;
insert into t1 values(1004);
insert into t2 values(2004);
select * from t1;
@@ -60,6 +78,7 @@ a
2001
2002
2004
+connection slave;
select * from t1;
a
1001
@@ -70,7 +89,9 @@ a
2001
2002
2004
+connection slave1;
set global read_only=1;
+connection slave;
select @@read_only;
@@read_only
1
@@ -84,6 +105,7 @@ Table Create Table
t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection master;
insert into t1 values(1005);
insert into t2 values(2005);
select * from t1;
@@ -98,6 +120,8 @@ a
2002
2004
2005
+connection slave;
+connection slave;
select * from t1;
a
1001
@@ -110,12 +134,15 @@ a
2002
2004
2005
+connection slave2;
insert into t1 values(1006);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
insert into t2 values(2006);
ERROR HY000: The MariaDB server is running with the --read-only option so it cannot execute this statement
+connection master;
drop user test;
drop table t1;
drop table t2;
+connection slave;
set global read_only=0;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
index ebce070190d..e2014a974b4 100644
--- a/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_innodb.result
@@ -14,10 +14,12 @@ name age id
Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
+connection slave;
SELECT * FROM t1 ORDER BY id;
name age id
Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
index b2fc0f715ea..f3bf38f31b9 100644
--- a/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_relay_space_myisam.result
@@ -14,10 +14,12 @@ name age id
Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
+connection slave;
SELECT * FROM t1 ORDER BY id;
name age id
Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relayrotate.result b/mysql-test/suite/rpl/r/rpl_relayrotate.result
index ea00aee0085..142626e33e3 100644
--- a/mysql-test/suite/rpl/r/rpl_relayrotate.result
+++ b/mysql-test/suite/rpl/r/rpl_relayrotate.result
@@ -1,7 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
+connection slave;
stop slave;
+connection master;
create table t1 (a int) engine=innodb;
+connection slave;
reset slave;
start slave;
stop slave;
@@ -9,5 +14,7 @@ start slave;
select max(a) from t1;
max(a)
8000
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_relayspace.result b/mysql-test/suite/rpl/r/rpl_relayspace.result
index fb21540aa31..90bf18aaa88 100644
--- a/mysql-test/suite/rpl/r/rpl_relayspace.result
+++ b/mysql-test/suite/rpl/r/rpl_relayspace.result
@@ -1,10 +1,13 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
+connection master;
create table t1 (a int);
drop table t1;
create table t1 (a int);
drop table t1;
+connection slave;
reset slave;
start slave io_thread;
include/wait_for_slave_param.inc [Slave_IO_State]
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_do.result b/mysql-test/suite/rpl/r/rpl_replicate_do.result
index c1e3ee60e10..c7ac37a9654 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_do.result
@@ -1,9 +1,11 @@
include/master-slave.inc
[connection master]
drop table if exists t11;
+connection slave;
drop table if exists t11;
create table t2 (n int);
insert into t2 values(4);
+connection master;
create table t2 (s char(20));
load data infile '../../std_data/words.dat' into table t2;
insert into t2 values('five');
@@ -12,6 +14,7 @@ insert into t1 values(15),(16),(17);
update t1 set m=20 where m=16;
delete from t1 where m=17;
create table t11 select * from t1;
+connection slave;
select * from t1 ORDER BY m;
m
15
@@ -21,9 +24,11 @@ n
4
select * from t11;
ERROR 42S02: Table 'test.t11' doesn't exist
+connection master;
drop table if exists t1,t2,t11;
+connection slave;
Replicate_Do_Table = 'test.t1'
-*** master ***
+connection master;
create table t1 (a int, b int);
create trigger trg1 before insert on t1 for each row set new.b=2;
create table t2 (a int, b int);
@@ -36,25 +41,28 @@ show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
trg2 INSERT t2 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-*** slave ***
+connection slave;
+connection slave;
show tables;
Tables_in_test
t1
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
trg1 INSERT t1 set new.b=2 BEFORE NULL NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION root@localhost latin1 latin1_swedish_ci latin1_swedish_ci
-*** master ***
+connection master;
drop trigger trg1;
drop trigger trg2;
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-*** slave ***
+connection slave;
+connection slave;
show tables;
Tables_in_test
t1
show triggers;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
-*** master ***
+connection master;
drop table t1;
drop table t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
index f0c46b0b966..1192f9860f2 100644
--- a/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
+++ b/mysql-test/suite/rpl/r/rpl_replicate_ignore_db.result
@@ -7,14 +7,19 @@ create database mysqltest2;
use mysqltest1;
create table t1 (a int);
insert into t1 values(1);
+connection slave;
select * from mysqltest1.t1;
ERROR 42S02: Table 'mysqltest1.t1' doesn't exist
+connection master;
use mysqltest2;
create table t1 (a int);
insert into t1 values(1);
+connection slave;
select * from mysqltest2.t1;
a
1
+connection master;
drop database mysqltest1;
drop database mysqltest2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_report.result b/mysql-test/suite/rpl/r/rpl_report.result
index b979d1faf5d..3c1081e7ab3 100644
--- a/mysql-test/suite/rpl/r/rpl_report.result
+++ b/mysql-test/suite/rpl/r/rpl_report.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
select * from Information_schema.GLOBAL_VARIABLES where variable_name like 'report_host';
VARIABLE_NAME VARIABLE_VALUE
REPORT_HOST 127.0.0.1
diff --git a/mysql-test/suite/rpl/r/rpl_report_port.result b/mysql-test/suite/rpl/r/rpl_report_port.result
index 2f422c8b577..c923b15bc9e 100644
--- a/mysql-test/suite/rpl/r/rpl_report_port.result
+++ b/mysql-test/suite/rpl/r/rpl_report_port.result
@@ -1,13 +1,21 @@
include/master-slave.inc
[connection master]
+connection master;
include/rpl_restart_server.inc [server_number=2 parameters: --report-port=9000]
+connection slave;
include/start_slave.inc
include/wait_for_slave_param.inc [Slave_IO_State]
[Slave restarted with the report-port set to some value]
+connection master;
include/assert.inc [The value shown for the slave's port number is user specified port number which is the value set for report-port.]
+connection master;
include/rpl_restart_server.inc [server_number=2]
+connection slave;
include/start_slave.inc
include/wait_for_slave_param.inc [Slave_IO_State]
+connection master;
+connection slave;
[Slave restarted with the report-port set to the value of slave's port number]
+connection master;
include/assert.inc [The default value shown for the slave's port number is the actual port number of the slave.]
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rewrt_db.result b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
index 57754183483..4ae20824b22 100644
--- a/mysql-test/suite/rpl/r/rpl_rewrt_db.result
+++ b/mysql-test/suite/rpl/r/rpl_rewrt_db.result
@@ -8,16 +8,21 @@ insert into t1 values(9);
select * from mysqltest1.t1;
a
9
+connection slave;
show databases like 'mysqltest1';
Database (mysqltest1)
mysqltest1
select * from test.t1;
a
9
+connection master;
drop table t1;
drop database mysqltest1;
+connection slave;
+connection slave;
drop database if exists rewrite;
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 ',';
@@ -29,12 +34,15 @@ 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;
+connection slave;
+connection slave;
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
+connection master;
truncate table t1;
load data infile '../../std_data/loaddata1.dat' into table t1 fields terminated by ',' LINES STARTING BY ',' (b,c,d);
Warnings:
@@ -42,16 +50,21 @@ 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
+connection slave;
+connection slave;
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
+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 '''';
Warnings:
Warning 1261 Row 3 doesn't contain data for all columns
+connection slave;
+connection slave;
select concat('|',a,'|'), concat('|',b,'|') from rewrite.t1;
concat('|',a,'|') concat('|',b,'|')
|Field A| |Field B|
@@ -59,6 +72,7 @@ concat('|',a,'|') concat('|',b,'|')
Field 3,'Field 4|
|Field 5' ,'Field 6| NULL
|Field 6| | 'Field 7'|
+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;
@@ -70,6 +84,8 @@ Warning 1262 Row 3 was truncated; it contained more data than there were input c
Note 1265 Data truncated for column 'a' at row 4
Warning 1366 Incorrect integer value: 'wrong end ' for column 'a' at row 5
Warning 1262 Row 5 was truncated; it contained more data than there were input columns
+connection slave;
+connection slave;
select * from rewrite.t1;
a b
1 row 1
@@ -77,6 +93,7 @@ a b
0 1234567890
3 row 3
0 1234567890
+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;
Warnings:
@@ -86,6 +103,8 @@ Note 1265 Data truncated for column 'a' at row 3
Warning 1366 Incorrect integer value: '
' for column 'a' at row 4
Warning 1261 Row 4 doesn't contain data for all columns
+connection slave;
+connection slave;
select * from rewrite.t1;
a b
1 row 1
@@ -95,6 +114,7 @@ a b
set sql_log_bin= 0;
drop database rewrite;
set sql_log_bin= 1;
+connection master;
set sql_log_bin= 0;
drop table t1;
set sql_log_bin= 1;
@@ -106,11 +126,17 @@ set sql_log_bin= 1;
****
**** Preparing the environment
****
+connection master;
+connect con_temp_03,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect con_temp_02,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect con_temp_01,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection master;
SET sql_log_bin= 0;
CREATE DATABASE database_master_temp_01;
CREATE DATABASE database_master_temp_02;
CREATE DATABASE database_master_temp_03;
SET sql_log_bin= 1;
+connection slave;
SET sql_log_bin= 0;
CREATE DATABASE database_slave_temp_01;
CREATE DATABASE database_slave_temp_02;
@@ -132,15 +158,11 @@ SET sql_log_bin= 1;
**** t_02_01_temp, t_02_02_temp on database_master_temp_02
**** t_03_01_temp, t_03_02_temp, t_03_03_temp on database_master_temp_03
****
-
-con_temp_01
-
+connection con_temp_01;
USE database_master_temp_01;
CREATE TEMPORARY TABLE t_01_01_temp(a int);
INSERT INTO t_01_01_temp VALUES(1);
-
-con_temp_02
-
+connection con_temp_02;
USE database_master_temp_01;
CREATE TEMPORARY TABLE t_01_01_temp(a int);
INSERT INTO t_01_01_temp VALUES(1);
@@ -149,9 +171,7 @@ CREATE TEMPORARY TABLE t_02_01_temp(a int);
INSERT INTO t_02_01_temp VALUES(1);
CREATE TEMPORARY TABLE t_02_02_temp(a int);
INSERT INTO t_02_02_temp VALUES(1);
-
-con_temp_03
-
+connection con_temp_03;
USE database_master_temp_01;
CREATE TEMPORARY TABLE t_01_01_temp(a int);
INSERT INTO t_01_01_temp VALUES(1);
@@ -173,33 +193,50 @@ INSERT INTO t_03_03_temp VALUES(1);
**** guarantee that logging of the terminated con1 has been done yet.a To be
**** sure that logging has been done, we use a user lock.
+connection master;
+connection slave;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 10
+connection master;
+connection con_temp_01;
select get_lock("con_01",10);
get_lock("con_01",10)
1
+connection master;
+disconnect con_temp_01;
select get_lock("con_01",10);
get_lock("con_01",10)
1
+connection con_temp_02;
select get_lock("con_02",10);
get_lock("con_02",10)
1
+connection master;
+disconnect con_temp_02;
select get_lock("con_02",10);
get_lock("con_02",10)
1
+connection con_temp_03;
select get_lock("con_03",10);
get_lock("con_03",10)
1
+connection master;
+disconnect con_temp_03;
select get_lock("con_03",10);
get_lock("con_03",10)
1
**** Checking the binary log and temporary tables
+connection master;
+connection slave;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connection master;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
@@ -217,14 +254,18 @@ master-bin.000001 # Query # # use `database_master_temp_01`; DROP /*!40005 TEMPO
****
**** Cleaning up the test case
****
+connection master;
SET sql_log_bin= 0;
DROP DATABASE database_master_temp_01;
DROP DATABASE database_master_temp_02;
DROP DATABASE database_master_temp_03;
SET sql_log_bin= 1;
+connection slave;
SET sql_log_bin= 0;
DROP DATABASE database_slave_temp_01;
DROP DATABASE database_slave_temp_02;
DROP DATABASE database_slave_temp_03;
SET sql_log_bin= 1;
+connection master;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_logs.result b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
index f2dbfa3cba4..82f6f537329 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_logs.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_logs.result
@@ -1,3 +1,6 @@
+connect master,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
+connect slave,localhost,root,,test,$SLAVE_MYPORT,$SLAVE_MYSOCK;
+connection slave;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
start slave;
Got one of the listed errors
@@ -7,13 +10,17 @@ change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='r
ERROR HY000: Could not initialize master info structure for ''; more error messages can be found in the MariaDB error log
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+connection master;
reset master;
+connection slave;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables");
create table t1 (s text);
insert into t1 values('Could not break slave'),('Tried hard');
+connection slave;
Master_Log_File = 'master-bin.000001'
Relay_Master_Log_File = 'master-bin.000001'
include/check_slave_is_running.inc
@@ -21,6 +28,7 @@ select * from t1;
s
Could not break slave
Tried hard
+connection master;
flush logs;
create table t2(m int not null auto_increment primary key);
insert into t2 values (34),(67),(123);
@@ -31,15 +39,23 @@ master-bin.000001 #
master-bin.000002 #
master-bin.000003 #
create table t3 select * from temp_table;
+connection slave;
select * from t3;
a
testing temporary tables
+connection master;
drop table temp_table, t3;
+connection slave;
insert into t2 values(1234);
+connection master;
set insert_id=1234;
insert into t2 values(NULL);
+connection slave;
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .1234. for key .PRIMARY.. on query.* error.* 1062");
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
+connection master;
+connection slave;
+connection master;
purge master logs to 'master-bin.000002';
show master logs;
Log_name master-bin.000002
@@ -57,6 +73,7 @@ show binary logs;
Log_name File_size
master-bin.000003 #
insert into t2 values (65);
+connection slave;
Master_Log_File = 'master-bin.000003'
Relay_Master_Log_File = 'master-bin.000003'
include/check_slave_is_running.inc
@@ -67,6 +84,7 @@ m
67
123
1234
+connection master;
create temporary table temp_table (a char(80) not null);
insert into temp_table values ("testing temporary tables part 2");
create table t3 (n int);
@@ -86,6 +104,7 @@ master-bin.000009 #
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000009 # <Binlog_Do_DB> <Binlog_Ignore_DB>
+connection slave;
select * from t4;
a
testing temporary tables part 2
@@ -97,8 +116,10 @@ select count(*) from t3 where n >= 4;
count(*)
103
unlock tables;
+connection master;
drop table if exists t1,t2,t3,t4;
drop temporary table temp_table;
+connection slave;
End of 4.1 tests
show binlog events in 'non existing_binlog_file';
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
diff --git a/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result b/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result
index 1bda3bd3ee1..7218fe96dd2 100644
--- a/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result
+++ b/mysql-test/suite/rpl/r/rpl_rotate_purge_deadlock.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
show binary logs;
Log_name File_size
master-bin.000001 #
@@ -7,6 +8,7 @@ create table t1 (f text) engine=innodb;
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
SET DEBUG_SYNC = 'after_purge_logs_before_date SIGNAL continued';
insert into t1 set f=repeat('a', 4096);
+connection master1;
*** there must be two logs in the list ***
show binary logs;
Log_name File_size
@@ -22,13 +24,19 @@ master-bin.000003 #
SET DEBUG_SYNC = 'now SIGNAL rotated';
SET DEBUG_SYNC = 'now WAIT_FOR continued';
SET DEBUG_SYNC = 'RESET';
+connection master;
SET DEBUG_SYNC = 'RESET';
+connection slave;
+connection master;
SET DEBUG_SYNC = 'at_purge_logs_before_date WAIT_FOR rotated';
SET DEBUG_SYNC = 'after_purge_logs_before_date SIGNAL continued';
insert into t1 set f=repeat('b', 4096);
+connection master1;
SET DEBUG_SYNC = 'now SIGNAL rotated';
SET DEBUG_SYNC = 'now WAIT_FOR continued';
SET DEBUG_SYNC = 'RESET';
+connection master;
SET DEBUG_SYNC = 'RESET';
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_001.result b/mysql-test/suite/rpl/r/rpl_row_001.result
index b5f6aea9698..94985548f59 100644
--- a/mysql-test/suite/rpl/r/rpl_row_001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_001.result
@@ -15,12 +15,17 @@ Aaron
Aaron
Ababa
Ababa
+connection slave;
STOP SLAVE;
+connection master;
SET PASSWORD FOR root@"localhost" = PASSWORD('foo');
+connection slave;
START SLAVE;
+connection master;
SET PASSWORD FOR root@"localhost" = PASSWORD('');
CREATE TABLE t3(n INT);
INSERT INTO t3 VALUES(1),(2);
+connection slave;
SELECT * FROM t3 ORDER BY n;
n
1
@@ -28,25 +33,37 @@ n
SELECT SUM(LENGTH(word)) FROM t1;
SUM(LENGTH(word))
1022
+connection master;
DROP TABLE t1,t3;
+connection slave;
+connection master;
CREATE TABLE t1 (n INT) ENGINE=MYISAM;
+connection slave;
+connection master;
RESET MASTER;
+connection slave;
STOP SLAVE;
RESET SLAVE;
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
+connection slave;
LOCK TABLES t1 READ;
START SLAVE;
UNLOCK TABLES;
SELECT COUNT(*) FROM t1;
COUNT(*)
5000
+connection master;
DROP TABLE t1;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES(3456);
+connection slave;
SELECT n FROM t1;
n
3456
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_4_bytes.result b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
index ef9602204a1..0d746a7bd9c 100644
--- a/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
+++ b/mysql-test/suite/rpl/r/rpl_row_4_bytes.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -10,6 +11,7 @@ insert into t1 values("GUI");
insert into t2 values("LIL");
insert into t2 values("ABE");
insert into t2 values("ANG");
+connection slave;
use mysqltest1;
select * from t1 order by a;
a
@@ -20,5 +22,7 @@ a
ABE
ANG
LIL
+connection master;
DROP DATABASE mysqltest1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_NOW.result b/mysql-test/suite/rpl/r/rpl_row_NOW.result
index eb6271d6e93..480ad34ce69 100644
--- a/mysql-test/suite/rpl/r/rpl_row_NOW.result
+++ b/mysql-test/suite/rpl/r/rpl_row_NOW.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create database if not exists mysqltest1;
DROP TABLE IF EXISTS mysqltest1.t1;
CREATE TABLE mysqltest1.t1 (n MEDIUMINT NOT NULL AUTO_INCREMENT,
@@ -20,7 +21,10 @@ FOR EACH ROW BEGIN
SET new.b = mysqltest1.f1();
END|
INSERT INTO mysqltest1.t1 SET n = NULL, a = now();
+connection slave;
+connection master;
DROP TABLE IF EXISTS mysqltest1.t1;
DROP FUNCTION mysqltest1.f1;
DROP DATABASE mysqltest1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_USER.result b/mysql-test/suite/rpl/r/rpl_row_USER.result
index 47b94074ecf..5a59bb57795 100644
--- a/mysql-test/suite/rpl/r/rpl_row_USER.result
+++ b/mysql-test/suite/rpl/r/rpl_row_USER.result
@@ -2,12 +2,15 @@ include/master-slave.inc
[connection master]
set global sql_mode="";
set local sql_mode="";
+connection master;
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;
+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());
@@ -17,23 +20,27 @@ INSERT INTO mysqltest1.t1 VALUES(3,USER());
INSERT INTO mysqltest1.t1 VALUES(4,CURRENT_USER());
end|
CALL mysqltest1.p1();
+connection master;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a users
1 tester@localhost
2 @localhost%
3 tester@localhost
4 @localhost%
+connection slave;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a users
1 tester@localhost
2 @localhost%
3 tester@localhost
4 @localhost%
+connection master;
DROP DATABASE mysqltest1;
REVOKE ALL ON mysqltest1.* FROM 'tester'@'%';
REVOKE ALL ON mysqltest1.* FROM ''@'localhost%';
DROP USER tester@'%';
DROP USER ''@'localhost%';
+connection slave;
include/rpl_end.inc
set global sql_mode=default;
set local sql_mode=default;
diff --git a/mysql-test/suite/rpl/r/rpl_row_UUID.result b/mysql-test/suite/rpl/r/rpl_row_UUID.result
index e9ddc1c4d12..45fc1c0f4a0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_UUID.result
+++ b/mysql-test/suite/rpl/r/rpl_row_UUID.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
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;
@@ -22,6 +23,7 @@ fn1(0)
0
create table t2 (a int) engine=myisam;
insert into t2 values(fn1(2));
+connection slave;
SHOW CREATE TABLE test.t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -30,6 +32,7 @@ t1 CREATE TABLE `t1` (
`vchar_column` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection master;
DROP PROCEDURE test.p1;
DROP FUNCTION test.fn1;
DROP TABLE test.t1;
diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
index 9aeef98d091..c778355d182 100644
--- a/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
+++ b/mysql-test/suite/rpl/r/rpl_row_annotate_do.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+connect master2,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection master;
########################################################################
# TABLES ON MASTER
########################################################################
@@ -20,6 +22,7 @@ a b
3 baz
4 gås
5 gås
+connection slave;
########################################################################
# TABLES ON SLAVE: should be the same as on master
########################################################################
@@ -55,9 +58,11 @@ a b
# Ensure that a replication failure doesn't segfault - MDEV-7864
########################################################################
DELETE FROM t3 WHERE a=2;
+connection master;
INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d;
INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10;
DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a;
+connection slave;
---- Wait until slave stops with an error ----
include/wait_for_slave_sql_error.inc [errno=1032]
Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can't find record in 't3'" error)
@@ -65,6 +70,8 @@ Could not execute Delete_rows_v1 event on table test1.t3; Can't find record in '
call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032");
SET GLOBAL sql_slave_skip_counter=1;
START SLAVE;
+connection master;
+connection slave;
########################################################################
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
@@ -174,15 +181,20 @@ slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
########################################################################
# INSERTs DELAYED ON MASTERs
########################################################################
+connection master;
SET SESSION binlog_annotate_row_events = ON;
INSERT DELAYED INTO test1.t4 VALUES (1,1);
FLUSH TABLES;
SELECT * FROM test1.t4 ORDER BY a;
a b
1 1
+connection slave;
+connection master;
+connection slave;
########################################################################
# ON SLAVE
# No Annotate_rows events should appear below
########################################################################
FLUSH LOGS;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
index ceaf8c878c8..aaab2199725 100644
--- a/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
+++ b/mysql-test/suite/rpl/r/rpl_row_annotate_dont.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+connect master2,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection master;
########################################################################
# TABLES ON MASTER
########################################################################
@@ -20,6 +22,7 @@ a b
3 baz
4 gås
5 gås
+connection slave;
########################################################################
# TABLES ON SLAVE: should be the same as on master
########################################################################
@@ -47,9 +50,11 @@ a b
# Ensure that a replication failure doesn't segfault - MDEV-7864
########################################################################
DELETE FROM t3 WHERE a=2;
+connection master;
INSERT INTO t5 (a) SELECT a.a*10000+b.a*1000+c.a*100+d.a*10 FROM t5 a, t5 b, t5 c, t5 d;
INSERT INTO t3 (a) SELECT a FROM t5 WHERE a > 10;
DELETE t3 FROM t3 INNER JOIN t5 ON t3.a=t5.a;
+connection slave;
---- Wait until slave stops with an error ----
include/wait_for_slave_sql_error.inc [errno=1032]
Last_SQL_Error (expected "Delete_rows_v1 event on table test1.t3; Can't find record in 't3'" error)
@@ -57,6 +62,8 @@ Could not execute Delete_rows_v1 event on table test1.t3; Can't find record in '
call mtr.add_suppression("Slave: Can't find record in 't3' Error_code: 1032");
SET GLOBAL sql_slave_skip_counter=1;
START SLAVE;
+connection master;
+connection slave;
########################################################################
FLUSH LOGS;
show binlog events in 'slave-bin.000001' from <start_pos>;
@@ -154,15 +161,20 @@ slave-bin.000001 # Rotate 2 # slave-bin.000002;pos=4
########################################################################
# INSERTs DELAYED ON MASTERs
########################################################################
+connection master;
SET SESSION binlog_annotate_row_events = ON;
INSERT DELAYED INTO test1.t4 VALUES (1,1);
FLUSH TABLES;
SELECT * FROM test1.t4 ORDER BY a;
a b
1 1
+connection slave;
+connection master;
+connection slave;
########################################################################
# ON SLAVE
# No Annotate_rows events should appear below
########################################################################
FLUSH LOGS;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
index 71747e825b9..1072cb60f01 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_11bugs.result
@@ -2,7 +2,6 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression("Can't find record in 't.'");
CREATE DATABASE test_ignore;
-**** On Master ****
SHOW DATABASES;
Database
information_schema
@@ -35,7 +34,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
-**** On Slave ****
+connection slave;
SHOW DATABASES;
Database
information_schema
@@ -49,11 +48,14 @@ Tables_in_test
t1
USE test_ignore;
ERROR 42000: Unknown database 'test_ignore'
+connection master;
DROP DATABASE test_ignore;
USE test;
DROP TABLE t1;
+connection slave;
USE test;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT);
DELETE FROM t1;
INSERT INTO t1 VALUES (1),(2);
@@ -68,19 +70,20 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
+connection slave;
================ Test for BUG#17620 ================
include/rpl_reset.inc
-**** On Slave ****
+connection slave;
SET GLOBAL QUERY_CACHE_SIZE=0;
call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* error.* 1032");
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
-**** On Slave ****
+connection slave;
SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
-**** On Master ****
+connection master;
INSERT INTO t1 VALUES (4),(5),(6);
-**** On Slave ****
+connection slave;
SELECT * FROM t1;
a
1
@@ -89,9 +92,9 @@ a
4
5
6
-**** On Master ****
+connection master;
INSERT INTO t1 VALUES (7),(8),(9);
-**** On Slave ****
+connection slave;
SELECT * FROM t1;
a
1
@@ -104,38 +107,47 @@ a
8
9
SET GLOBAL QUERY_CACHE_SIZE=default;
+connection master;
DROP TABLE t1;
================ Test for BUG#22550 ================
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a BIT(1), b INT) ENGINE=MYISAM;
+connection slave;
+connection master;
INSERT INTO t1 VALUES(1,2);
SELECT HEX(a),b FROM t1;
HEX(a) b
1 2
+connection slave;
SELECT HEX(a),b FROM t1;
HEX(a) b
1 2
+connection master;
UPDATE t1 SET a=0 WHERE b=2;
SELECT HEX(a),b FROM t1;
HEX(a) b
0 2
+connection slave;
SELECT HEX(a),b FROM t1;
HEX(a) b
0 2
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
================ Test for BUG#22583 ================
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM;
CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB;
-**** On Slave ****
+connection slave;
ALTER TABLE t1_myisam ENGINE=INNODB;
ALTER TABLE t1_innodb ENGINE=MYISAM;
ALTER TABLE t2_myisam ENGINE=INNODB;
ALTER TABLE t2_innodb ENGINE=MYISAM;
-**** On Master ****
+connection master;
INSERT INTO t1_myisam VALUES(1, b'0', 257);
INSERT INTO t1_myisam VALUES(2, b'1', 256);
INSERT INTO t1_innodb VALUES(1, b'0', 257);
@@ -160,7 +172,7 @@ SELECT k, HEX(a),HEX(b) FROM t2_innodb;
k HEX(a) HEX(b)
1 0 9
2 1 8
-**** On Slave ****
+connection slave;
SELECT k, HEX(a),HEX(b) FROM t1_myisam;
k HEX(a) HEX(b)
1 0 101
@@ -177,7 +189,7 @@ SELECT k, HEX(a),HEX(b) FROM t2_innodb;
k HEX(a) HEX(b)
1 0 9
2 1 8
-**** On Master ****
+connection master;
UPDATE t1_myisam SET a=0 WHERE k=2;
SELECT k, HEX(a),HEX(b) FROM t1_myisam;
k HEX(a) HEX(b)
@@ -198,7 +210,7 @@ SELECT k, HEX(a),HEX(b) FROM t2_innodb;
k HEX(a) HEX(b)
1 0 9
2 0 8
-**** On Slave ****
+connection slave;
SELECT k, HEX(a),HEX(b) FROM t1_myisam;
k HEX(a) HEX(b)
1 0 101
@@ -215,8 +227,10 @@ SELECT k, HEX(a),HEX(b) FROM t2_innodb;
k HEX(a) HEX(b)
1 0 9
2 0 8
-**** On Master ****
+connection master;
DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
+connection slave;
+connection master;
drop table if exists t1, t2;
CREATE TABLE `t1` (
`a` int(11) NOT NULL auto_increment,
@@ -230,35 +244,40 @@ PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ;
insert into t1 values (1,1),(2,2);
insert into t2 values (1,1),(4,4);
+connection master;
UPDATE t2,t1 SET t2.a=t1.a+2;
ERROR 23000: Duplicate entry '3' for key 'PRIMARY'
select * from t2 /* must be (3,1), (4,4) */;
a b
3 1
4 4
+connection slave;
+connection slave;
select * from t2 /* must be (3,1), (4,4) */;
a b
3 1
4 4
+connection master;
drop table t1,t2;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave'));
INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
-**** On Slave ****
+connection slave;
UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
a b
2 master,slave
5 slave
set @@global.slave_exec_mode= 'IDEMPOTENT';
-**** On Master ****
+connection master;
UPDATE t1 SET a = 5, b = 'master' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
a b
2 master,slave
5 master
-**** On Slave ****
+connection slave;
set @@global.slave_exec_mode= default;
Last_SQL_Error
@@ -266,6 +285,6 @@ SELECT * FROM t1 ORDER BY a;
a b
2 master,slave
5 slave
-**** On Master ****
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
index 1035df2456c..1727ff4985d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_2myisam.result
@@ -1,10 +1,14 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection master;
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'MYISAM' ;
SELECT * FROM t1;
C1 C2
+connection slave;
SELECT * FROM t1;
C1 C2
+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;
@@ -15,6 +19,7 @@ A C
X X
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A A
@@ -23,6 +28,7 @@ A C
X X
X Y
X Z
+connection master;
DELETE FROM t1 WHERE C1 = C2;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
@@ -30,12 +36,14 @@ A B
A C
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A B
A C
X Y
X Z
+connection master;
UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
@@ -43,16 +51,19 @@ A B
A I
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A B
A I
X Y
X Z
+connection slave;
include/assert.inc [Counter for COM_COMMIT is consistent with the number of actual commits]
include/assert.inc [Counter for COM_INSERT is consistent with the number of actual inserts]
include/assert.inc [Counter for COM_DELETE is consistent with the number of actual deletes]
include/assert.inc [Counter for COM_UPDATE is consistent with the number of actual updates]
+connection master;
UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
SELECT * FROM t1 ORDER BY c1,c2;
C1 C2
@@ -60,12 +71,14 @@ A B
A I
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY c1,c2;
C1 C2
A B
A I
X Y
X Z
+connection master;
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),
@@ -88,6 +101,7 @@ c1 c12 c2
5 A 25
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 2
@@ -106,6 +120,7 @@ c1 c12 c2
5 A 25
8 A 64
9 A 81
+connection master;
UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
c1 c12 c2
@@ -118,6 +133,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -129,6 +145,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection master;
UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
@@ -141,6 +158,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -152,6 +170,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection master;
DELETE FROM t2 WHERE c1 % 4 = 0;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
@@ -162,6 +181,7 @@ c1 c12 c2
6 A 36
7 A 49
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -171,7 +191,9 @@ c1 c12 c2
6 A 36
7 A 49
9 A 81
+connection master;
UPDATE t2 SET c12='X';
+connection master;
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);
@@ -183,6 +205,7 @@ A C 1 B 2
X X 3 B 1
X Y 2 B 1
X Z 2 B 2
+connection slave;
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
A A 3 B 2
@@ -191,6 +214,7 @@ A C 1 B 2
X X 3 B 1
X Y 2 B 1
X Z 2 B 2
+connection master;
DELETE FROM t3 WHERE C1 = C2;
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
@@ -198,12 +222,14 @@ A B 1 B 1
A C 1 B 2
X Y 2 B 1
X Z 2 B 2
+connection slave;
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
+connection master;
UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
@@ -211,12 +237,14 @@ A B 1 B 1
A I 1 B 2
X Y 2 B 1
X Z 2 B 2
+connection slave;
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
+connection master;
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);
@@ -228,6 +256,7 @@ X X 3
A C 4
X Z 5
A A 6
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
@@ -236,6 +265,7 @@ X X 3
A C 4
X Z 5
A A 6
+connection master;
DELETE FROM t6 WHERE C1 = C2;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
@@ -243,12 +273,14 @@ A B 1
X Y 2
A C 4
X Z 5
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
X Y 2
A C 4
X Z 5
+connection master;
UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
@@ -256,12 +288,14 @@ A B 1
X Y 2
A I 4
X Z 5
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
X Y 2
A I 4
X Z 5
+connection master;
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);
@@ -310,6 +344,7 @@ 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
+connection slave;
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
@@ -354,16 +389,20 @@ 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
+connection master;
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
+connection slave;
SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
C1 HEX(B1) HEX(B2)
1 NULL 0
+connection master;
CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'MYISAM' ;
---- on slave: original values ---
+connection slave;
+--- original values ---
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
SELECT * FROM t7 ORDER BY C1;
C1 C2
@@ -371,21 +410,23 @@ C1 C2
2 6
3 9
set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master: new values inserted ---
+connection 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
+connection slave;
set @@global.slave_exec_mode= default;
---- on slave: old values should be overwritten by replicated values ---
+--- old values should be overwritten by replicated values ---
SELECT * FROM t7 ORDER BY C1;
C1 C2
1 2
2 4
3 6
---- on master ---
+connection master;
CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'MYISAM' ;
INSERT INTO t8 VALUES (99,99,99);
INSERT INTO t8 VALUES (99,22,33);
@@ -397,7 +438,7 @@ ERROR 23000: Duplicate entry '99' for key 'c'
SELECT * FROM t8 ORDER BY a;
a b c
99 99 99
---- on slave ---
+connection slave;
SELECT * FROM t8 ORDER BY a;
a b c
99 99 99
@@ -409,10 +450,10 @@ a b c
3 6 9
99 99 99
set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master ---
+connection master;
INSERT INTO t8 VALUES (2,4,8);
+connection slave;
set @@global.slave_exec_mode= default;
---- on slave ---
SELECT * FROM t8 ORDER BY a;
a b c
1 2 3
@@ -420,100 +461,135 @@ a b c
3 6 9
99 99 99
**** Test for BUG#31552 ****
-**** On Master ****
+connection master;
DELETE FROM t1;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
-**** On Master ****
+connection slave;
set @@global.slave_exec_mode= 'IDEMPOTENT';
DELETE FROM t1 WHERE C1 = 'L';
+connection master;
DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
+connection slave;
set @@global.slave_exec_mode= default;
include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
-**** On Master ****
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
INSERT INTO t1 VALUES(
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
-**** On Slave ****
+connection slave;
SELECT * FROM t1;
a b c
2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
+connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+connection slave;
+connection master;
CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
+connection slave;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
+connection slave;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
+connection slave;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
+connection slave;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'MYISAM' ;
+connection slave;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032");
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677");
include/rpl_reset.inc
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+connection slave;
include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
+connection master;
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
include/rpl_reset.inc
[expecting slave to stop]
+connection master;
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
include/rpl_reset.inc
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/diff_tables.inc [master:t7, slave:t7]
+connection master;
drop table t1, t2, t3, t4, t5, t6, t7;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='MYISAM' ;
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
+connection master;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
@@ -565,10 +641,13 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+connection slave;
*** results: t2 must be consistent ****
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1, t2;
EOF OF TESTS
+connection master;
CREATE TABLE t1 (a int) ENGINE='MYISAM' ;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -582,8 +661,13 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
+connection master;
+connection master;
CREATE TABLE t1 (a bit) ENGINE='MYISAM' ;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -624,6 +708,9 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
index 0c12eb544a5..f12f363a3d4 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_3innodb.result
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection slave;
+connection master;
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'INNODB' ;
SELECT * FROM t1;
C1 C2
+connection slave;
SELECT * FROM t1;
C1 C2
+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;
@@ -15,6 +20,7 @@ A C
X X
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A A
@@ -23,6 +29,7 @@ A C
X X
X Y
X Z
+connection master;
DELETE FROM t1 WHERE C1 = C2;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
@@ -30,12 +37,14 @@ A B
A C
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A B
A C
X Y
X Z
+connection master;
UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
@@ -43,16 +52,19 @@ A B
A I
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A B
A I
X Y
X Z
+connection slave;
include/assert.inc [Counter for COM_COMMIT is consistent with the number of actual commits]
include/assert.inc [Counter for COM_INSERT is consistent with the number of actual inserts]
include/assert.inc [Counter for COM_DELETE is consistent with the number of actual deletes]
include/assert.inc [Counter for COM_UPDATE is consistent with the number of actual updates]
+connection master;
UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
SELECT * FROM t1 ORDER BY c1,c2;
C1 C2
@@ -60,12 +72,14 @@ A B
A I
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY c1,c2;
C1 C2
A B
A I
X Y
X Z
+connection master;
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),
@@ -88,6 +102,7 @@ c1 c12 c2
5 A 25
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 2
@@ -106,6 +121,7 @@ c1 c12 c2
5 A 25
8 A 64
9 A 81
+connection master;
UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
c1 c12 c2
@@ -118,6 +134,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -129,6 +146,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection master;
UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
@@ -141,6 +159,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -152,6 +171,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection master;
DELETE FROM t2 WHERE c1 % 4 = 0;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
@@ -162,6 +182,7 @@ c1 c12 c2
6 A 36
7 A 49
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -171,7 +192,9 @@ c1 c12 c2
6 A 36
7 A 49
9 A 81
+connection master;
UPDATE t2 SET c12='X';
+connection master;
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);
@@ -183,6 +206,7 @@ A C 1 B 2
X X 3 B 1
X Y 2 B 1
X Z 2 B 2
+connection slave;
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
A A 3 B 2
@@ -191,6 +215,7 @@ A C 1 B 2
X X 3 B 1
X Y 2 B 1
X Z 2 B 2
+connection master;
DELETE FROM t3 WHERE C1 = C2;
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
@@ -198,12 +223,14 @@ A B 1 B 1
A C 1 B 2
X Y 2 B 1
X Z 2 B 2
+connection slave;
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
+connection master;
UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
@@ -211,12 +238,14 @@ A B 1 B 1
A I 1 B 2
X Y 2 B 1
X Z 2 B 2
+connection slave;
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
+connection master;
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);
@@ -228,6 +257,7 @@ X X 3
A C 4
X Z 5
A A 6
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
@@ -236,6 +266,7 @@ X X 3
A C 4
X Z 5
A A 6
+connection master;
DELETE FROM t6 WHERE C1 = C2;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
@@ -243,12 +274,14 @@ A B 1
X Y 2
A C 4
X Z 5
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
X Y 2
A C 4
X Z 5
+connection master;
UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
@@ -256,12 +289,14 @@ A B 1
X Y 2
A I 4
X Z 5
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
X Y 2
A I 4
X Z 5
+connection master;
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);
@@ -310,6 +345,7 @@ 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
+connection slave;
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
@@ -354,19 +390,24 @@ 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
+connection slave;
SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
+connection master;
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
+connection slave;
SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
C1 HEX(B1) HEX(B2)
1 NULL 0
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+connection master;
CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'INNODB' ;
---- on slave: original values ---
+connection slave;
+--- original values ---
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
SELECT * FROM t7 ORDER BY C1;
C1 C2
@@ -374,21 +415,23 @@ C1 C2
2 6
3 9
set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master: new values inserted ---
+connection 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
+connection slave;
set @@global.slave_exec_mode= default;
---- on slave: old values should be overwritten by replicated values ---
+--- old values should be overwritten by replicated values ---
SELECT * FROM t7 ORDER BY C1;
C1 C2
1 2
2 4
3 6
---- on master ---
+connection master;
CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'INNODB' ;
INSERT INTO t8 VALUES (99,99,99);
INSERT INTO t8 VALUES (99,22,33);
@@ -400,7 +443,7 @@ ERROR 23000: Duplicate entry '99' for key 'c'
SELECT * FROM t8 ORDER BY a;
a b c
99 99 99
---- on slave ---
+connection slave;
SELECT * FROM t8 ORDER BY a;
a b c
99 99 99
@@ -412,10 +455,10 @@ a b c
3 6 9
99 99 99
set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master ---
+connection master;
INSERT INTO t8 VALUES (2,4,8);
+connection slave;
set @@global.slave_exec_mode= default;
---- on slave ---
SELECT * FROM t8 ORDER BY a;
a b c
1 2 3
@@ -423,100 +466,135 @@ a b c
3 6 9
99 99 99
**** Test for BUG#31552 ****
-**** On Master ****
+connection master;
DELETE FROM t1;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
-**** On Master ****
+connection slave;
set @@global.slave_exec_mode= 'IDEMPOTENT';
DELETE FROM t1 WHERE C1 = 'L';
+connection master;
DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
+connection slave;
set @@global.slave_exec_mode= default;
include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
-**** On Master ****
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
INSERT INTO t1 VALUES(
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
-**** On Slave ****
+connection slave;
SELECT * FROM t1;
a b c
2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
+connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+connection slave;
+connection master;
CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
+connection slave;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
+connection slave;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
+connection slave;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
+connection slave;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'INNODB' ;
+connection slave;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032");
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677");
include/rpl_reset.inc
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+connection slave;
include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
+connection master;
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
include/rpl_reset.inc
[expecting slave to stop]
+connection master;
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
include/rpl_reset.inc
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/diff_tables.inc [master:t7, slave:t7]
+connection master;
drop table t1, t2, t3, t4, t5, t6, t7;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='INNODB' ;
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
+connection master;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
@@ -568,10 +646,13 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+connection slave;
*** results: t2 must be consistent ****
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1, t2;
EOF OF TESTS
+connection master;
CREATE TABLE t1 (a int) ENGINE='INNODB' ;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -585,10 +666,16 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
+connection master;
+connection slave;
SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
+connection master;
CREATE TABLE t1 (a bit) ENGINE='INNODB' ;
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -629,7 +716,10 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
index 91b1007aa59..2946a149412 100644
--- a/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
+++ b/mysql-test/suite/rpl/r/rpl_row_basic_8partition.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS t1;
SET @@BINLOG_FORMAT = ROW;
**** Partition RANGE testing ****
@@ -14,7 +15,6 @@ PARTITION p2 VALUES LESS THAN (1966),
PARTITION p3 VALUES LESS THAN (1986),
PARTITION p4 VALUES LESS THAN (2005),
PARTITION p5 VALUES LESS THAN MAXVALUE);
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -35,7 +35,7 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
---- On slave --
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -56,6 +56,7 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -65,6 +66,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -73,29 +75,34 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
ALTER TABLE t1 MODIFY vc TEXT;
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -116,7 +123,7 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -137,6 +144,7 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (1986) ENGINE = MyISAM,
PARTITION p4 VALUES LESS THAN (2005) ENGINE = MyISAM,
PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -146,6 +154,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -154,27 +163,33 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
DROP TABLE IF EXISTS t1;
**** Partition LIST testing ****
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
@@ -185,7 +200,6 @@ PARTITION BY LIST(id)
(PARTITION p0 VALUES IN (2, 4),
PARTITION p1 VALUES IN (42, 142),
PARTITION p2 VALUES IN (412));
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -203,7 +217,7 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -221,6 +235,7 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -230,6 +245,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -238,29 +254,34 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
ALTER TABLE t1 MODIFY vc TEXT;
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -278,7 +299,7 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -296,6 +317,7 @@ t1 CREATE TABLE `t1` (
(PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM,
PARTITION p1 VALUES IN (42,142) ENGINE = MyISAM,
PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -305,6 +327,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -313,27 +336,33 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
DROP TABLE IF EXISTS t1;
**** Partition HASH testing ****
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
@@ -342,7 +371,6 @@ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
y YEAR, t DATE)
PARTITION BY HASH( YEAR(t) )
PARTITIONS 4;
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -358,7 +386,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH ( YEAR(t))
PARTITIONS 4 */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -374,6 +402,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH ( YEAR(t))
PARTITIONS 4 */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -383,6 +412,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -391,29 +421,33 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
ALTER TABLE t1 MODIFY vc TEXT;
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -429,7 +463,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH ( YEAR(t))
PARTITIONS 4 */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -445,6 +479,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY HASH ( YEAR(t))
PARTITIONS 4 */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -454,6 +489,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -462,27 +498,33 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
DROP TABLE IF EXISTS t1;
**** Partition by KEY ****
CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
@@ -491,7 +533,6 @@ f FLOAT DEFAULT 0, total BIGINT UNSIGNED,
y YEAR, t DATE,PRIMARY KEY(id))
PARTITION BY KEY()
PARTITIONS 4;
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -508,7 +549,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY ()
PARTITIONS 4 */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -525,6 +566,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY ()
PARTITIONS 4 */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -534,6 +576,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -542,29 +585,34 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -581,7 +629,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY ()
PARTITIONS 4 */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -598,6 +646,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY ()
PARTITIONS 4 */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -607,6 +656,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -615,29 +665,34 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
+connection master;
ALTER TABLE t1 MODIFY vc TEXT;
---- On master ---
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -654,7 +709,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY ()
PARTITIONS 4 */
---- On slave ---
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -671,6 +726,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY KEY ()
PARTITIONS 4 */
+connection master;
"--- Insert into t1 --" as "";
--- Select from t1 on master ---
select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
@@ -680,6 +736,7 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection slave;
--- Select from t1 on slave ---
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
@@ -688,26 +745,31 @@ 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 1905-11-14
142 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 1995-11-14
412 1 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2005-11-14
+connection master;
--- Update t1 on master --
UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
--- Check the update on master ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection slave;
--- Check Update on slave ---
SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
id hex(b1) vc bc d f total y t
412 0 Testing MySQL databases is a cool Must make it bug free for the customer 654321.4321 15.21 0 1965 2006-02-22
+connection master;
--- Remove a record from t1 on master ---
DELETE FROM t1 WHERE id = 42;
--- Show current count on master for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection slave;
--- Show current count on slave for t1 ---
SELECT COUNT(*) FROM t1;
COUNT(*)
4
+connection master;
DELETE FROM t1;
DROP TABLE IF EXISTS t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
index 71edcd749e5..a8e569aad61 100644
--- a/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_binlog_max_cache_size.result
@@ -5,12 +5,15 @@ SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
SET GLOBAL max_binlog_stmt_cache_size = 4096;
SET GLOBAL binlog_stmt_cache_size = 4096;
+disconnect master;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
########################################################################################
# 1 - SINGLE STATEMENT
########################################################################################
+connection master;
*** Single statement on transactional table ***
Got one of the listed errors
*** Single statement on non-transactional table ***
@@ -23,6 +26,7 @@ include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -50,10 +54,12 @@ INSERT INTO t1 (a, data) VALUES (27, 's');;
INSERT INTO t2 (a, data) VALUES (28, 's');;
INSERT INTO t1 (a, data) VALUES (29, 's');;
CREATE TABLE t5 (a int);
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -62,10 +68,12 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -76,10 +84,12 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -100,10 +110,12 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -118,10 +130,12 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -137,6 +151,7 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################
# 8 - Bug#55375(Regression Bug) Transaction bigger than
@@ -153,14 +168,20 @@ CALL mtr.add_suppression("Multi-statement transaction required more than 'max_bi
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
+connection master;
TRUNCATE t1;
+connection slave;
+connection master;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+disconnect master;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
BEGIN;
Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
COMMIT;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1534]
SELECT count(*) FROM t1;
count(*)
@@ -172,12 +193,15 @@ SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/start_slave.inc
+connection master;
+connection slave;
SELECT count(*) FROM t1;
count(*)
128
########################################################################################
# CLEAN
########################################################################################
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
index 4fb33dc4b6b..084089078cc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_innodb.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -24,6 +25,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
+connection slave;
**** Data Insert Validation Slave Section test.t1 ****
@@ -36,6 +38,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
+connection master;
**** Data Update Section test.t1 ****
@@ -50,6 +53,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
+connection slave;
**** Data Update Validation Slave Section test.t1 ****
@@ -59,6 +63,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
+connection master;
**** End Test Section test.t1 ****
@@ -109,6 +114,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
+connection slave;
**** Data Insert Validation Slave Section test.t2 ****
@@ -120,6 +126,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
+connection master;
**** Data Update Section test.t2 ****
@@ -136,6 +143,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
+connection slave;
**** Data Update Validation Slave Section test.t2 ****
@@ -147,7 +155,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
index 4fb33dc4b6b..084089078cc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_blob_myisam.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -24,6 +25,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
+connection slave;
**** Data Insert Validation Slave Section test.t1 ****
@@ -36,6 +38,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
+connection master;
**** Data Update Section test.t1 ****
@@ -50,6 +53,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
+connection slave;
**** Data Update Validation Slave Section test.t1 ****
@@ -59,6 +63,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
+connection master;
**** End Test Section test.t1 ****
@@ -109,6 +114,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
+connection slave;
**** Data Insert Validation Slave Section test.t2 ****
@@ -120,6 +126,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
+connection master;
**** Data Update Section test.t2 ****
@@ -136,6 +143,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
+connection slave;
**** Data Update Validation Slave Section test.t2 ****
@@ -147,7 +155,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_colSize.result b/mysql-test/suite/rpl/r/rpl_row_colSize.result
index d147f416c69..dd324ef7807 100644
--- a/mysql-test/suite/rpl/r/rpl_row_colSize.result
+++ b/mysql-test/suite/rpl/r/rpl_row_colSize.result
@@ -3,16 +3,21 @@ include/master-slave.inc
DROP TABLE IF EXISTS t1;
**** Testing WL#3228 changes. ****
*** Create "wider" table on slave ***
+connection slave;
Checking MYSQL_TYPE_NEWDECIMAL fields
+connection master;
DROP TABLE IF EXISTS t1;
Warnings:
Note 1051 Unknown table 'test.t1'
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a DECIMAL(5,2));
+connection master;
CREATE TABLE t1 (a DECIMAL(20, 10));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)''
@@ -21,15 +26,21 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a DECIMAL(27, 9));
+connection master;
CREATE TABLE t1 (a DECIMAL(27, 18));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(27,18)' to type 'decimal(27,9)''
@@ -38,15 +49,21 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a NUMERIC(5,2));
+connection master;
CREATE TABLE t1 (a NUMERIC(20, 10));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'decimal(20,10)' to type 'decimal(5,2)''
@@ -55,16 +72,22 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_FLOAT fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a FLOAT(20));
+connection master;
CREATE TABLE t1 (a FLOAT(47));
RESET MASTER;
INSERT INTO t1 VALUES (901251.90125);
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'double' to type 'float''
@@ -73,16 +96,22 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_BIT fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a BIT(5));
+connection master;
CREATE TABLE t1 (a BIT(64));
RESET MASTER;
INSERT INTO t1 VALUES (B'10101');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'bit(64)' to type 'bit(5)''
@@ -91,15 +120,21 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a BIT(11));
+connection master;
CREATE TABLE t1 (a BIT(12));
RESET MASTER;
INSERT INTO t1 VALUES (B'10101');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'bit(12)' to type 'bit(11)''
@@ -108,16 +143,22 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_SET fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a SET('4'));
+connection master;
CREATE TABLE t1 (a SET('1','2','3','4','5','6','7','8','9'));
RESET MASTER;
INSERT INTO t1 VALUES ('4');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'set' to type 'set('4')''
@@ -126,16 +167,22 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_STRING fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a CHAR(10));
+connection master;
CREATE TABLE t1 (a CHAR(20));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'char(20)' to type 'char(10)''
@@ -144,13 +191,18 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_ENUM fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a ENUM('44','54'));
+connection master;
CREATE TABLE t1 (a ENUM(
'01','02','03','04','05','06','07','08','09',
'11','12','13','14','15','16','17','18','19',
@@ -185,6 +237,7 @@ CREATE TABLE t1 (a ENUM(
));
RESET MASTER;
INSERT INTO t1 VALUES ('44');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'enum' to type 'enum('44','54')''
@@ -193,16 +246,22 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_VARCHAR fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a VARCHAR(100));
+connection master;
CREATE TABLE t1 (a VARCHAR(2000));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(100)''
@@ -211,15 +270,21 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a VARCHAR(10));
+connection master;
CREATE TABLE t1 (a VARCHAR(200));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(200)' to type 'varchar(10)''
@@ -228,15 +293,21 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a VARCHAR(1000));
+connection master;
CREATE TABLE t1 (a VARCHAR(2000));
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'varchar(2000)' to type 'varchar(1000)''
@@ -245,16 +316,22 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
Checking MYSQL_TYPE_BLOB fields
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t1 (a TINYBLOB);
+connection master;
CREATE TABLE t1 (a LONGBLOB);
RESET MASTER;
INSERT INTO t1 VALUES ('This is a test.');
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t1' cannot be converted from type 'tinyblob' to type 'tinyblob''
@@ -263,10 +340,15 @@ COUNT(*)
0
STOP SLAVE;
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
+connection slave;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 0 ...e mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Column 0 of table .test.t1. cannot be converted from type.* error.* 1677");
*** Cleanup ***
+connection master;
DROP TABLE IF EXISTS t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_conflicts.result b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
index ee4cc8c1e46..5f957380a54 100644
--- a/mysql-test/suite/rpl/r/rpl_row_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_row_conflicts.result
@@ -1,25 +1,26 @@
include/master-slave.inc
[connection master]
+connection slave;
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' error.* .*");
call mtr.add_suppression("Can't find record in 't.'");
-[on slave]
+connection slave;
SET @old_slave_exec_mode= @@global.slave_exec_mode;
######## Run with slave_exec_mode=STRICT ########
SET @@global.slave_exec_mode = 'STRICT';
==== Initialize ====
-[on master]
+connection master;
CREATE TABLE t1(a INT PRIMARY KEY);
-[on slave]
+connection slave;
==== Test: SQL thread sees 'INSERT' of existing key ====
---- Prepare slave so that it will get duplicate key error ----
INSERT INTO t1 VALUES (1);
---- Insert rows on master ----
-[on master]
+connection master;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
a
1
-[on slave]
+connection slave;
---- Wait until slave stops with an error ----
include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error (expected "duplicate key" error)
@@ -39,17 +40,17 @@ a
1
==== Test: SQL thread sees 'DELETE' of non-existing row ====
---- On master, insert two rows, the second with binlogging off ----
-[on master]
+connection master;
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
-[on slave]
+connection slave;
DELETE FROM t1 WHERE a = 1;
---- On master, remove the row that does not exist on slave ----
-[on master]
+connection master;
DELETE FROM t1 WHERE a = 1;
SELECT * FROM t1;
a
-[on slave]
+connection slave;
---- Wait until slave stops with an error ----
call mtr.add_suppression("Slave SQL.*Can.t find record in .t1., error.* 1032");
include/wait_for_slave_sql_error.inc [errno=1032]
@@ -66,26 +67,26 @@ Last_SQL_Error = (expected no error)
SELECT * FROM t1;
a
==== Clean up ====
-[on master]
+connection master;
DROP TABLE t1;
-[on slave]
+connection slave;
include/rpl_reset.inc
######## Run with slave_exec_mode=IDEMPOTENT ########
set @@global.slave_exec_mode= 'IDEMPOTENT';
==== Initialize ====
-[on master]
+connection master;
CREATE TABLE t1(a INT PRIMARY KEY);
-[on slave]
+connection slave;
==== Test: SQL thread sees 'INSERT' of existing key ====
---- Prepare slave so that it will get duplicate key error ----
INSERT INTO t1 VALUES (1);
---- Insert rows on master ----
-[on master]
+connection master;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
a
1
-[on slave]
+connection slave;
---- Sync slave and verify that there is no error ----
Last_SQL_Error = '' (expected no error)
SELECT * FROM t1;
@@ -93,24 +94,24 @@ a
1
==== Test: SQL thread sees 'DELETE' of non-existing row ====
---- On master, insert two rows, the second with binlogging off ----
-[on master]
+connection master;
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
-[on slave]
+connection slave;
DELETE FROM t1 WHERE a = 1;
---- On master, remove the row that does not exist on slave ----
-[on master]
+connection master;
DELETE FROM t1 WHERE a = 1;
SELECT * FROM t1;
a
-[on slave]
+connection slave;
---- Sync slave and verify that there is no error ----
Last_SQL_Error = (expected no error)
SELECT * FROM t1;
a
==== Clean up ====
-[on master]
+connection master;
DROP TABLE t1;
-[on slave]
+connection slave;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_corruption.result b/mysql-test/suite/rpl/r/rpl_row_corruption.result
index da4a1d17727..b5bdc32200a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_corruption.result
+++ b/mysql-test/suite/rpl/r/rpl_row_corruption.result
@@ -4,27 +4,35 @@ CREATE TABLE t1_11753004 (c1 INT);
CREATE TABLE t2_11753004 (c1 INT);
INSERT INTO t1_11753004 VALUES (1);
INSERT INTO t2_11753004 VALUES (2);
+connection slave;
call mtr.add_suppression(".*Found table map event mapping table id 0 which was already mapped but with different settings.*");
include/stop_slave.inc
SET @save_debug= @@global.debug;
SET GLOBAL debug_dbug="+d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
+connection master;
UPDATE t1_11753004, t2_11753004 SET t1_11753004.c1=3, t2_11753004.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004.c1=2;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1593 ]
include/stop_slave.inc
SET GLOBAL debug_dbug="-d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
+connection master;
include/rpl_reset.inc
DROP TABLE t1_11753004, t2_11753004;
+connection slave;
+connection slave;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_tblmap_same_id_maps_diff_table";
include/start_slave.inc
include/rpl_reset.inc
+connection master;
CREATE TABLE t1_11753004 (c1 INT);
CREATE TABLE t2_11753004_ign (c1 INT);
INSERT INTO t1_11753004 VALUES (1);
INSERT INTO t2_11753004_ign VALUES (2);
UPDATE t1_11753004, t2_11753004_ign SET t1_11753004.c1=3, t2_11753004_ign.c1=4 WHERE t1_11753004.c1=1 OR t2_11753004_ign.c1=2;
+connection slave;
CREATE TABLE t1 (c1 INT);
CREATE TABLE t2 (c1 INT);
INSERT INTO t1 VALUES (1);
@@ -42,8 +50,11 @@ SOgWThgBAAAAKAAAAH8DAAAAAEMAAAAAAAEAAf///gEAAAD+BAAAAA==
'/*!*/;
ERROR HY000: Fatal error: Found table map event mapping table id 0 which was already mapped but with different settings.
DROP TABLE t1,t2;
+connection slave;
SET GLOBAL debug_dbug="-d,inject_tblmap_same_id_maps_diff_table";
+connection master;
DROP TABLE t1_11753004;
DROP TABLE t2_11753004_ign;
+connection slave;
SET GLOBAL debug_dbug= @save_debug;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_select.result b/mysql-test/suite/rpl/r/rpl_row_create_select.result
index 81bbd3bc2fd..5b37b409b09 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_select.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_select.result
@@ -4,6 +4,7 @@ include/master-slave.inc
# BUG#17994219: CREATE TABLE .. SELECT PRODUCES INVALID STRUCTURE,
# BREAKS RBR
#
+connection master;
#After the patch, the display width is set to a default
#value of 21.
CREATE TABLE t1 AS SELECT REPEAT('A', 1000) DIV 1 AS a;
@@ -23,6 +24,8 @@ t2 CREATE TABLE `t2` (
`a` bigint(21) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
#After the patch, no error is reported.
+connection slave;
+connection master;
DROP TABLE t1;
DROP TABLE t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_create_table.result b/mysql-test/suite/rpl/r/rpl_row_create_table.result
index 283e769ce9a..22ddf2e58f8 100644
--- a/mysql-test/suite/rpl/r/rpl_row_create_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_create_table.result
@@ -1,8 +1,12 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection master;
+connection slave;
include/wait_for_slave_to_stop.inc
include/wait_for_slave_to_start.inc
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT);
CREATE OR REPLACE TABLE t1 (a INT, b INT);
CREATE TABLE t2 (a INT, b INT) ENGINE=Merge;
@@ -20,7 +24,6 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT, b INT) CHARSET=utf8
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # 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` (
@@ -39,7 +42,7 @@ Create Table CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8
-**** On Slave ****
+connection slave;
SHOW CREATE TABLE t1;
Table t1
Create Table CREATE TABLE `t1` (
@@ -58,11 +61,11 @@ Create Table CREATE TABLE `t3` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=utf8
+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;
-**** On Master ****
SHOW CREATE TABLE t5;
Table t5
Create Table CREATE TABLE `t5` (
@@ -87,7 +90,7 @@ NULL 3 6
NULL 4 2
NULL 5 10
NULL 6 12
-**** On Slave ****
+connection slave;
SHOW CREATE TABLE t5;
Table t5
Create Table CREATE TABLE `t5` (
@@ -113,6 +116,7 @@ NULL 4 2
NULL 5 10
NULL 6 12
include/rpl_reset.inc
+connection master;
CREATE TABLE t7 (UNIQUE(b)) SELECT a,b FROM tt3;
ERROR 23000: Duplicate entry '2' for key 'b'
include/show_binlog_events.inc
@@ -132,12 +136,14 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t7)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
+connection slave;
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
2 4
3 6
include/rpl_reset.inc
+connection master;
CREATE TEMPORARY TABLE tt4 (a INT, b INT);
INSERT INTO tt4 VALUES (4,8), (5,10), (6,12);
BEGIN;
@@ -159,6 +165,7 @@ a b
4 8
5 10
6 12
+connection slave;
SELECT * FROM t7 ORDER BY a,b;
a b
1 2
@@ -168,12 +175,12 @@ a b
5 10
6 12
include/rpl_reset.inc
+connection master;
CREATE TABLE t8 LIKE t4;
CREATE TABLE t9 LIKE tt4;
CREATE TEMPORARY TABLE tt5 LIKE t4;
CREATE TEMPORARY TABLE tt6 LIKE tt4;
CREATE TEMPORARY TABLE tt7 SELECT 1;
-**** On Master ****
SHOW CREATE TABLE t8;
Table t8
Create Table CREATE TABLE `t8` (
@@ -195,7 +202,7 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
)
-**** On Slave ****
+connection slave;
SHOW CREATE TABLE t8;
Table t8
Create Table CREATE TABLE `t8` (
@@ -208,7 +215,9 @@ Create Table CREATE TABLE `t9` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MEMORY DEFAULT CHARSET=latin1
+connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8,t9;
+connection slave;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
SET GLOBAL storage_engine=@storage_engine;
@@ -216,6 +225,7 @@ START SLAVE;
include/wait_for_slave_to_start.inc
================ BUG#22864 ================
include/rpl_reset.inc
+connection master;
SET AUTOCOMMIT=0;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -291,6 +301,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
+connection slave;
SHOW TABLES;
Tables_in_test
t1
@@ -320,9 +331,12 @@ a
1
2
3
+connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4;
SET AUTOCOMMIT=1;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
CREATE TABLE t2 (a INT) ENGINE=INNODB;
@@ -357,6 +371,7 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
+connection slave;
SELECT * FROM t2 ORDER BY a;
a
1
@@ -364,8 +379,11 @@ a
4
6
9
+connection master;
TRUNCATE TABLE t2;
+connection slave;
include/rpl_reset.inc
+connection master;
BEGIN;
INSERT INTO t2 SELECT a*a FROM t1;
CREATE TEMPORARY TABLE tt2
@@ -386,14 +404,19 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # ROLLBACK
+connection slave;
SELECT * FROM t2 ORDER BY a;
a
+connection master;
DROP TABLE t1,t2;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(1);
CREATE TABLE t2 (a INT UNIQUE) ENGINE=INNODB SELECT * FROM t1;
ERROR 23000: Duplicate entry '1' for key 'a'
INSERT INTO t1 VALUES (2);
+connection slave;
*** the proof of the fix:
select must show that the last insert performed on the slave ***
SELECT * FROM t1;
@@ -401,8 +424,11 @@ a
1
1
2
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_reset.inc
+connection master;
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE TABLE mysqltest1.without_select (f1 BIGINT);
@@ -422,8 +448,12 @@ master-bin.000001 # Query # # use `test`; CREATE TABLE `mysqltest1`.`with_select
master-bin.000001 # Table_map # # table_id: # (mysqltest1.with_select)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
+connection slave;
+connection master;
DROP DATABASE mysqltest1;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TEMPORARY TABLE t7(c1 INT);
CREATE TABLE t5(c1 INT);
CREATE TABLE t4(c1 INT);
@@ -431,14 +461,18 @@ CREATE VIEW bug48506_t1 AS SELECT 1;
CREATE VIEW bug48506_t2 AS SELECT * FROM t4;
CREATE VIEW bug48506_t3 AS SELECT t5.c1 AS A, t4.c1 AS B FROM t5, t4;
CREATE TABLE bug48506_t4(c1 INT);
+connection slave;
DROP VIEW bug48506_t1, bug48506_t2, bug48506_t3;
DROP TABLE bug48506_t4;
+connection master;
CREATE TABLE IF NOT EXISTS bug48506_t1 LIKE t7;
CREATE TABLE IF NOT EXISTS bug48506_t2 LIKE t7;
CREATE TABLE IF NOT EXISTS bug48506_t3 LIKE t7;
CREATE TABLE IF NOT EXISTS bug48506_t4 LIKE t7;
+connection slave;
SHOW TABLES LIKE 'bug48506%';
Tables_in_test (bug48506%)
+connection master;
DROP VIEW IF EXISTS bug48506_t1, bug48506_t2, bug48506_t3;
DROP TEMPORARY TABLES t7;
DROP TABLES t4, t5;
diff --git a/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
index 4575588b1ef..978c3d30dbd 100644
--- a/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
+++ b/mysql-test/suite/rpl/r/rpl_row_delayed_ins.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1(a int not null primary key) engine=myisam;
insert delayed into t1 values (1);
insert delayed into t1 values (2);
@@ -10,10 +11,12 @@ a
1
2
3
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
1
2
3
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop.result b/mysql-test/suite/rpl/r/rpl_row_drop.result
index 20dcaecabd3..8753764e81e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-**** On Master ****
+connection master;
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
CREATE TEMPORARY TABLE t2 (a int, b int);
@@ -8,34 +8,34 @@ SHOW TABLES;
Tables_in_test
t1
t2
-**** On Slave ****
+connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
-**** On Master ****
+connection master;
DROP TABLE t2;
SHOW TABLES;
Tables_in_test
t1
t2
-**** On Slave ****
+connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
-**** On Master ****
+connection master;
CREATE TEMPORARY TABLE t2 (a int, b int);
SHOW TABLES;
Tables_in_test
t1
t2
-**** On Slave ****
+connection slave;
SHOW TABLES;
Tables_in_test
t1
t2
-**** On Master ****
+connection master;
DROP TABLE t1,t2;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -48,7 +48,7 @@ master-bin.000001 # Query # # use `test`; DROP TABLE `t1` /* generated by server
SHOW TABLES;
Tables_in_test
t2
-**** On Slave ****
+connection slave;
SHOW TABLES;
Tables_in_test
t2
diff --git a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
index 05b2c04e7ba..d41ec925f00 100644
--- a/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_drop_create_temp_table.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
SET @commands= 'configure';
+connection master;
CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb;
CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam;
CREATE TABLE tt_error_1 ( id INT, PRIMARY KEY (id) ) ENGINE = Innodb;
@@ -54,6 +55,7 @@ SET @commands= '';
#########################################################################
# 1 - Tables dropped by "DROP TEMPORARY TABLE"
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1143,6 +1145,7 @@ master-bin.000001 # Query # # ROLLBACK
#########################################################################
# 2 - Tables dropped by "DROP TABLE"
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1474,6 +1477,7 @@ master-bin.000001 # Xid # # COMMIT /* XID */
#########################################################################
# 3 - CREATE TEMPORARY TABLE
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1675,6 +1679,7 @@ master-bin.000001 # Query # # COMMIT
#########################################################################
# 4 - CHANGING TEMPORARY TABLES
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1965,10 +1970,13 @@ master-bin.000001 # Query # # COMMIT
###################################################################################
# CHECK CONSISTENCY
###################################################################################
+connection master;
+connection slave;
#########################################################################
# CLEAN
#########################################################################
SET @commands= 'clean';
+connection master;
DROP TABLE IF EXISTS tt_xx_1;
DROP TABLE IF EXISTS nt_xx_1;
DROP TABLE IF EXISTS tt_error_1;
@@ -1985,5 +1993,6 @@ DROP TEMPORARY TABLE IF EXISTS tt_tmp_1;
DROP TEMPORARY TABLE IF EXISTS nt_tmp_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
+connection slave;
SET @commands= '';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row.result b/mysql-test/suite/rpl/r/rpl_row_find_row.result
index fff1f1b0c35..e9ce7e6e21b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_find_row.result
+++ b/mysql-test/suite/rpl/r/rpl_row_find_row.result
@@ -3,23 +3,38 @@ include/master-slave.inc
SET SQL_LOG_BIN=0;
CREATE TABLE t (a int, b int, c int, key(b));
SET SQL_LOG_BIN=1;
+connection slave;
CREATE TABLE t (a int, b int, c int);
+connection master;
INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
+connection slave;
+connection master;
DROP TABLE t;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t (a int, b int, c int, key(b));
+connection slave;
ALTER TABLE t DISABLE KEYS;
+connection master;
INSERT INTO t VALUES (1,2,4);
INSERT INTO t VALUES (4,3,4);
DELETE FROM t;
+connection slave;
+connection master;
DROP TABLE t;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 INT NOT NULL, c2 INT NOT NULL, c3 INT, UNIQUE KEY(c1,c3), KEY(c2));
INSERT INTO t1(c1,c2) VALUES(1,1);
INSERT INTO t1(c1,c2) VALUES(1,2);
UPDATE t1 SET c1=1000 WHERE c2=2;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
index 914e4af6732..9f925482db1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_row_find_row_debug.result
@@ -1,14 +1,19 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
SET GLOBAL log_warnings = 2;
SET GLOBAL debug_dbug="d,inject_long_find_row_note";
include/start_slave.inc
+connection master;
CREATE TABLE t1 (c1 INT);
+connection slave;
+connection master;
INSERT INTO t1 VALUES (1), (2);
UPDATE t1 SET c1= 1000 WHERE c1=2;
DELETE FROM t1;
DROP TABLE t1;
+connection slave;
# Check if any note related to long DELETE_ROWS and UPDATE_ROWS appears in the error log
Occurrences: update=1, delete=1
include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
index 27b23739831..660c736795b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result
@@ -15,11 +15,14 @@ master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
+connection slave;
select * from t3;
a
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
drop table t1;
+connection slave;
flush tables with read lock;
start slave;
include/wait_for_slave_param.inc [Slave_IO_Running]
@@ -27,5 +30,6 @@ include/wait_for_slave_sql_to_start.inc
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
+connection master;
drop table t3, t4, t5;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func001.result b/mysql-test/suite/rpl/r/rpl_row_func001.result
index 74a053abb26..ae05b5cf3c0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func001.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
create table test.t1 (a int, PRIMARY KEY(a));
@@ -18,10 +19,14 @@ select * from test.t1;
a
1
2
+connection slave;
+connection slave;
select * from test.t1;
a
1
2
+connection master;
DROP FUNCTION test.f1;
DROP TABLE test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func002.result b/mysql-test/suite/rpl/r/rpl_row_func002.result
index 69a732048b2..e8d92a94473 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func002.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP FUNCTION test.f1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -17,7 +18,10 @@ SET TIMESTAMP=1;
INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
SET TIMESTAMP=333300000;
INSERT INTO test.t2 VALUES (null,f1(),CURRENT_TIMESTAMP);
+connection slave;
+connection master;
DROP FUNCTION test.f1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_func003.result b/mysql-test/suite/rpl/r/rpl_row_func003.result
index cdc5bf6afba..f6bfc314dcf 100644
--- a/mysql-test/suite/rpl/r/rpl_row_func003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_func003.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
CALL mtr.add_suppression('Statement may not be safe to log in statement format.');
+connection master;
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;
@@ -22,6 +23,8 @@ START TRANSACTION;
INSERT INTO test.t1 VALUES (null,test.f1());
ROLLBACK;
SET AUTOCOMMIT=1;
+connection slave;
+connection master;
DROP FUNCTION test.f1;
DROP TABLE test.t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_idempotency.result b/mysql-test/suite/rpl/r/rpl_row_idempotency.result
index 2e94d35644b..96dbb090491 100644
--- a/mysql-test/suite/rpl/r/rpl_row_idempotency.result
+++ b/mysql-test/suite/rpl/r/rpl_row_idempotency.result
@@ -1,17 +1,22 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
call mtr.add_suppression("Can.t find record in .t[12].* error.* 1032");
call mtr.add_suppression("Cannot delete or update a parent row: a foreign key constraint fails .* error.* 1451");
call mtr.add_suppression("Cannot add or update a child row: a foreign key constraint fails .* error.* 1452");
call mtr.add_suppression("Duplicate entry .1. for key .PRIMARY.* error.* 1062");
+connection slave;
set @old_slave_exec_mode= @@global.slave_exec_mode;
set @@global.slave_exec_mode= IDEMPOTENT;
+connection master;
create table ti1 (b int primary key) engine = innodb;
create table ti2 (a int primary key, b int, foreign key (b) references ti1(b))
engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
+connection slave;
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
@@ -22,6 +27,7 @@ select * from ti2 order by b /* must be (1,1) (2,2) */;
a b
1 1
2 2
+connection master;
set @save_binlog_format= @@session.binlog_format;
set @@session.binlog_format= row;
delete from ti1 where b=1;
@@ -29,17 +35,21 @@ select * from ti1 order by b /* must be (2),(3) */;
b
2
3
+connection slave;
select * from ti1 order by b /* must stays as were on master (1),(2),(3) */;
b
1
2
3
delete from ti1 where b=3;
+connection master;
insert into ti2 set a=3, b=3;
+connection slave;
select * from ti2 order by b /* must be (1,1),(2,2) - not inserted */;
a b
1 1
2 2
+connection slave;
set global slave_exec_mode='IDEMPOTENT';
set global slave_exec_mode='STRICT';
set global slave_exec_mode='IDEMPOTENT,STRICT';
@@ -48,6 +58,7 @@ select @@global.slave_exec_mode /* must be STRICT */;
@@global.slave_exec_mode
STRICT
*** foreign keys errors as above now forces to stop
+connection master;
set foreign_key_checks=0;
drop table ti2, ti1;
create table ti1 (b int primary key) engine = innodb;
@@ -56,6 +67,7 @@ engine = innodb;
set foreign_key_checks=1 /* ensure the check */;
insert into ti1 values (1),(2),(3);
insert into ti2 set a=2, b=2;
+connection slave;
select * from ti1 order by b /* must be (1),(2),(3) */;
b
1
@@ -67,12 +79,14 @@ select * from ti2 order by b /* must be (1,1) (2,2) */;
a b
1 1
2 2
+connection master;
delete from ti1 where b=1 /* offending delete event */;
select * from ti1 order by b /* must be (2),(3) */;
b
2
3
*** slave must stop (Trying to delete a referenced foreing key)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1451
@@ -86,12 +100,18 @@ delete from ti2 where b=1;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
set global slave_exec_mode='STRICT';
+connection master;
+connection slave;
*** conspire the following insert failure
*** conspire future problem
delete from ti1 where b=3;
+connection master;
insert into ti2 set a=3, b=3 /* offending write event */;
*** slave must stop (Trying to insert an invalid foreign key)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1452
@@ -103,7 +123,11 @@ insert into ti1 set b=3;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
set global slave_exec_mode='STRICT';
+connection master;
+connection slave;
select * from ti2 order by b /* must be (2,2),(3,3) */;
a b
2 2
@@ -111,8 +135,10 @@ a b
*** other errors
*** conspiring query
insert into ti1 set b=1;
+connection master;
insert into ti1 set b=1 /* offending write event */;
*** slave must stop (Trying to insert a dupliacte key)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1062
@@ -121,48 +147,70 @@ delete from ti1 where b=1;
set foreign_key_checks= 1;
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
set global slave_exec_mode='STRICT';
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (-1),(-2),(-3);
INSERT INTO t2 VALUES (-1),(-2),(-3);
+connection slave;
DELETE FROM t1 WHERE a = -2;
DELETE FROM t2 WHERE a = -2;
+connection master;
DELETE FROM t1 WHERE a = -2;
*** slave must stop (Key was not found)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
set global slave_exec_mode='STRICT';
+connection master;
DELETE FROM t2 WHERE a = -2;
*** slave must stop (Key was not found)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
set global slave_exec_mode='STRICT';
UPDATE t1 SET a = 1 WHERE a = -1;
UPDATE t2 SET a = 1 WHERE a = -1;
+connection master;
UPDATE t1 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
set global slave_exec_mode='STRICT';
+connection master;
UPDATE t2 SET a = 1 WHERE a = -1;
*** slave must stop (Key was not found)
+connection slave;
include/wait_for_slave_sql_to_stop.inc
Last_SQL_Error
1032
set global slave_exec_mode='IDEMPOTENT';
start slave sql_thread;
+connection master;
+connection slave;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
+connection master;
drop table t1,t2,ti2,ti1;
+connection slave;
set @@global.slave_exec_mode= @old_slave_exec_mode;
*** end of tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
index e69358a5d29..546f42b61aa 100644
--- a/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_img_blobs.result
@@ -1,5 +1,10 @@
include/rpl_init.inc [topology=1->2->3]
+connection server_1;
+connection server_2;
+connection server_3;
+connection server_1;
CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'NOBLOB';
SET GLOBAL binlog_row_image= 'NOBLOB';
FLUSH TABLES;
@@ -7,6 +12,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image NOBLOB
CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'NOBLOB';
SET GLOBAL binlog_row_image= 'NOBLOB';
include/stop_slave.inc
@@ -16,6 +22,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image NOBLOB
CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'NOBLOB';
SET GLOBAL binlog_row_image= 'NOBLOB';
include/stop_slave.inc
@@ -24,1559 +31,2297 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image NOBLOB
+connection server_1;
### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
FLUSH TABLES;
@@ -1584,6 +2329,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
include/stop_slave.inc
@@ -1593,6 +2339,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
include/stop_slave.inc
@@ -1601,1559 +2348,2297 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
+connection server_1;
### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
FLUSH TABLES;
@@ -3161,6 +4646,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
include/stop_slave.inc
@@ -3170,6 +4656,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
include/stop_slave.inc
@@ -3178,1556 +4665,2293 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
+connection server_1;
### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check when there is no key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the AI (they are not updated)
### will not break replication (check even if there is a key in the table)
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (UK NOT NULL exists in the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 blob NOT NULL, c3 int, unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that updates without blobs in the BI (PK exists int the table)
### will not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob in a key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a unique (not null) key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob NOT NULL, c3 int, unique key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
### Asserts that declaring a blob as part of a primary key does not break replication
+connection server_1;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 blob, c3 int, primary key(c2(512))) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, "a", 10);
INSERT INTO t VALUES (2, "b", 20);
INSERT INTO t VALUES (3, "c", 30);
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c1=10 WHERE c2="a";
UPDATE t SET c1=20 WHERE c1=2;
UPDATE t SET c1=30 WHERE c3=30;
UPDATE t SET c3=40 WHERE c1=30;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c2="a";
DELETE FROM t WHERE c1=20;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result
index ba01221d3b6..965f74a5b94 100644
--- a/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result
+++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_min.result
@@ -1,5 +1,10 @@
include/rpl_init.inc [topology=1->2->3]
+connection server_1;
+connection server_2;
+connection server_3;
+connection server_1;
CON: 'server_1', IMG: 'MINIMAL', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
FLUSH TABLES;
@@ -7,6 +12,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
CON: 'server_2', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
include/stop_slave.inc
@@ -16,6 +22,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
CON: 'server_3', IMG: 'MINIMAL', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'MINIMAL';
SET GLOBAL binlog_row_image= 'MINIMAL';
include/stop_slave.inc
@@ -24,17 +31,29 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image MINIMAL
+connection server_1;
### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -42,6 +61,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -54,23 +74,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -78,6 +110,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -90,23 +123,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -114,6 +159,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -126,23 +172,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -150,6 +208,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -162,23 +221,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -186,6 +257,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -198,23 +270,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -222,6 +306,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -234,23 +319,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -258,6 +355,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -270,23 +368,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -294,6 +404,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -306,23 +417,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -330,6 +453,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -342,23 +466,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -366,6 +502,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -378,23 +515,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -402,6 +551,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -414,23 +564,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -438,6 +600,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -450,24 +613,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -475,6 +651,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -487,23 +664,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -511,6 +700,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -523,23 +713,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -547,6 +749,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -559,23 +762,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -583,6 +798,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -595,23 +811,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -619,6 +847,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -631,23 +860,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -655,6 +896,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -667,23 +909,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -691,6 +945,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -703,23 +958,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -727,6 +994,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -739,23 +1007,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -763,6 +1043,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -775,23 +1056,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -799,6 +1092,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -811,23 +1105,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -835,6 +1141,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -847,23 +1154,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -871,6 +1190,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -883,24 +1203,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -908,6 +1241,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -920,23 +1254,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -944,6 +1290,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -956,23 +1303,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -980,6 +1339,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -992,23 +1352,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1016,6 +1388,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1028,23 +1401,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1052,6 +1437,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1064,23 +1450,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1088,6 +1486,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1100,23 +1499,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1124,6 +1535,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1136,23 +1548,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1160,6 +1584,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1172,23 +1597,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1196,6 +1633,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1208,23 +1646,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1232,6 +1682,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1244,23 +1695,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1268,6 +1731,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1280,23 +1744,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1304,6 +1780,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1316,24 +1793,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1341,6 +1831,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1353,23 +1844,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1377,6 +1880,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1389,23 +1893,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1413,6 +1929,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1425,23 +1942,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1449,6 +1978,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1461,23 +1991,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1485,6 +2027,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1497,23 +2040,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1521,6 +2076,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1533,23 +2089,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1557,6 +2125,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1569,23 +2138,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1593,6 +2174,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1605,23 +2187,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1629,6 +2223,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1641,23 +2236,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1665,6 +2272,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1677,23 +2285,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1701,6 +2321,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1713,23 +2334,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1737,6 +2370,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1749,24 +2383,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1774,6 +2421,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1786,23 +2434,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1810,6 +2470,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1822,23 +2483,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1846,6 +2519,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1858,23 +2532,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1882,6 +2568,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1894,23 +2581,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1918,6 +2617,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1930,23 +2630,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1954,6 +2666,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1966,23 +2679,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1990,6 +2715,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2002,23 +2728,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2026,6 +2764,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2038,23 +2777,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2062,6 +2813,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2074,23 +2826,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2098,6 +2862,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2110,23 +2875,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2134,6 +2911,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2146,23 +2924,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2170,6 +2960,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2182,24 +2973,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2207,6 +3011,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2219,23 +3024,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2243,6 +3060,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2255,23 +3073,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2279,6 +3109,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2291,23 +3122,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2315,6 +3158,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2327,23 +3171,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2351,6 +3207,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2363,23 +3220,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2387,6 +3256,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2399,23 +3269,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2423,6 +3305,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2435,23 +3318,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2459,6 +3354,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2471,23 +3367,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2495,6 +3403,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2507,23 +3416,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2531,6 +3452,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2543,23 +3465,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2567,6 +3501,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2579,23 +3514,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2603,6 +3550,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2615,24 +3563,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2640,6 +3601,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2652,23 +3614,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2676,6 +3650,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2688,23 +3663,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2712,6 +3699,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2724,23 +3712,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2748,6 +3748,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2760,23 +3761,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2784,6 +3797,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2796,23 +3810,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2820,6 +3846,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2832,23 +3859,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2856,6 +3895,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2868,23 +3908,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2892,6 +3944,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2904,23 +3957,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2928,6 +3993,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2940,23 +4006,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2964,6 +4042,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2976,23 +4055,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3000,6 +4091,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3012,23 +4104,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3036,6 +4140,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3048,24 +4153,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3073,6 +4191,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3085,23 +4204,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3109,6 +4240,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3121,23 +4253,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3145,6 +4289,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3157,23 +4302,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3181,6 +4338,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3193,23 +4351,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3217,6 +4387,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3229,23 +4400,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3253,6 +4436,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3265,23 +4449,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3289,6 +4485,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3301,23 +4498,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3325,6 +4534,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3337,23 +4547,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3361,6 +4583,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3373,23 +4596,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3397,6 +4632,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3409,23 +4645,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3433,6 +4681,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3445,23 +4694,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3469,6 +4730,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3481,14 +4743,17 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
FLUSH TABLES;
@@ -3496,6 +4761,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
include/stop_slave.inc
@@ -3505,6 +4771,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
include/stop_slave.inc
@@ -3513,4 +4780,5 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
+connection server_1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result b/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result
index 16152f28c27..6a9eb40226a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result
+++ b/mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result
@@ -1,5 +1,10 @@
include/rpl_init.inc [topology=1->2->3]
+connection server_1;
+connection server_2;
+connection server_3;
+connection server_1;
CON: 'server_1', IMG: 'NOBLOB', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'NOBLOB';
SET GLOBAL binlog_row_image= 'NOBLOB';
FLUSH TABLES;
@@ -7,6 +12,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image NOBLOB
CON: 'server_2', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'NOBLOB';
SET GLOBAL binlog_row_image= 'NOBLOB';
include/stop_slave.inc
@@ -16,6 +22,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image NOBLOB
CON: 'server_3', IMG: 'NOBLOB', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'NOBLOB';
SET GLOBAL binlog_row_image= 'NOBLOB';
include/stop_slave.inc
@@ -24,17 +31,29 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image NOBLOB
+connection server_1;
### engines: MyISAM, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -42,6 +61,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -54,23 +74,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -78,6 +110,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -90,23 +123,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -114,6 +159,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -126,23 +172,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -150,6 +208,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -162,23 +221,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -186,6 +257,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -198,23 +270,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -222,6 +306,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -234,23 +319,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -258,6 +355,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -270,23 +368,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -294,6 +404,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -306,23 +417,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -330,6 +453,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -342,23 +466,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -366,6 +502,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -378,23 +515,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -402,6 +551,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -414,23 +564,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -438,6 +600,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -450,24 +613,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -475,6 +651,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -487,23 +664,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -511,6 +700,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -523,23 +713,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -547,6 +749,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -559,23 +762,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -583,6 +798,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -595,23 +811,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -619,6 +847,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -631,23 +860,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -655,6 +896,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -667,23 +909,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -691,6 +945,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -703,23 +958,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -727,6 +994,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -739,23 +1007,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -763,6 +1043,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -775,23 +1056,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -799,6 +1092,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -811,23 +1105,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -835,6 +1141,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -847,23 +1154,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -871,6 +1190,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -883,24 +1203,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -908,6 +1241,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -920,23 +1254,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -944,6 +1290,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -956,23 +1303,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -980,6 +1339,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -992,23 +1352,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1016,6 +1388,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1028,23 +1401,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1052,6 +1437,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1064,23 +1450,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1088,6 +1486,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1100,23 +1499,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1124,6 +1535,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1136,23 +1548,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1160,6 +1584,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1172,23 +1597,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1196,6 +1633,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1208,23 +1646,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1232,6 +1682,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1244,23 +1695,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1268,6 +1731,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1280,23 +1744,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1304,6 +1780,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1316,24 +1793,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: MyISAM, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1341,6 +1831,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1353,23 +1844,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1377,6 +1880,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1389,23 +1893,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1413,6 +1929,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1425,23 +1942,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1449,6 +1978,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1461,23 +1991,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1485,6 +2027,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1497,23 +2040,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1521,6 +2076,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1533,23 +2089,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1557,6 +2125,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1569,23 +2138,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1593,6 +2174,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1605,23 +2187,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1629,6 +2223,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1641,23 +2236,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1665,6 +2272,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1677,23 +2285,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1701,6 +2321,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1713,23 +2334,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1737,6 +2370,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1749,24 +2383,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1774,6 +2421,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1786,23 +2434,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1810,6 +2470,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1822,23 +2483,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1846,6 +2519,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1858,23 +2532,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1882,6 +2568,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1894,23 +2581,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1918,6 +2617,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1930,23 +2630,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1954,6 +2666,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -1966,23 +2679,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -1990,6 +2715,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2002,23 +2728,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2026,6 +2764,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2038,23 +2777,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2062,6 +2813,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2074,23 +2826,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2098,6 +2862,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2110,23 +2875,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2134,6 +2911,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2146,23 +2924,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2170,6 +2960,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2182,24 +2973,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, MyISAM, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2207,6 +3011,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2219,23 +3024,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2243,6 +3060,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2255,23 +3073,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2279,6 +3109,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2291,23 +3122,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2315,6 +3158,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2327,23 +3171,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2351,6 +3207,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2363,23 +3220,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2387,6 +3256,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2399,23 +3269,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2423,6 +3305,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2435,23 +3318,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2459,6 +3354,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2471,23 +3367,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2495,6 +3403,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2507,23 +3416,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2531,6 +3452,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2543,23 +3465,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2567,6 +3501,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2579,23 +3514,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2603,6 +3550,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2615,24 +3563,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, MyISAM
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2640,6 +3601,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2652,23 +3614,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2676,6 +3650,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2688,23 +3663,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2712,6 +3699,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2724,23 +3712,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2748,6 +3748,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2760,23 +3761,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2784,6 +3797,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2796,23 +3810,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2820,6 +3846,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2832,23 +3859,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2856,6 +3895,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2868,23 +3908,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2892,6 +3944,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2904,23 +3957,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2928,6 +3993,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2940,23 +4006,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -2964,6 +4042,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -2976,23 +4055,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3000,6 +4091,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3012,23 +4104,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= MyISAM;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3036,6 +4140,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3048,24 +4153,37 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
### engines: InnoDB, InnoDB, InnoDB
+connection server_1;
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes in master, but NULLABLE on first slave
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3073,6 +4191,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3085,23 +4204,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite NOT NULL Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int NOT NULL, c2 char(1), c3 char(1) NOT NULL, c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3109,6 +4240,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3121,23 +4253,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3145,6 +4289,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3157,23 +4302,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3181,6 +4338,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3193,23 +4351,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key with holes
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c3)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3217,6 +4387,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3229,23 +4400,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Primary Key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3253,6 +4436,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3265,23 +4449,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Primary key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), primary key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3289,6 +4485,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3301,23 +4498,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3325,6 +4534,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3337,23 +4547,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Unique key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), unique key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3361,6 +4583,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3373,23 +4596,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
****** TEST: One Composite key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1,c2)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3397,6 +4632,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3409,23 +4645,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: One key
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1), key(c1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3433,6 +4681,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3445,23 +4694,35 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
+connection server_1;
SET SQL_LOG_BIN=0;
+connection server_2;
SET SQL_LOG_BIN=0;
+connection server_3;
SET SQL_LOG_BIN=0;
******* TEST: No keys
+connection server_1;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_2;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_3;
CREATE TABLE t (c1 int, c2 char(1), c3 char(1), c4 char(1)) engine= InnoDB;;
+connection server_1;
SET SQL_LOG_BIN=1;
+connection server_2;
SET SQL_LOG_BIN=1;
+connection server_3;
SET SQL_LOG_BIN=1;
+connection server_1;
INSERT INTO t VALUES (1, '1', '1', '1' );
INSERT INTO t VALUES (4, '4', '4', '4' );
INSERT INTO t VALUES (7, '7', '7', '7' );
@@ -3469,6 +4730,7 @@ INSERT INTO t VALUES (9, '9', '9', NULL );
INSERT INTO t VALUES (2, '1', '2', '2' );
INSERT INTO t VALUES (3, '1', '3', '2' );
include/rpl_sync.inc
+connection server_1;
UPDATE t SET c4 = '7';
UPDATE t SET c4 = '5' WHERE c1 = 1;
UPDATE t SET c2 = '5' WHERE c1 = 1;
@@ -3481,14 +4743,17 @@ UPDATE t SET c2 = '0' WHERE c4 = '0';
UPDATE t SET c2 = '2' WHERE c4 = '2';
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DELETE FROM t WHERE c1 = 7;
DELETE FROM t WHERE c1 = 8;
DELETE FROM t;
include/rpl_sync.inc
include/diff_tables.inc [server_1:test.t, server_2:test.t, server_3:test.t]
+connection server_1;
DROP TABLE t;
include/rpl_sync.inc
CON: 'server_1', IMG: 'FULL', RESTART SLAVE: 'N'
+connection server_1;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
FLUSH TABLES;
@@ -3496,6 +4761,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
CON: 'server_2', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_2;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
include/stop_slave.inc
@@ -3505,6 +4771,7 @@ SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
CON: 'server_3', IMG: 'FULL', RESTART SLAVE: 'Y'
+connection server_3;
SET SESSION binlog_row_image= 'FULL';
SET GLOBAL binlog_row_image= 'FULL';
include/stop_slave.inc
@@ -3513,4 +4780,5 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
+connection server_1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
index 95167311c3f..1e302e02ccc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_implicit_commit_binlog.result
@@ -4,6 +4,7 @@ set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
#########################################################################
+connection master;
CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb;
CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb;
CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;
diff --git a/mysql-test/suite/rpl/r/rpl_row_index_choice.result b/mysql-test/suite/rpl/r/rpl_row_index_choice.result
index a1d3c2d2c93..33177cb799e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_index_choice.result
+++ b/mysql-test/suite/rpl/r/rpl_row_index_choice.result
@@ -1,13 +1,18 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1 (a int, b varchar(100), fulltext(b)) engine=MyISAM;
INSERT INTO t1 VALUES (1,"a"), (2,"b");
UPDATE t1 SET b='A' WHERE a=1;
DELETE FROM t1 WHERE a=2;
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 A
+connection master;
DROP TABLE t1;
+connection master;
CREATE TABLE t1 (d INT PRIMARY KEY) ENGINE=myisam;
INSERT INTO t1 VALUES (0);
INSERT INTO t1 SELECT d+1 FROM t1;
@@ -25,116 +30,164 @@ KEY wrong_key(a),
KEY expected_key(b,c),
KEY wrong_key2(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
+connection slave;
+connection slave;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT, b INT, c INT, d INT NOT NULL, e INT,
UNIQUE wrong_key3(a,e),
KEY wrong_key4(b,c),
UNIQUE expected_key(d)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, NULL FROM t1;
+connection slave;
+connection slave;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d e
4 1 5 10042 NULL
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL,
KEY wrong_key5(b),
UNIQUE expected_key(d),
KEY wrong_key6(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
+connection slave;
+connection slave;
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT NOT NULL,
KEY expected_key(b),
KEY wrong_key7(d),
KEY wrong_key8(c)) ENGINE=myisam;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
+connection slave;
+connection slave;
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT,
UNIQUE wrong_key9(d),
KEY wrong_key10(a),
PRIMARY KEY expected_key(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d FROM t1;
+connection slave;
+connection slave;
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan,slave_crash_if_index_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d
4 1 5 10042
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, e INT,
UNIQUE wrong_key11(e),
KEY wrong_key12(a),
KEY expected_key(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, IF(d<10, d, NULL) FROM t1;
+connection slave;
+connection slave;
ANALYZE TABLE t2;
Table Op Msg_type Msg_text
test.t2 analyze status OK
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d e
4 1 5 10042 NULL
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, b INT NOT NULL, c INT NOT NULL, d INT, e INT,
KEY wrong_key13(a),
UNIQUE expected_key(e),
KEY wrong_key14(c,b)) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d MOD 41, d MOD 37, d, IF(d<10, d, NULL) FROM t1;
+connection slave;
+connection slave;
# Slave will crash if using the wrong or no index
SET GLOBAL debug_dbug="+d,slave_crash_if_wrong_index,slave_crash_if_table_scan";
+connection master;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
SELECT * FROM t2 WHERE d IN (10042,53);
a b c d e
4 1 5 10042 NULL
+connection master;
DROP TABLE t2;
CREATE TABLE t2 (a INT NOT NULL, d INT) ENGINE=innodb;
INSERT INTO t2 SELECT d DIV 10, d FROM t1;
UPDATE t2 SET d=10042 WHERE d=42;
DELETE FROM t2 WHERE d=53;
+connection slave;
+connection slave;
SELECT * FROM t2 WHERE d IN (10042,53);
a d
4 10042
+connection master;
DROP TABLE t2;
+connection master;
DROP TABLE t1;
+connection slave;
+connection slave;
SET GLOBAL debug_dbug="";
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
index 354b7555034..49d7684ff4a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
+++ b/mysql-test/suite/rpl/r/rpl_row_inexist_tbl.result
@@ -1,20 +1,19 @@
include/master-slave.inc
[connection master]
==== Setup table on master but not on slave ====
-[on master]
CREATE TABLE t1 (a INT);
-[on slave]
+connection slave;
DROP TABLE t1;
==== Modify table on master ====
-[on master]
+connection master;
INSERT INTO t1 VALUES (1);
==== Verify error on slave ====
-[on slave]
+connection slave;
call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1. doesn.t exist., error.* 1146");
include/wait_for_slave_sql_error.inc [errno=1146]
==== Clean up ====
include/stop_slave_io.inc
RESET SLAVE;
-[on master]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
index d6d4b5ad8fc..6c02d361058 100644
--- a/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_row_loaddata_concurrent.result
@@ -28,6 +28,7 @@ create temporary table t2 (day date,id int(9),category enum('a','b','c'),name va
load data CONCURRENT 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;
+connection slave;
select * from t1;
a b
1 10
@@ -37,20 +38,26 @@ day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
2003-03-22 2416 a bbbbb
+connection master;
drop table t1;
drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
+connection slave;
insert into t1 values(1,10);
+connection master;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062");
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0");
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
include/check_slave_no_error.inc
+connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
include/stop_slave_io.inc
change master to master_user='test';
@@ -58,14 +65,17 @@ change master to master_user='root';
include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
+connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
include/check_slave_no_error.inc
+connection master;
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -77,23 +87,28 @@ select * from t2;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
+connection slave;
start slave;
select * from t2;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
alter table t2 drop key day;
+connection master;
delete from t2;
load data CONCURRENT 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;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
+connection slave;
+connection master;
drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
DROP TABLE t1;
include/rpl_reset.inc
+connection master;
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -109,15 +124,21 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO
### assertion: works without fully qualified name on current database
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
### create connection without default database
-### connect (conn2,localhost,root,,*NO-ONE*);
+connect conn2,localhost,root,,*NO-ONE*;
+connection conn2;
### assertion: works without stating the default database
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
-### disconnect and switch back to master connection
+disconnect conn2;
+connection master;
+connection slave;
use b48297_db1;
include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
+connection master;
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
+connection slave;
include/rpl_reset.inc
+connection master;
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -128,5 +149,7 @@ Field 1 'Field 2'
Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
+connection slave;
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_log.result b/mysql-test/suite/rpl/r/rpl_row_log.result
index 83ec26486e0..f743e0aeb4b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection slave;
set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode;
set @@global.slave_ddl_exec_mode=STRICT;
+connection master;
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
@@ -49,6 +52,7 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
flush logs;
create table t3 (a int)ENGINE=MyISAM;
+connection master;
select * from t1 order by 1 asc;
word
Aarhus
@@ -120,6 +124,7 @@ Aberdeen
Abernathy
aberrant
aberration
+connection slave;
select * from t1 order by 1 asc;
word
Aarhus
@@ -194,6 +199,7 @@ aberration
flush logs;
include/stop_slave.inc
include/start_slave.inc
+connection master;
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
include/show_binlog_events.inc
@@ -228,6 +234,7 @@ show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
+connection slave;
show binary logs;
Log_name File_size
slave-bin.000001 #
@@ -263,10 +270,12 @@ slave-bin.000002 # Query # # COMMIT
include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
include/rpl_reset.inc
+connection master;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -289,5 +298,7 @@ a b
5 1
6 1
drop table t1;
+connection slave;
set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
index 3b9733a18e8..c7598f072d9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_log_innodb.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection slave;
set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode;
set @@global.slave_ddl_exec_mode=STRICT;
+connection master;
create table t1(n int not null auto_increment primary key)ENGINE=InnoDB;
insert into t1 values (NULL);
drop table t1;
@@ -49,6 +52,7 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
flush logs;
create table t3 (a int)ENGINE=InnoDB;
+connection master;
select * from t1 order by 1 asc;
word
Aarhus
@@ -120,6 +124,7 @@ Aberdeen
Abernathy
aberrant
aberration
+connection slave;
select * from t1 order by 1 asc;
word
Aarhus
@@ -194,6 +199,7 @@ aberration
flush logs;
include/stop_slave.inc
include/start_slave.inc
+connection master;
create table t2 (n int)ENGINE=InnoDB;
insert into t2 values (1);
include/show_binlog_events.inc
@@ -228,6 +234,7 @@ show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
+connection slave;
show binary logs;
Log_name File_size
slave-bin.000001 #
@@ -263,10 +270,12 @@ slave-bin.000002 # Xid # # COMMIT /* XID */
include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
include/rpl_reset.inc
+connection master;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -289,5 +298,7 @@ a b
5 1
6 1
drop table t1;
+connection slave;
set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
index 88d68bb50ee..41d18d7f9fe 100644
--- a/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_row_max_relay_size.result
@@ -1,11 +1,14 @@
include/master-slave.inc
[connection master]
+connection slave;
stop slave;
+connection master;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
+connection slave;
reset slave;
#
# Test 1
@@ -54,18 +57,24 @@ flush logs;
reset slave;
start slave;
flush logs;
+connection master;
create table t1 (a int);
+connection slave;
include/check_slave_is_running.inc
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
+connection master;
drop table t1;
+connection slave;
include/check_slave_is_running.inc
+connection master;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
+connection slave;
set global max_binlog_size= @my_max_binlog_size;
set global max_relay_log_size= @my_max_relay_log_size;
#
diff --git a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
index c61167e84e0..8039527b099 100644
--- a/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
+++ b/mysql-test/suite/rpl/r/rpl_row_merge_engine.result
@@ -1,16 +1,22 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1 (a int) ENGINE=MyISAM;
CREATE TABLE t2 (a int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1), (2), (3);
INSERT INTO t2 VALUES (4), (5), (6);
CREATE TABLE IF NOT EXISTS t1_merge LIKE t1;
ALTER TABLE t1_merge ENGINE=MERGE UNION (t2, t1);
+connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
+connection master;
UPDATE t1_merge SET a=10 WHERE a=1;
DELETE FROM t1_merge WHERE a=10;
+connection slave;
+connection master;
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
DROP TABLE t1_merge, t1, t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
index 7831919c8b6..775ae83c618 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mixing_engines.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
rpl_mixing_engines.inc [commands=configure]
+connection master;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -109,6 +110,7 @@ END|
#########################################################################
# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
#########################################################################
+connection master;
@@ -15464,4 +15466,5 @@ DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
index 1489af830cc..ad99ec5f630 100644
--- a/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
+++ b/mysql-test/suite/rpl/r/rpl_row_mysqlbinlog.result
@@ -4,6 +4,7 @@ include/master-slave.inc
---Setup Section --
set timestamp=1000000000;
DROP TABLE IF EXISTS t1,t2,t3;
+connection master;
CREATE TABLE t1(word VARCHAR(20));
CREATE TABLE t2(id INT AUTO_INCREMENT NOT NULL PRIMARY KEY);
CREATE TABLE t3(c1 INT NOT NULL PRIMARY KEY, c2 LONGBLOB, c3 TIMESTAMP, c4 TEXT, c5 FLOAT);
@@ -39,6 +40,7 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
+connection slave;
SELECT COUNT(*) from t1;
COUNT(*)
351
@@ -69,6 +71,7 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
+connection master;
insert into t1 values ("Alas");
flush logs;
@@ -78,12 +81,16 @@ flush logs;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
reset master;
+connection slave;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
--- Test 1 Load from Dump binlog file --
@@ -118,6 +125,7 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
+connection slave;
SELECT COUNT(*) from t1;
COUNT(*)
352
@@ -148,6 +156,7 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
+connection master;
--- Test 2 position test --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
@@ -210,12 +219,16 @@ ROLLBACK /* added by mysqlbinlog */;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
reset master;
+connection slave;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
SELECT COUNT(*) from t1;
COUNT(*)
352
@@ -246,6 +259,7 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
+connection slave;
SELECT COUNT(*) from t1;
COUNT(*)
352
@@ -276,6 +290,7 @@ c1 c3 c4 c5
3 2006-02-22 00:00:00 Tested in Texas 6.6
4 2006-02-22 00:00:00 Tested in Texas 8.8
5 2006-02-22 00:00:00 Tested in Texas 11
+connection master;
--- Test 5 LOAD DATA --
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
@@ -346,12 +361,16 @@ ROLLBACK /* added by mysqlbinlog */;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
--- Test 8 switch internal charset --
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
reset master;
+connection slave;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
create table t4 (f text character set utf8);
create table t5 (f text character set cp932);
flush logs;
@@ -368,6 +387,7 @@ HEX(f)
select HEX(f) from t5;
HEX(f)
835C
+connection slave;
select HEX(f) from t04;
HEX(f)
E382BD
@@ -382,6 +402,9 @@ HEX(f)
835C
--- Test cleanup --
+connection master;
+connection slave;
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT NOT NULL KEY, b INT);
INSERT INTO t1 VALUES(1,1);
@@ -390,4 +413,5 @@ a b
1 1
FLUSH LOGS;
DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
index d9ebb52493b..ef40fd311d3 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_innodb.result
@@ -2,27 +2,39 @@ include/master-slave.inc
[connection master]
## case #1 - last_null_bit_pos==0 in record_compare without X bit
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #2 - X bit is wrongly set.
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=InnoDB DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
index 1ec98a81a8b..84d68bb2b58 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rec_comp_myisam.result
@@ -3,35 +3,51 @@ include/master-slave.inc
## coverage purposes - Field_bits
## 1 X bit + 2 Null bits + 5 bits => last_null_bit_pos==0
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bit(5)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1(c1,c2) VALUES (10, b'1');
INSERT INTO t1(c1,c2) VALUES (NULL, b'1');
UPDATE t1 SET c1= 0;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #1 - last_null_bit_pos==0 in record_compare without X bit
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #2 - X bit is wrongly set.
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=MyISAM DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
index 33284ce58c6..b9e98d5a97d 100644
--- a/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_row_reset_slave.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
Master_User = 'root'
Master_Host = '127.0.0.1'
include/stop_slave.inc
@@ -16,14 +17,18 @@ Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
+connection master;
create temporary table t1 (a int);
+connection slave;
include/stop_slave.inc
reset slave;
include/start_slave.inc
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connection master;
drop temporary table if exists t1;
+connection slave;
include/stop_slave.inc
reset slave;
include/check_slave_no_error.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result b/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result
index bf7ced0dd89..65203f32167 100644
--- a/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result
+++ b/mysql-test/suite/rpl/r/rpl_row_rollback_to_savepoint.result
@@ -52,7 +52,8 @@ master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-[connection master]
+connection slave;
+connection master;
DROP TRIGGER tr1;
DELETE FROM t1;
DELETE FROM t2;
@@ -150,14 +151,15 @@ master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Table_map # # table_id: # (test.t3)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-[connection master]
+connection slave;
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP PROCEDURE p1;
# Test case 3:
include/rpl_reset.inc
-[connection master]
+connection master;
CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB;
CREATE TRIGGER t_insert_trig AFTER INSERT ON t FOR EACH ROW
BEGIN
@@ -195,11 +197,11 @@ SELECT * FROM t;
f1
2
3
-[connection master]
+connection master;
DROP TABLE t;
# Test case 4:
include/rpl_reset.inc
-[connection master]
+connection master;
CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
CREATE TRIGGER t_insert_trig BEFORE INSERT ON t FOR EACH ROW
@@ -255,12 +257,12 @@ f1
5
5
30
-[connection master]
+connection master;
DROP TABLE t;
DROP TABLE t1;
# Test case 5:
include/rpl_reset.inc
-[connection master]
+connection master;
CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
CREATE TRIGGER t_insert_trig BEFORE INSERT ON t
@@ -308,12 +310,12 @@ f1
SELECT * FROM t1;
f1
30
-[connection master]
+connection master;
DROP TABLE t;
DROP TABLE t1;
# Test case 6:
include/rpl_reset.inc
-[connection master]
+connection master;
CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
CREATE FUNCTION f1() RETURNS INT
@@ -354,7 +356,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-[connection master]
+connection master;
SELECT * FROM t2;
f1
1
@@ -374,13 +376,13 @@ f1
10
SELECT * FROM t1;
f1
-[connection master]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP FUNCTION f1;
# Test case 7:
include/rpl_reset.inc
-[connection master]
+connection master;
CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
CREATE FUNCTION f1() RETURNS INT
@@ -420,7 +422,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t2)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-[connection master]
+connection master;
SELECT * FROM t2;
f1
1
@@ -442,13 +444,13 @@ f1
SELECT * FROM t1;
f1
1
-[connection master]
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP FUNCTION f1;
# Test case 8:
include/rpl_reset.inc
-[connection master]
+connection master;
CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
CREATE FUNCTION f1() RETURNS INT
BEGIN
@@ -480,7 +482,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
-[connection master]
+connection master;
SELECT * FROM t1;
f1
1
@@ -496,7 +498,7 @@ f1
2
4
10
-[connection master]
+connection master;
DROP TABLE t1;
DROP FUNCTION f1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
index a132b50a471..800a3f41f45 100644
--- a/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_row_show_relaylog_events.result
@@ -1,6 +1,8 @@
include/master-slave.inc
[connection master]
+connection master;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
@@ -50,6 +52,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
+connection slave;
******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -132,6 +135,7 @@ include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=POS
FLUSH LOGS;
+connection master;
FLUSH LOGS;
DROP TABLE t1;
******** [master] SHOW BINLOG EVENTS IN <FILE> ********
@@ -167,6 +171,7 @@ master-bin.000001 # Table_map # # table_id: # (test.t1)
master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
+connection slave;
******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp001.result b/mysql-test/suite/rpl/r/rpl_row_sp001.result
index 17117ce2fac..d37425c43a8 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp001.result
@@ -30,12 +30,14 @@ a t
2 NEW
3 NEW
4 NEW
+connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 NEW
2 NEW
3 NEW
4 NEW
+connection master;
call test.p2(1);
SELECT * FROM t2 ORDER BY a;
a t
@@ -43,12 +45,14 @@ a t
2 Tex
3 Tex
4 Tex
+connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 Tex
2 Tex
3 Tex
4 Tex
+connection master;
call test.p2(2);
SELECT * FROM t2 ORDER BY a;
a t
@@ -56,12 +60,14 @@ a t
2 SQL
3 SQL
4 SQL
+connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 SQL
2 SQL
3 SQL
4 SQL
+connection master;
call test.p2(3);
SELECT * FROM t2 ORDER BY a;
a t
@@ -69,14 +75,17 @@ a t
2 NONE
3 NONE
4 NONE
+connection slave;
SELECT * FROM t2 ORDER BY a;
a t
1 NONE
2 NONE
3 NONE
4 NONE
+connection master;
DROP PROCEDURE test.p1;
DROP PROCEDURE test.p2;
DROP TABLE test.t1;
DROP TABLE test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
index f368cf6e356..2531076f529 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp002_innodb.result
@@ -43,6 +43,7 @@ a f
< -- test 1 select slave after p1 -- >
--------------------------------------
+connection slave;
SELECT * FROM test.t1;
a t
1 texas
@@ -62,6 +63,7 @@ a f
< -- test 1 call p2 & select master -- >
----------------------------------------
+connection master;
call test.p2(4);
SELECT * FROM test.t1;
a t
@@ -76,6 +78,7 @@ a f
< -- test 1 select slave after p2 -- >
--------------------------------------
+connection slave;
SELECT * FROM test.t1;
a t
4 to
@@ -86,6 +89,7 @@ a f
4 4
5 5
6 6
+connection master;
< -- End test 1 Begin test 2 -- >
---------------------------------
@@ -134,6 +138,7 @@ a f
< -- test 2 select Slave after p1 -- >
--------------------------------------
+connection slave;
SELECT * FROM test.t1;
a t
1 texas
@@ -153,6 +158,7 @@ a f
< -- test 2 call p2 & select Master -- >
----------------------------------------
+connection master;
CALL test.p2(2);
CALL test.p2(4);
CALL test.p2(6);
@@ -175,6 +181,7 @@ a f
< -- test 1 select Slave after p2 -- >
--------------------------------------
+connection slave;
SELECT * FROM test.t1;
a t
1 texas
@@ -191,6 +198,7 @@ a f
20 6
40 6
60 6
+connection master;
< -- End test 2 Begin test 3 -- >
---------------------------------
@@ -209,16 +217,20 @@ START TRANSACTION;
ROLLBACK;
select * from test.t3;
a t
+connection slave;
select * from test.t3;
a t
+connection master;
START TRANSACTION;
COMMIT;
select * from test.t3;
a t
98 NONE
+connection slave;
select * from test.t3;
a t
98 NONE
+connection master;
SET AUTOCOMMIT=1;
SET FOREIGN_KEY_CHECKS=0;
DROP PROCEDURE test.p3;
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp003.result b/mysql-test/suite/rpl/r/rpl_row_sp003.result
index 42acf21c836..8eab5520b7b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp003.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
@@ -17,22 +18,29 @@ END|
SELECT get_lock("test", 200);
get_lock("test", 200)
1
+connection master1;
CALL test.p1();
+connection master;
CALL test.p2();
SELECT release_lock("test");
release_lock("test")
1
+connection master1;
get_lock("test", 100)
1
SELECT release_lock("test");
release_lock("test")
1
+connection master;
SELECT * FROM test.t1;
a
5
+connection slave;
+connection slave;
SELECT * FROM test.t1;
a
5
+connection master;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1(a INT,PRIMARY KEY(a))ENGINE=INNODB;
CALL test.p2();
@@ -45,10 +53,14 @@ release_lock("test")
SELECT * FROM test.t1;
a
8
+connection slave;
+connection slave;
SELECT * FROM test.t1;
a
8
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp005.result b/mysql-test/suite/rpl/r/rpl_row_sp005.result
index df877233e94..8acc2e20202 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp005.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp005.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@@ -38,9 +39,6 @@ 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 ORDER BY id;
id data
@@ -54,9 +52,7 @@ id2
2
3
4
-
-< ---- Slave selects-- >
-------------------------
+connection slave;
SELECT * FROM test.t1 ORDER BY id;
id data
8 MySQL
@@ -69,9 +65,7 @@ id2
2
3
4
-
-< ---- Master selects-- >
--------------------------
+connection master;
CALL test.p1();
SELECT * FROM test.t3 ORDER BY id3;
id3 c
@@ -79,19 +73,20 @@ id3 c
2 kyle
3 Texas
4 ROCKS
-
-< ---- Slave selects-- >
-------------------------
+connection slave;
SELECT * FROM test.t3 ORDER BY id3;
id3 c
1 MySQL
2 kyle
3 Texas
4 ROCKS
+connection master;
ALTER PROCEDURE test.p1 MODIFIES SQL DATA;
+connection master;
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;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
index da196bb3615..aa22fa27266 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp006_InnoDB.result
@@ -33,9 +33,14 @@ BEGIN
INSERT INTO t1 VALUES ('MySQL','1993-02-04'),('ROCKS', '1990-08-27'),('Texas', '1999-03-30'),('kyle','2005-1-1');
END|
CALL p2();
+connection slave;
+connection master;
CALL p1();
+connection slave;
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP PROCEDURE p1;
DROP PROCEDURE p2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
index 4f5008aae65..13eb575402b 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp007_innodb.result
@@ -12,32 +12,24 @@ INSERT INTO test.t1 VALUES (14);
ROLLBACK to savepoint t1_save;
COMMIT;
END|
-
-< ---- Master selects-- >
--------------------------
CALL test.p1(12);
SELECT * FROM test.t1;
num
12
-
-< ---- Slave selects-- >
-------------------------
+connection slave;
SELECT * FROM test.t1;
num
12
-
-< ---- Master selects-- >
--------------------------
+connection master;
CALL test.p1(13);
SELECT * FROM test.t1;
num
13
-
-< ---- Slave selects-- >
-------------------------
+connection slave;
SELECT * FROM test.t1;
num
13
+connection master;
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp008.result b/mysql-test/suite/rpl/r/rpl_row_sp008.result
index f817e9c5f1b..481c9b3f6cc 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp008.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp008.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t2;
CREATE TABLE test.t1 (a INT,PRIMARY KEY(a));
@@ -10,22 +11,19 @@ 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-- >
-------------------------
+connection slave;
SELECT * FROM test.t2;
a
2
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp009.result b/mysql-test/suite/rpl/r/rpl_row_sp009.result
index 8e9a2cbb8e9..d4bcfe9fcb6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp009.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp009.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -49,26 +50,33 @@ SELECT * FROM test.t2 ORDER BY a;
a
1
3
+connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
1
3
+connection master;
truncate test.t2;
call test.p1('b');
select * from test.t2 ORDER BY a;
a
2
4
+connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
2
4
+connection master;
truncate test.t2;
SELECT * FROM test.t2 ORDER BY a;
a
+connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
+connection master;
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
DROP TABLE test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp010.result b/mysql-test/suite/rpl/r/rpl_row_sp010.result
index d31f37d8411..6a15298eddf 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp010.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp010.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -22,8 +23,10 @@ SELECT * FROM test.t1 ORDER BY a;
a
1
2
+connection slave;
show tables;
Tables_in_test
+connection master;
CREATE PROCEDURE test.p3()
BEGIN
INSERT INTO test.t2 VALUES(7);
@@ -40,14 +43,17 @@ SELECT * FROM test.t2 ORDER BY a;
a
6
7
+connection slave;
SELECT * FROM test.t2 ORDER BY a;
a
6
7
+connection master;
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;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp011.result b/mysql-test/suite/rpl/r/rpl_row_sp011.result
index 8588d739dff..53a9a964b53 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp011.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp011.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -54,6 +55,8 @@ ALTER TABLE test.t2 DROP COLUMN to_drop;
INSERT INTO test.t2 VALUES ('gone',NULL,'STM',RAND());
END|
CALL test.p1();
+connection slave;
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -63,4 +66,5 @@ DROP PROCEDURE IF EXISTS test.p6;
DROP PROCEDURE IF EXISTS test.p7;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_sp012.result b/mysql-test/suite/rpl/r/rpl_row_sp012.result
index e084d43f90a..65cc566256a 100644
--- a/mysql-test/suite/rpl/r/rpl_row_sp012.result
+++ b/mysql-test/suite/rpl/r/rpl_row_sp012.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP PROCEDURE IF EXISTS test.p3;
@@ -19,9 +20,9 @@ GRANT EXECUTE ON PROCEDURE p1 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p2 TO user1@localhost;
GRANT EXECUTE ON PROCEDURE p3 TO user1@localhost;
set sql_mode=default;
-
-<******** Master user1 p3 & p2 calls *******>
-----------------------------------------------
+connection slave;
+connect muser1,localhost,user1,,;
+connection muser1;
SELECT CURRENT_USER();
CURRENT_USER()
user1@localhost
@@ -34,9 +35,9 @@ user1@localhost user1@localhost
CALL test.p2();
CURRENT_USER() USER()
root@localhost user1@localhost
-
-<******** Slave user1 p3 & p2 calls *******>
----------------------------------------------
+connect suser1,127.0.0.1,user1,,test,$SLAVE_MYPORT,;
+connection master;
+connection suser1;
SELECT CURRENT_USER();
CURRENT_USER()
user1@localhost
@@ -49,10 +50,12 @@ user1@localhost user1@localhost
CALL test.p2();
CURRENT_USER() USER()
root@localhost user1@localhost
+connection master;
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;
DROP USER user1@localhost;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
index 2aca0e8dc30..3653a01ae81 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_2myisam.result
@@ -1,9 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
+connection master;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='MyISAM';
@@ -16,6 +19,7 @@ CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='MyISAM';
CREATE TABLE t7 (a INT NOT NULL) ENGINE='MyISAM';
CREATE TABLE t8 (a INT NOT NULL) ENGINE='MyISAM';
CREATE TABLE t9 (a INT) ENGINE='MyISAM';
+connection slave;
ALTER TABLE t1_int ADD x INT DEFAULT 42;
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
@@ -37,7 +41,7 @@ set @@global.slave_exec_mode= 'IDEMPOTENT';
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
-**** On Master ****
+connection master;
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
@@ -56,7 +60,7 @@ SELECT * FROM t1_char ORDER BY a;
a b
1 2
2 5
-**** On Slave ****
+connection slave;
set @@global.slave_exec_mode= default;
SELECT a,b,x FROM t1_int ORDER BY a;
a b x
@@ -70,7 +74,7 @@ SELECT a,b,x FROM t1_char ORDER BY a;
a b x
1 2 Just a test
2 5 Foo is a bar
-**** On Master ****
+connection master;
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
@@ -86,7 +90,7 @@ SELECT * FROM t1_char ORDER BY a;
a b
1 2
2 10
-**** On Slave ****
+connection slave;
SELECT a,b,x FROM t1_int ORDER BY a;
a b x
1 2 42
@@ -99,38 +103,59 @@ SELECT a,b,x FROM t1_char ORDER BY a;
a b x
1 2 Just a test
2 10 Foo is a bar
+connection master;
INSERT INTO t9 VALUES (2);
+connection slave;
+connection master;
INSERT INTO t1_nodef VALUES (1,2);
+connection slave;
select count(*) from t1_nodef;
count(*)
1
+connection master;
INSERT INTO t9 VALUES (2);
-**** On Master ****
+connection slave;
+connection master;
INSERT INTO t2 VALUES (2,4);
SELECT * FROM t2;
a b
2 4
-**** On Slave ****
+connection slave;
SELECT * FROM t2;
a
2
include/check_slave_is_running.inc
+connection master;
INSERT INTO t9 VALUES (4);
+connection slave;
+connection master;
INSERT INTO t4 VALUES (4);
+connection slave;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677");
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (5);
+connection slave;
+connection master;
INSERT INTO t5 VALUES (5,10,25);
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (6);
+connection slave;
+connection master;
INSERT INTO t6 VALUES (6,12,36);
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (6);
+connection slave;
include/check_slave_is_running.inc
+connection master;
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -143,6 +168,7 @@ a
1
2
3
+connection slave;
SELECT * FROM t7 ORDER BY a;
a e1 e2 e3 e4 e5 e6 e7 e8
1 NULL NULL NULL NULL NULL NULL NULL NULL
@@ -153,37 +179,40 @@ a e1 e2 e3 e4 e5 e6 e7 e8
1 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0
-**** On Master ****
+connection master;
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
-**** On Slave ****
+connection slave;
+connection slave;
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
-**** On Master ****
+connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
a b
1 4
2 4
-**** On Slave ****
+connection slave;
SELECT * FROM t1_nodef ORDER BY a;
a b x y z
1 4 3 4 5
2 4 6 8 10
-**** On Master ****
+connection master;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
a b
1 4
-**** On Slave ****
+connection slave;
SELECT * FROM t1_nodef ORDER BY a;
a b x y z
1 4 3 4 5
**** Cleanup ****
+connection master;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+connection slave;
SET @@global.sql_mode= @my_sql_mode;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
index 544bfa50034..d7bc9dd54d6 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tabledefs_3innodb.result
@@ -1,9 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
+connection master;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE='InnoDB';
@@ -16,6 +19,7 @@ CREATE TABLE t6 (a INT, b INT, c INT) ENGINE='InnoDB';
CREATE TABLE t7 (a INT NOT NULL) ENGINE='InnoDB';
CREATE TABLE t8 (a INT NOT NULL) ENGINE='InnoDB';
CREATE TABLE t9 (a INT) ENGINE='InnoDB';
+connection slave;
ALTER TABLE t1_int ADD x INT DEFAULT 42;
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
@@ -37,7 +41,7 @@ set @@global.slave_exec_mode= 'IDEMPOTENT';
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
-**** On Master ****
+connection master;
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
@@ -56,7 +60,7 @@ SELECT * FROM t1_char ORDER BY a;
a b
1 2
2 5
-**** On Slave ****
+connection slave;
set @@global.slave_exec_mode= default;
SELECT a,b,x FROM t1_int ORDER BY a;
a b x
@@ -70,7 +74,7 @@ SELECT a,b,x FROM t1_char ORDER BY a;
a b x
1 2 Just a test
2 5 Foo is a bar
-**** On Master ****
+connection master;
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
@@ -86,7 +90,7 @@ SELECT * FROM t1_char ORDER BY a;
a b
1 2
2 10
-**** On Slave ****
+connection slave;
SELECT a,b,x FROM t1_int ORDER BY a;
a b x
1 2 42
@@ -99,38 +103,59 @@ SELECT a,b,x FROM t1_char ORDER BY a;
a b x
1 2 Just a test
2 10 Foo is a bar
+connection master;
INSERT INTO t9 VALUES (2);
+connection slave;
+connection master;
INSERT INTO t1_nodef VALUES (1,2);
+connection slave;
select count(*) from t1_nodef;
count(*)
1
+connection master;
INSERT INTO t9 VALUES (2);
-**** On Master ****
+connection slave;
+connection master;
INSERT INTO t2 VALUES (2,4);
SELECT * FROM t2;
a b
2 4
-**** On Slave ****
+connection slave;
SELECT * FROM t2;
a
2
include/check_slave_is_running.inc
+connection master;
INSERT INTO t9 VALUES (4);
+connection slave;
+connection master;
INSERT INTO t4 VALUES (4);
+connection slave;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677");
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (5);
+connection slave;
+connection master;
INSERT INTO t5 VALUES (5,10,25);
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (6);
+connection slave;
+connection master;
INSERT INTO t6 VALUES (6,12,36);
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (6);
+connection slave;
include/check_slave_is_running.inc
+connection master;
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -143,6 +168,7 @@ a
1
2
3
+connection slave;
SELECT * FROM t7 ORDER BY a;
a e1 e2 e3 e4 e5 e6 e7 e8
1 NULL NULL NULL NULL NULL NULL NULL NULL
@@ -153,37 +179,40 @@ a e1 e2 e3 e4 e5 e6 e7 e8
1 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0
-**** On Master ****
+connection master;
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
-**** On Slave ****
+connection slave;
+connection slave;
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
-**** On Master ****
+connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
a b
1 4
2 4
-**** On Slave ****
+connection slave;
SELECT * FROM t1_nodef ORDER BY a;
a b x y z
1 4 3 4 5
2 4 6 8 10
-**** On Master ****
+connection master;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
a b
1 4
-**** On Slave ****
+connection slave;
SELECT * FROM t1_nodef ORDER BY a;
a b x y z
1 4 3 4 5
**** Cleanup ****
+connection master;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+connection slave;
SET @@global.sql_mode= @my_sql_mode;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result b/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
index eaee105a2d9..c8f8d0fc4a1 100644
--- a/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
+++ b/mysql-test/suite/rpl/r/rpl_row_tbl_metadata.result
@@ -154,11 +154,17 @@ PRIMARY KEY (`c1`)
LOCK TABLES `t1` WRITE;
INSERT INTO `t1`(c2) VALUES ('1');
FLUSH LOGS;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match
include/diff_tables.inc [master:t1, slave:t1]
DROP TABLE `t1`;
+connection master;
+connection slave;
+connection master;
=== Using mysqlbinlog to detect failure. Before the patch mysqlbinlog would find a corrupted event, thence would fail.
include/rpl_reset.inc
+connection master;
### action: generating several tables with different metadata
### sizes (resorting to perl)
### testing table with 249 field metadata size.
@@ -171,27 +177,59 @@ include/rpl_reset.inc
### testing table with 256 field metadata size.
### testing table with 257 field metadata size.
### testing table with 258 field metadata size.
+connection slave;
+connection master;
FLUSH LOGS;
### assertion: the slave replicated event successfully and tables match for t10
include/diff_tables.inc [master:t10, slave:t10]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t9
include/diff_tables.inc [master:t9, slave:t9]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t8
include/diff_tables.inc [master:t8, slave:t8]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t7
include/diff_tables.inc [master:t7, slave:t7]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t6
include/diff_tables.inc [master:t6, slave:t6]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t5
include/diff_tables.inc [master:t5, slave:t5]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t4
include/diff_tables.inc [master:t4, slave:t4]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t3
include/diff_tables.inc [master:t3, slave:t3]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t2
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
+connection slave;
+connection master;
### assertion: the slave replicated event successfully and tables match for t1
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
+connection slave;
+connection master;
### assertion: check that binlog is not corrupt. Using mysqlbinlog to
### detect failure. Before the patch mysqlbinlog would find
### a corrupted event, thence would fail.
diff --git a/mysql-test/suite/rpl/r/rpl_row_to_stmt.result b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result
index 2dfa82b0305..0cbbee4c82e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_to_stmt.result
+++ b/mysql-test/suite/rpl/r/rpl_row_to_stmt.result
@@ -4,6 +4,7 @@ use test;
create table t1 (a int primary key);
insert into t1 values (1),(2),(3),(4),(5);
update t1 set a=a*10;
+connection slave;
use test;
select * from t1;
a
@@ -24,5 +25,6 @@ slave-bin.000001 # Gtid # # BEGIN GTID #-#-#
slave-bin.000001 # Table_map # # table_id: # (test.t1)
slave-bin.000001 # Update_rows_v1 # # table_id: # flags: STMT_END_F
slave-bin.000001 # Query # # COMMIT
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig001.result b/mysql-test/suite/rpl/r/rpl_row_trig001.result
index d00da976d30..142c6c61865 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig001.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig001.result
@@ -14,10 +14,15 @@ CREATE PROCEDURE test.p2()
BEGIN
INSERT INTO test.t2 (f,d) VALUES (RAND(),NOW());
END//
+connection slave;
+connection master;
+connection master;
INSERT INTO test.t1 VALUES (1+1, NOW());
+connection slave;
<End test section 2 (Tiggers & SP)>
-----------------------------------
+connection master;
DROP PROCEDURE test.p2;
DROP PROCEDURE test.p3;
DROP TRIGGER test.t2_ai;
@@ -25,4 +30,5 @@ DROP TRIGGER test.t3_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig002.result b/mysql-test/suite/rpl/r/rpl_row_trig002.result
index b0be0316bf2..8259edd56df 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig002.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig002.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TRIGGER test.t2_ai;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -16,6 +17,7 @@ id domain
3 earthmotherwear.com
4 yahoo.com
5 example.com
+connection slave;
SELECT * FROM test.t1 ORDER BY id;
id domain
1 example.com
@@ -23,6 +25,7 @@ id domain
3 earthmotherwear.com
4 yahoo.com
5 example.com
+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');
@@ -33,6 +36,7 @@ select * from test.t3;
value domain_id mailaccount_id program keey
No 5 NULL spamfilter scan_incoming
Yes 1 NULL spamfilter scan_incoming
+connection slave;
select * from test.t2;
value domain_id mailaccount_id program keey
Yes 1 NULL spamfilter scan_incoming
@@ -40,6 +44,7 @@ select * from test.t3;
value domain_id mailaccount_id program keey
No 5 NULL spamfilter scan_incoming
Yes 1 NULL spamfilter scan_incoming
+connection master;
DELETE FROM test.t1 WHERE id = 1;
SELECT * FROM test.t1 ORDER BY id;
id domain
@@ -47,20 +52,24 @@ id domain
3 earthmotherwear.com
4 yahoo.com
5 example.com
+connection master;
SELECT * FROM test.t1 ORDER BY id;
id domain
2 mysql.com
3 earthmotherwear.com
4 yahoo.com
5 example.com
+connection slave;
SELECT * FROM test.t1 ORDER BY id;
id domain
2 mysql.com
3 earthmotherwear.com
4 yahoo.com
5 example.com
+connection master;
DROP TRIGGER test.t2_ai;
DROP TABLE test.t1;
DROP TABLE test.t2;
DROP TABLE test.t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig003.result b/mysql-test/suite/rpl/r/rpl_row_trig003.result
index 68552ede1c0..239d5917bc5 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig003.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig003.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@@ -68,6 +69,8 @@ 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;
+connection slave;
+connection master;
DROP TRIGGER test.t1_bi;
DROP TRIGGER test.t2_ai;
DROP TRIGGER test.t1_bu;
@@ -77,4 +80,5 @@ DROP TRIGGER test.t2_ad;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
DROP TABLE IF EXISTS test.t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_trig004.result b/mysql-test/suite/rpl/r/rpl_row_trig004.result
index 075616b58cf..ef9e7f41c88 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trig004.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trig004.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TRIGGER test.t1_bi_t2;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
@@ -15,13 +16,17 @@ n d
select * from test.t2;
n f
1 0
+connection slave;
+connection slave;
select * from test.t1;
n d
1 1.234
select * from test.t2;
n f
1 0
+connection master;
DROP TRIGGER test.t1_bi_t2;
DROP TABLE test.t1;
DROP TABLE test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_triggers.result b/mysql-test/suite/rpl/r/rpl_row_triggers.result
index b4ae9861633..ad78c33e2b9 100644
--- a/mysql-test/suite/rpl/r/rpl_row_triggers.result
+++ b/mysql-test/suite/rpl/r/rpl_row_triggers.result
@@ -1,9 +1,12 @@
include/master-slave.inc
[connection master]
# Test of row replication with triggers on the slave side
+connection master;
CREATE TABLE t1 (C1 CHAR(1) primary key, C2 CHAR(1)) engine=innodb;
SELECT * FROM t1;
C1 C2
+connection slave;
+connection slave;
SET @old_slave_exec_mode= @@global.slave_exec_mode;
SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
SET @@global.slave_exec_mode= IDEMPOTENT;
@@ -35,8 +38,11 @@ i0 0
i1 0
u0 0
u1 0
+connection master;
# INSERT triggers test
insert into t1 values ('a','b');
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -45,8 +51,11 @@ i0 1 a
i1 1 a
u0 0
u1 0
+connection master;
# UPDATE triggers test
update t1 set C1= 'd';
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -55,8 +64,11 @@ i0 1 a
i1 1 a
u0 1 a d
u1 1 a d
+connection master;
# DELETE triggers test
delete from t1 where C1='d';
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 1 d
@@ -75,7 +87,10 @@ i0 2 0
i1 2 0
u0 1 a d
u1 1 a d
+connection master;
insert into t1 values ('0','1');
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 2 0
@@ -87,8 +102,11 @@ u1 1 a d
# INSERT triggers which cause also DELETE test
# (insert duplicate row in table referenced by foreign key)
insert into t1 values ('1','1');
+connection master;
CREATE TABLE t3 (C1 CHAR(1) primary key, FOREIGN KEY (C1) REFERENCES t1(C1) ) engine=innodb;
insert into t1 values ('1','1');
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 3 1
@@ -97,32 +115,44 @@ i0 5 1
i1 5 1
u0 1 a d
u1 1 a d
+connection master;
drop table t3,t1;
+connection slave;
+connection slave;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
drop table t2;
+connection master;
CREATE TABLE t1 (i INT) ENGINE=InnoDB;
CREATE TABLE t2 (i INT) ENGINE=InnoDB;
+connection slave;
SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
SET GLOBAL slave_run_triggers_for_rbr=YES;
CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW
INSERT INTO t2 VALUES (new.i);
+connection master;
BEGIN;
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
COMMIT;
+connection slave;
select * from t2;
i
1
2
SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
+connection master;
drop tables t2,t1;
+connection slave;
# Triggers on slave do not work if master has some
+connection master;
CREATE TABLE t1 (C1 CHAR(1) primary key, C2 CHAR(1)) engine=innodb;
SELECT * FROM t1;
C1 C2
create trigger t1_dummy before delete on t1 for each row
set @dummy= 1;
+connection slave;
+connection slave;
SET @old_slave_exec_mode= @@global.slave_exec_mode;
SET @old_slave_run_triggers_for_rbr= @@global.slave_run_triggers_for_rbr;
SET @@global.slave_exec_mode= IDEMPOTENT;
@@ -152,8 +182,11 @@ i0 0
i1 0
u0 0
u1 0
+connection master;
# INSERT triggers test
insert into t1 values ('a','b');
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -162,8 +195,11 @@ i0 0
i1 0
u0 0
u1 0
+connection master;
# UPDATE triggers test
update t1 set C1= 'd';
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -172,8 +208,11 @@ i0 0
i1 0
u0 0
u1 0
+connection master;
# DELETE triggers test
delete from t1 where C1='d';
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -192,7 +231,10 @@ i0 1 0
i1 1 0
u0 0
u1 0
+connection master;
insert into t1 values ('0','1');
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -204,8 +246,11 @@ u1 0
# INSERT triggers which cause also DELETE test
# (insert duplicate row in table referenced by foreign key)
insert into t1 values ('1','1');
+connection master;
CREATE TABLE t3 (C1 CHAR(1) primary key, FOREIGN KEY (C1) REFERENCES t1(C1) ) engine=innodb;
insert into t1 values ('1','1');
+connection slave;
+connection slave;
SELECT * FROM t2 order by id;
id cnt o n
d0 0
@@ -214,29 +259,39 @@ i0 2 1
i1 2 1
u0 0
u1 0
+connection master;
drop table t3,t1;
+connection slave;
+connection slave;
SET @@global.slave_exec_mode= @old_slave_exec_mode;
SET @@global.slave_run_triggers_for_rbr= @old_slave_run_triggers_for_rbr;
drop table t2;
#
# MDEV-5513: Trigger is applied to the rows after first one
#
+connection master;
create table t1 (a int, b int);
create table tlog (a int);
set sql_log_bin=0;
create trigger tr1 after insert on t1 for each row insert into tlog values (1);
set sql_log_bin=1;
+connection slave;
+connection slave;
set @slave_run_triggers_for_rbr.saved = @@slave_run_triggers_for_rbr;
set global slave_run_triggers_for_rbr=1;
create trigger tr2 before insert on t1 for each row set new.b = new.a;
+connection master;
insert into t1 values (1,10),(2,20),(3,30);
+connection slave;
select * from t1;
a b
1 10
2 20
3 30
set global slave_run_triggers_for_rbr = @slave_run_triggers_for_rbr.saved;
+connection master;
drop table t1, tlog;
+connection slave;
#
# MDEV-8411 Assertion `is_stat_field || !table || (!table->write_set ||
# bitmap_is_set(table->write_set, field_index) ||
diff --git a/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
index d3b892326ac..c753e29bd87 100644
--- a/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_row_trunc_temp.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
CREATE TEMPORARY TABLE t1(c1 INTEGER);
CREATE TABLE t2(c1 INTEGER);
+connection slave;
CREATE TABLE t1(c1 INTEGER);
INSERT INTO t1 VALUES(1), (2);
INSERT INTO t2 VALUES(1), (2);
@@ -13,8 +14,10 @@ SELECT * FROM t2;
c1
1
2
+connection master;
TRUNCATE t1;
TRUNCATE t2;
+connection slave;
SELECT * FROM t1;
c1
1
@@ -22,5 +25,6 @@ c1
SELECT * FROM t2;
c1
DROP TABLE t1;
+connection master;
DROP TABLE t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
index b9ae1893629..802568aa841 100644
--- a/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
+++ b/mysql-test/suite/rpl/r/rpl_row_unsafe_funcs.result
@@ -1,9 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT, b INT);
INSERT INTO t1 SELECT 1;
+connection master1;
INSERT INTO t1 VALUES (2),(3),(4),(5),(6);
+connection master;
INSERT INTO t2 SELECT 1, ROW_COUNT();
INSERT INTO t1 VALUES (2),(3),(4);
INSERT INTO t2 SELECT 2, ROW_COUNT();
@@ -11,9 +14,13 @@ SELECT b FROM t2 ORDER BY a;
b
1
3
+connection slave;
SELECT b FROM t2 ORDER BY a;
b
1
3
+connection master;
DROP TABLE t1, t2;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_until.result b/mysql-test/suite/rpl/r/rpl_row_until.result
index 656dc45ea47..82268ce72eb 100644
--- a/mysql-test/suite/rpl/r/rpl_row_until.result
+++ b/mysql-test/suite/rpl/r/rpl_row_until.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t1(n INT NOT NULL AUTO_INCREMENT PRIMARY KEY);
INSERT INTO t1 VALUES (1),(2),(3),(4);
DROP TABLE t1;
@@ -7,9 +8,11 @@ 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;
+connection slave;
include/stop_slave.inc
RESET SLAVE;
CHANGE MASTER TO MASTER_USER='root', MASTER_CONNECT_RETRY=1, MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT;
+connection slave;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_drop_t1;
include/wait_for_slave_sql_to_stop.inc
SELECT * FROM t1;
@@ -30,6 +33,8 @@ n
include/check_slave_param.inc [Exec_Master_Log_Pos]
START SLAVE;
include/wait_for_slave_to_start.inc
+connection master;
+connection slave;
include/stop_slave.inc
START SLAVE SQL_THREAD UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=master_pos_create_t2;
include/wait_for_slave_param.inc [Until_Log_Pos]
@@ -50,9 +55,12 @@ include/stop_slave.inc
RESET SLAVE;
include/start_slave.inc
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
+connection slave;
include/stop_slave_sql.inc
+connection master;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
include/sync_slave_io_with_master.inc
@@ -60,5 +68,7 @@ start slave until relay_log_file='slave-relay-bin.000002', relay_log_pos=relay_l
include/wait_for_slave_sql_to_stop.inc
include/assert.inc [table t1 should have two rows.]
include/start_slave.inc
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_utf16.result b/mysql-test/suite/rpl/r/rpl_row_utf16.result
index cca69e1da82..c6a6c4f8520 100644
--- a/mysql-test/suite/rpl/r/rpl_row_utf16.result
+++ b/mysql-test/suite/rpl/r/rpl_row_utf16.result
@@ -3,18 +3,18 @@ include/master-slave.inc
CREATE TABLE t1(c1 CHAR(10) CHARACTER SET utf16 DEFAULT 'ola');
INSERT INTO t1 VALUES ('abc');
INSERT INTO t1 VALUES ();
-#### ON MASTER
SELECT c1, hex(c1) from t1;
c1 abc
hex(c1) 006100620063
c1 ola
hex(c1) 006F006C0061
-#### ON SLAVE
+connection slave;
SELECT c1, hex(c1) FROM t1;
c1 abc
hex(c1) 006100620063
c1 ola
hex(c1) 006F006C0061
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_utf32.result b/mysql-test/suite/rpl/r/rpl_row_utf32.result
index 0a212544113..af6e709860e 100644
--- a/mysql-test/suite/rpl/r/rpl_row_utf32.result
+++ b/mysql-test/suite/rpl/r/rpl_row_utf32.result
@@ -5,6 +5,7 @@ CREATE TABLE t1 (c1 char(255) DEFAULT NULL, KEY c1 (c1)) DEFAULT CHARSET=utf32;
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
SET SQL_LOG_BIN=1;
+connection slave;
SET @saved_slave_type_conversions= @@global.slave_type_conversions;
include/stop_slave.inc
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
@@ -14,9 +15,12 @@ CREATE TABLE t1 ( c1 varchar(255) DEFAULT NULL, KEY c1 (c1)) DEFAULT CHARSET=utf
Warnings:
Warning 1071 Specified key was too long; max key length is 1000 bytes
SET SQL_LOG_BIN=1;
+connection master;
INSERT INTO t1(c1) VALUES ('insert into t1');
DROP TABLE t1;
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS= @saved_slave_type_conversions;
include/stop_slave.inc
include/start_slave.inc
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_view01.result b/mysql-test/suite/rpl/r/rpl_row_view01.result
index 08369f60233..5c9944e75e0 100644
--- a/mysql-test/suite/rpl/r/rpl_row_view01.result
+++ b/mysql-test/suite/rpl/r/rpl_row_view01.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create database if not exists mysqltest1;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
@@ -31,6 +32,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
+connection slave;
SELECT * FROM mysqltest1.v2;
qty price value
3 50 150
@@ -41,6 +43,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
+connection master;
INSERT INTO mysqltest1.t5 SELECT * FROM mysqltest1.v2;
INSERT INTO mysqltest1.t3 SELECT * FROM mysqltest1.v1;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
@@ -53,6 +56,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
+connection slave;
SELECT * FROM mysqltest1.t5 ORDER BY qty;
qty price total
3 50 150
@@ -63,6 +67,7 @@ a c c2
1 Thank GOD
2 it is
3 Friday TGIF
+connection master;
INSERT INTO mysqltest1.v4 VALUES (4,'TEST');
SELECT * FROM mysqltest1.t1 ORDER BY a;
a c
@@ -75,6 +80,7 @@ a c
2 it
3 Friday
4 TEST
+connection slave;
SELECT * FROM mysqltest1.t1 ORDER BY a;
a c
1 Thank
@@ -86,6 +92,7 @@ a c
2 it
3 Friday
4 TEST
+connection master;
DROP VIEW IF EXISTS mysqltest1.v1;
DROP VIEW IF EXISTS mysqltest1.v2;
DROP VIEW IF EXISTS mysqltest1.v3;
@@ -95,4 +102,5 @@ DROP TABLE IF EXISTS mysqltest1.t1;
DROP TABLE IF EXISTS mysqltest1.t2;
DROP TABLE IF EXISTS mysqltest1.t4;
DROP DATABASE mysqltest1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_row_wide_table.result b/mysql-test/suite/rpl/r/rpl_row_wide_table.result
index f469a13837c..9dc34f9c0af 100644
--- a/mysql-test/suite/rpl/r/rpl_row_wide_table.result
+++ b/mysql-test/suite/rpl/r/rpl_row_wide_table.result
@@ -1,6 +1,7 @@
include/master-slave.inc
[connection master]
DROP TABLE IF EXISTS t300;
+connection master;
create table t300 (
f1 int,
f2 int,
@@ -304,6 +305,7 @@ f299 int,
f300 int,
primary key (f1));
insert into t300 set f1= 1;
+connection slave;
select f300 from t300;
f300
NULL
@@ -311,5 +313,7 @@ select count(*) as one from t300;
one
1
*** Cleanup ***
+connection master;
DROP TABLE t300;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_savepoint.result b/mysql-test/suite/rpl/r/rpl_savepoint.result
index 75eb0f307bb..6fd0e6f4559 100644
--- a/mysql-test/suite/rpl/r/rpl_savepoint.result
+++ b/mysql-test/suite/rpl/r/rpl_savepoint.result
@@ -4,7 +4,7 @@ include/master-slave.inc
# Bug#50124 Rpl failure on DROP table with concurrent txn/non-txn
# DML flow and SAVEPOINT
#
-# Connection master
+connection master;
DROP TABLE IF EXISTS tt, nt;
CREATE TABLE tt (i INT) ENGINE = InnoDB;
CREATE TABLE nt (i INT) ENGINE = MyISAM;
@@ -13,17 +13,17 @@ START TRANSACTION;
INSERT INTO nt VALUES (1);
SAVEPOINT insert_statement;
INSERT INTO tt VALUES (1);
-# Connection master1
+connection master1;
# Sending:
DROP TABLE tt;
-# Connection master
+connection master;
ROLLBACK TO SAVEPOINT insert_statement;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
-# Connection master1
+connection master1;
# Reaping: DROP TABLE tt
FLUSH LOGS;
-# Connection master
+connection master;
DROP TABLE nt;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync.result
index 06eb56a40c5..6d574681d73 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync.result
@@ -1,25 +1,30 @@
include/master-slave.inc
[connection master]
+connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
#
# Uninstall semi-sync plugins on master and slave
#
+connection slave;
include/stop_slave.inc
reset slave;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
+connection master;
reset master;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
#
# Main test of semi-sync replication start here
#
-[ on master ]
+connection master;
set global rpl_semi_sync_master_timeout= 60000;
[ default state of semi-sync on master should be OFF ]
show variables like 'rpl_semi_sync_master_enabled';
@@ -55,7 +60,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
reset master;
-[ on slave ]
+connection slave;
[ default state of semi-sync on slave should be OFF ]
show variables like 'rpl_semi_sync_slave_enabled';
Variable_name Value
@@ -66,7 +71,7 @@ show variables like 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
[ initial master state after the semi-sync slave connected ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
@@ -115,7 +120,7 @@ Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 11
-[ on slave ]
+connection slave;
[ slave status after replicated inserts ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -133,9 +138,11 @@ max(a)
# BUG#50157
# semi-sync replication crashes when replicating a transaction which
# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
-[ on master ]
+connection master;
SET SESSION AUTOCOMMIT= 0;
CREATE TABLE t2(c1 INT) ENGINE=innodb;
+connection slave;
+connection master;
BEGIN;
# Even though it is in a transaction, this statement is binlogged into binlog
@@ -148,12 +155,14 @@ INSERT INTO t2 VALUES(22);
COMMIT;
DROP TABLE t2, t3;
SET SESSION AUTOCOMMIT= 1;
+connection slave;
#
# Test semi-sync master will switch OFF after one transaction
# timeout waiting for slave reply.
#
+connection slave;
include/stop_slave.inc
-[ on master ]
+connection master;
set global rpl_semi_sync_master_timeout= 5000;
[ master status should be ON ]
show status like 'Rpl_semi_sync_master_status';
@@ -204,7 +213,7 @@ Rpl_semi_sync_master_yes_tx 14
#
# Test semi-sync status on master will be ON again when slave catches up
#
-[ on slave ]
+connection slave;
[ slave status should be OFF ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -223,7 +232,7 @@ min(a)
select max(a) from t1;
max(a)
500
-[ on master ]
+connection master;
[ master status should be ON again after slave catches up ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -241,11 +250,12 @@ Rpl_semi_sync_master_clients 1
# Test disable/enable master semi-sync on the fly.
#
drop table t1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
#
# Flush status
#
+connection master;
[ Semi-sync master status variables before FLUSH STATUS ]
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
Variable_name Value
@@ -261,7 +271,7 @@ Rpl_semi_sync_master_no_tx 0
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
-[ on master ]
+connection master;
show master logs;
Log_name master-bin.000001
File_size #
@@ -287,15 +297,16 @@ Rpl_semi_sync_master_status ON
#
# Test RESET MASTER/SLAVE
#
-[ on slave ]
+connection slave;
include/start_slave.inc
-[ on master ]
+connection master;
create table t1 (a int) engine = ENGINE_TYPE;
drop table t1;
+connection slave;
show status like 'Rpl_relay%';
Variable_name Value
[ test reset master ]
-[ on master]
+connection master;
reset master;
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -306,22 +317,24 @@ Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
-[ on slave ]
+connection slave;
include/stop_slave.inc
reset slave;
+connection master;
kill query _tid;
+connection slave;
include/start_slave.inc
-[ on master ]
+connection master;
create table t1 (a int) engine = ENGINE_TYPE;
insert into t1 values (1);
insert into t1 values (2), (3);
-[ on slave ]
+connection slave;
select * from t1;
a
1
2
3
-[ on master ]
+connection master;
[ master semi-sync status should be ON ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -335,16 +348,17 @@ Rpl_semi_sync_master_yes_tx 3
#
# Start semi-sync replication without SUPER privilege
#
+connection slave;
include/stop_slave.inc
reset slave;
-[ on master ]
+connection master;
reset master;
kill query _tid;
set sql_log_bin=0;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
set sql_log_bin=1;
-[ on slave ]
+connection slave;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
change master to master_user='rpl',master_password='rpl_password';
@@ -352,7 +366,7 @@ include/start_slave.inc
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
-[ on master ]
+connection master;
[ master semi-sync should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
@@ -384,12 +398,12 @@ Rpl_semi_sync_master_yes_tx 2
#
# Test semi-sync slave connect to non-semi-sync master
#
-[ on slave ]
+connection slave;
include/stop_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
-[ on master ]
+connection master;
kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
@@ -399,12 +413,12 @@ show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status ON
set global rpl_semi_sync_master_enabled= 0;
-[ on slave ]
+connection slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
insert into t1 values (8);
[ master semi-sync clients should be 1, status should be OFF ]
show status like 'Rpl_semi_sync_master_clients';
@@ -413,26 +427,29 @@ Rpl_semi_sync_master_clients 1
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status OFF
-[ on slave ]
+connection slave;
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
+connection slave;
include/stop_slave.inc
-[ on master ]
+connection master;
set global rpl_semi_sync_master_enabled= 0;
-[ on slave ]
+connection slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
insert into t1 values (10);
+connection slave;
#
# Test non-semi-sync slave connect to semi-sync master
#
+connection master;
set global rpl_semi_sync_master_timeout= 5000;
set global rpl_semi_sync_master_enabled= 1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -453,12 +470,18 @@ Rpl_semi_sync_slave_status OFF
#
# Clean up
#
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled= 0;
+connection master;
set global rpl_semi_sync_master_enabled= 0;
+connection slave;
change master to master_user='root',master_password='';
include/start_slave.inc
+connection master;
drop table t1;
+connection slave;
+connection master;
drop user rpl@127.0.0.1;
flush privileges;
set global rpl_semi_sync_master_timeout= default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
index 708c3ef0313..927113726fa 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync.result
@@ -1,26 +1,31 @@
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
include/master-slave.inc
[connection master]
+connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
#
# Uninstall semi-sync plugins on master and slave
#
+connection slave;
include/stop_slave.inc
reset slave;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
+connection master;
reset master;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
#
# Main test of semi-sync replication start here
#
-[ on master ]
+connection master;
set global rpl_semi_sync_master_timeout= 60000;
[ default state of semi-sync on master should be OFF ]
show variables like 'rpl_semi_sync_master_enabled';
@@ -56,7 +61,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
reset master;
-[ on slave ]
+connection slave;
[ default state of semi-sync on slave should be OFF ]
show variables like 'rpl_semi_sync_slave_enabled';
Variable_name Value
@@ -67,7 +72,7 @@ show variables like 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
[ initial master state after the semi-sync slave connected ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
@@ -116,7 +121,7 @@ Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 11
-[ on slave ]
+connection slave;
[ slave status after replicated inserts ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -134,9 +139,11 @@ max(a)
# BUG#50157
# semi-sync replication crashes when replicating a transaction which
# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
-[ on master ]
+connection master;
SET SESSION AUTOCOMMIT= 0;
CREATE TABLE t2(c1 INT) ENGINE=innodb;
+connection slave;
+connection master;
BEGIN;
# Even though it is in a transaction, this statement is binlogged into binlog
@@ -149,12 +156,14 @@ INSERT INTO t2 VALUES(22);
COMMIT;
DROP TABLE t2, t3;
SET SESSION AUTOCOMMIT= 1;
+connection slave;
#
# Test semi-sync master will switch OFF after one transaction
# timeout waiting for slave reply.
#
+connection slave;
include/stop_slave.inc
-[ on master ]
+connection master;
set global rpl_semi_sync_master_timeout= 5000;
[ master status should be ON ]
show status like 'Rpl_semi_sync_master_status';
@@ -205,7 +214,7 @@ Rpl_semi_sync_master_yes_tx 16
#
# Test semi-sync status on master will be ON again when slave catches up
#
-[ on slave ]
+connection slave;
[ slave status should be OFF ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -224,7 +233,7 @@ min(a)
select max(a) from t1;
max(a)
500
-[ on master ]
+connection master;
[ master status should be ON again after slave catches up ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -242,11 +251,12 @@ Rpl_semi_sync_master_clients 1
# Test disable/enable master semi-sync on the fly.
#
drop table t1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
#
# Flush status
#
+connection master;
[ Semi-sync master status variables before FLUSH STATUS ]
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
Variable_name Value
@@ -262,7 +272,7 @@ Rpl_semi_sync_master_no_tx 0
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
-[ on master ]
+connection master;
show master logs;
Log_name master-bin.000001
File_size #
@@ -288,15 +298,16 @@ Rpl_semi_sync_master_status ON
#
# Test RESET MASTER/SLAVE
#
-[ on slave ]
+connection slave;
include/start_slave.inc
-[ on master ]
+connection master;
create table t1 (a int) engine = ENGINE_TYPE;
drop table t1;
+connection slave;
show status like 'Rpl_relay%';
Variable_name Value
[ test reset master ]
-[ on master]
+connection master;
reset master;
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -307,22 +318,24 @@ Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
-[ on slave ]
+connection slave;
include/stop_slave.inc
reset slave;
+connection master;
kill query _tid;
+connection slave;
include/start_slave.inc
-[ on master ]
+connection master;
create table t1 (a int) engine = ENGINE_TYPE;
insert into t1 values (1);
insert into t1 values (2), (3);
-[ on slave ]
+connection slave;
select * from t1;
a
1
2
3
-[ on master ]
+connection master;
[ master semi-sync status should be ON ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -336,16 +349,17 @@ Rpl_semi_sync_master_yes_tx 3
#
# Start semi-sync replication without SUPER privilege
#
+connection slave;
include/stop_slave.inc
reset slave;
-[ on master ]
+connection master;
reset master;
kill query _tid;
set sql_log_bin=0;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
set sql_log_bin=1;
-[ on slave ]
+connection slave;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
change master to master_user='rpl',master_password='rpl_password';
@@ -353,7 +367,7 @@ include/start_slave.inc
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
-[ on master ]
+connection master;
[ master semi-sync should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
@@ -385,12 +399,12 @@ Rpl_semi_sync_master_yes_tx 2
#
# Test semi-sync slave connect to non-semi-sync master
#
-[ on slave ]
+connection slave;
include/stop_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
-[ on master ]
+connection master;
kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
@@ -400,12 +414,12 @@ show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status ON
set global rpl_semi_sync_master_enabled= 0;
-[ on slave ]
+connection slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
insert into t1 values (8);
[ master semi-sync clients should be 1, status should be OFF ]
show status like 'Rpl_semi_sync_master_clients';
@@ -414,26 +428,29 @@ Rpl_semi_sync_master_clients 1
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status OFF
-[ on slave ]
+connection slave;
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
+connection slave;
include/stop_slave.inc
-[ on master ]
+connection master;
set global rpl_semi_sync_master_enabled= 0;
-[ on slave ]
+connection slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
insert into t1 values (10);
+connection slave;
#
# Test non-semi-sync slave connect to semi-sync master
#
+connection master;
set global rpl_semi_sync_master_timeout= 5000;
set global rpl_semi_sync_master_enabled= 1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -454,12 +471,18 @@ Rpl_semi_sync_slave_status OFF
#
# Clean up
#
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled= 0;
+connection master;
set global rpl_semi_sync_master_enabled= 0;
+connection slave;
change master to master_user='root',master_password='';
include/start_slave.inc
+connection master;
drop table t1;
+connection slave;
+connection master;
drop user rpl@127.0.0.1;
flush privileges;
set global rpl_semi_sync_master_timeout= default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result
index 06573145e86..30280551ce2 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_after_sync_row.result
@@ -1,26 +1,31 @@
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
include/master-slave.inc
[connection master]
+connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
#
# Uninstall semi-sync plugins on master and slave
#
+connection slave;
include/stop_slave.inc
reset slave;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
+connection master;
reset master;
set global rpl_semi_sync_master_enabled= 0;
set global rpl_semi_sync_slave_enabled= 0;
#
# Main test of semi-sync replication start here
#
-[ on master ]
+connection master;
set global rpl_semi_sync_master_timeout= 60000;
[ default state of semi-sync on master should be OFF ]
show variables like 'rpl_semi_sync_master_enabled';
@@ -56,7 +61,7 @@ show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
reset master;
-[ on slave ]
+connection slave;
[ default state of semi-sync on slave should be OFF ]
show variables like 'rpl_semi_sync_slave_enabled';
Variable_name Value
@@ -67,7 +72,7 @@ show variables like 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
[ initial master state after the semi-sync slave connected ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
@@ -116,7 +121,7 @@ Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 11
-[ on slave ]
+connection slave;
[ slave status after replicated inserts ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -134,9 +139,11 @@ max(a)
# BUG#50157
# semi-sync replication crashes when replicating a transaction which
# include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
-[ on master ]
+connection master;
SET SESSION AUTOCOMMIT= 0;
CREATE TABLE t2(c1 INT) ENGINE=innodb;
+connection slave;
+connection master;
BEGIN;
# Even though it is in a transaction, this statement is binlogged into binlog
@@ -149,12 +156,14 @@ INSERT INTO t2 VALUES(22);
COMMIT;
DROP TABLE t2, t3;
SET SESSION AUTOCOMMIT= 1;
+connection slave;
#
# Test semi-sync master will switch OFF after one transaction
# timeout waiting for slave reply.
#
+connection slave;
include/stop_slave.inc
-[ on master ]
+connection master;
set global rpl_semi_sync_master_timeout= 5000;
[ master status should be ON ]
show status like 'Rpl_semi_sync_master_status';
@@ -205,7 +214,7 @@ Rpl_semi_sync_master_yes_tx 14
#
# Test semi-sync status on master will be ON again when slave catches up
#
-[ on slave ]
+connection slave;
[ slave status should be OFF ]
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -224,7 +233,7 @@ min(a)
select max(a) from t1;
max(a)
500
-[ on master ]
+connection master;
[ master status should be ON again after slave catches up ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -242,11 +251,12 @@ Rpl_semi_sync_master_clients 1
# Test disable/enable master semi-sync on the fly.
#
drop table t1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
#
# Flush status
#
+connection master;
[ Semi-sync master status variables before FLUSH STATUS ]
SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
Variable_name Value
@@ -262,7 +272,7 @@ Rpl_semi_sync_master_no_tx 0
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
-[ on master ]
+connection master;
show master logs;
Log_name master-bin.000001
File_size #
@@ -288,15 +298,16 @@ Rpl_semi_sync_master_status ON
#
# Test RESET MASTER/SLAVE
#
-[ on slave ]
+connection slave;
include/start_slave.inc
-[ on master ]
+connection master;
create table t1 (a int) engine = ENGINE_TYPE;
drop table t1;
+connection slave;
show status like 'Rpl_relay%';
Variable_name Value
[ test reset master ]
-[ on master]
+connection master;
reset master;
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -307,22 +318,24 @@ Rpl_semi_sync_master_no_tx 0
show status like 'Rpl_semi_sync_master_yes_tx';
Variable_name Value
Rpl_semi_sync_master_yes_tx 0
-[ on slave ]
+connection slave;
include/stop_slave.inc
reset slave;
+connection master;
kill query _tid;
+connection slave;
include/start_slave.inc
-[ on master ]
+connection master;
create table t1 (a int) engine = ENGINE_TYPE;
insert into t1 values (1);
insert into t1 values (2), (3);
-[ on slave ]
+connection slave;
select * from t1;
a
1
2
3
-[ on master ]
+connection master;
[ master semi-sync status should be ON ]
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
@@ -336,16 +349,17 @@ Rpl_semi_sync_master_yes_tx 3
#
# Start semi-sync replication without SUPER privilege
#
+connection slave;
include/stop_slave.inc
reset slave;
-[ on master ]
+connection master;
reset master;
kill query _tid;
set sql_log_bin=0;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
set sql_log_bin=1;
-[ on slave ]
+connection slave;
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
change master to master_user='rpl',master_password='rpl_password';
@@ -353,7 +367,7 @@ include/start_slave.inc
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
-[ on master ]
+connection master;
[ master semi-sync should be ON ]
show status like 'Rpl_semi_sync_master_clients';
Variable_name Value
@@ -385,12 +399,12 @@ Rpl_semi_sync_master_yes_tx 2
#
# Test semi-sync slave connect to non-semi-sync master
#
-[ on slave ]
+connection slave;
include/stop_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status OFF
-[ on master ]
+connection master;
kill query _tid;
[ Semi-sync status on master should be ON ]
show status like 'Rpl_semi_sync_master_clients';
@@ -400,12 +414,12 @@ show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status ON
set global rpl_semi_sync_master_enabled= 0;
-[ on slave ]
+connection slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
insert into t1 values (8);
[ master semi-sync clients should be 1, status should be OFF ]
show status like 'Rpl_semi_sync_master_clients';
@@ -414,26 +428,29 @@ Rpl_semi_sync_master_clients 1
show status like 'Rpl_semi_sync_master_status';
Variable_name Value
Rpl_semi_sync_master_status OFF
-[ on slave ]
+connection slave;
show status like 'Rpl_semi_sync_slave_status';
Variable_name Value
Rpl_semi_sync_slave_status ON
+connection slave;
include/stop_slave.inc
-[ on master ]
+connection master;
set global rpl_semi_sync_master_enabled= 0;
-[ on slave ]
+connection slave;
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
Variable_name Value
rpl_semi_sync_slave_enabled ON
include/start_slave.inc
-[ on master ]
+connection master;
insert into t1 values (10);
+connection slave;
#
# Test non-semi-sync slave connect to semi-sync master
#
+connection master;
set global rpl_semi_sync_master_timeout= 5000;
set global rpl_semi_sync_master_enabled= 1;
-[ on slave ]
+connection slave;
include/stop_slave.inc
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
Variable_name Value
@@ -454,12 +471,18 @@ Rpl_semi_sync_slave_status OFF
#
# Clean up
#
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled= 0;
+connection master;
set global rpl_semi_sync_master_enabled= 0;
+connection slave;
change master to master_user='root',master_password='';
include/start_slave.inc
+connection master;
drop table t1;
+connection slave;
+connection master;
drop user rpl@127.0.0.1;
flush privileges;
set global rpl_semi_sync_master_timeout= default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
index 456c0c4475a..c347ff410ac 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event.result
@@ -1,16 +1,21 @@
include/master-slave.inc
[connection master]
+connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
set global rpl_semi_sync_master_enabled = 1;
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled = 1;
include/start_slave.inc
+connection master;
SET GLOBAL event_scheduler = ON;
CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE;
INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
@@ -20,33 +25,141 @@ CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
+connection slave;
STOP SLAVE IO_THREAD;
+connection master;
+connect m$run,localhost,root,,;
+connection m20;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 20;
+connection master;
+connect m$run,localhost,root,,;
+connection m19;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 19;
+connection master;
+connect m$run,localhost,root,,;
+connection m18;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 18;
+connection master;
+connect m$run,localhost,root,,;
+connection m17;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 17;
+connection master;
+connect m$run,localhost,root,,;
+connection m16;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 16;
+connection master;
+connect m$run,localhost,root,,;
+connection m15;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 15;
+connection master;
+connect m$run,localhost,root,,;
+connection m14;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 14;
+connection master;
+connect m$run,localhost,root,,;
+connection m13;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 13;
+connection master;
+connect m$run,localhost,root,,;
+connection m12;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 12;
+connection master;
+connect m$run,localhost,root,,;
+connection m11;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 11;
+connection master;
+connect m$run,localhost,root,,;
+connection m10;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 10;
+connection master;
+connect m$run,localhost,root,,;
+connection m9;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 9;
+connection master;
+connect m$run,localhost,root,,;
+connection m8;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 8;
+connection master;
+connect m$run,localhost,root,,;
+connection m7;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 7;
+connection master;
+connect m$run,localhost,root,,;
+connection m6;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 6;
+connection master;
+connect m$run,localhost,root,,;
+connection m5;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 5;
+connection master;
+connect m$run,localhost,root,,;
+connection m4;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 4;
+connection master;
+connect m$run,localhost,root,,;
+connection m3;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 3;
+connection master;
+connect m$run,localhost,root,,;
+connection m2;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2;
+connection master;
+connect m$run,localhost,root,,;
+connection m1;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1;
+connection master;
+connection master;
SET GLOBAL event_scheduler = OFF;
+connection m20;
+disconnect m20;
+connection m19;
+disconnect m19;
+connection m18;
+disconnect m18;
+connection m17;
+disconnect m17;
+connection m16;
+disconnect m16;
+connection m15;
+disconnect m15;
+connection m14;
+disconnect m14;
+connection m13;
+disconnect m13;
+connection m12;
+disconnect m12;
+connection m11;
+disconnect m11;
+connection m10;
+disconnect m10;
+connection m9;
+disconnect m9;
+connection m8;
+disconnect m8;
+connection m7;
+disconnect m7;
+connection m6;
+disconnect m6;
+connection m5;
+disconnect m5;
+connection m4;
+disconnect m4;
+connection m3;
+disconnect m3;
+connection m2;
+disconnect m2;
+connection m1;
+disconnect m1;
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled = 0;
+connection master;
set global rpl_semi_sync_master_enabled = 0;
+connection slave;
include/start_slave.inc
+connection master;
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result b/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result
index 4533e7fb4ac..c237eb8df47 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_event_after_sync.result
@@ -1,17 +1,22 @@
set global rpl_semi_sync_master_wait_point=AFTER_SYNC;
include/master-slave.inc
[connection master]
+connection master;
call mtr.add_suppression("Timeout waiting for reply of binlog");
call mtr.add_suppression("Semi-sync master .* waiting for slave reply");
call mtr.add_suppression("Read semi-sync reply");
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
+connection slave;
call mtr.add_suppression("Master server does not support semi-sync");
call mtr.add_suppression("Semi-sync slave .* reply");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
set global rpl_semi_sync_master_enabled = 1;
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled = 1;
include/start_slave.inc
+connection master;
SET GLOBAL event_scheduler = ON;
CREATE TABLE t1 (i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f varchar(8)) ENGINE=ENGINE_TYPE;
INSERT INTO t1 (f) VALUES ('a'),('a'),('a'),('a'),('a');
@@ -21,34 +26,142 @@ CREATE EVENT ev1 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev1_',CONNECTION_ID()));
CREATE EVENT ev2 ON SCHEDULE EVERY 1 SECOND
DO INSERT INTO t1 VALUES (SLEEP(5),CONCAT('ev2_',CONNECTION_ID()));
+connection slave;
STOP SLAVE IO_THREAD;
+connection master;
+connect m$run,localhost,root,,;
+connection m20;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 20;
+connection master;
+connect m$run,localhost,root,,;
+connection m19;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 19;
+connection master;
+connect m$run,localhost,root,,;
+connection m18;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 18;
+connection master;
+connect m$run,localhost,root,,;
+connection m17;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 17;
+connection master;
+connect m$run,localhost,root,,;
+connection m16;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 16;
+connection master;
+connect m$run,localhost,root,,;
+connection m15;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 15;
+connection master;
+connect m$run,localhost,root,,;
+connection m14;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 14;
+connection master;
+connect m$run,localhost,root,,;
+connection m13;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 13;
+connection master;
+connect m$run,localhost,root,,;
+connection m12;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 12;
+connection master;
+connect m$run,localhost,root,,;
+connection m11;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 11;
+connection master;
+connect m$run,localhost,root,,;
+connection m10;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 10;
+connection master;
+connect m$run,localhost,root,,;
+connection m9;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 9;
+connection master;
+connect m$run,localhost,root,,;
+connection m8;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 8;
+connection master;
+connect m$run,localhost,root,,;
+connection m7;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 7;
+connection master;
+connect m$run,localhost,root,,;
+connection m6;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 6;
+connection master;
+connect m$run,localhost,root,,;
+connection m5;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 5;
+connection master;
+connect m$run,localhost,root,,;
+connection m4;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 4;
+connection master;
+connect m$run,localhost,root,,;
+connection m3;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 3;
+connection master;
+connect m$run,localhost,root,,;
+connection m2;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 2;
+connection master;
+connect m$run,localhost,root,,;
+connection m1;
UPDATE t1 SET f = CONCAT('up_',CONNECTION_ID()) WHERE i = 1;
+connection master;
+connection master;
SET GLOBAL event_scheduler = OFF;
+connection m20;
+disconnect m20;
+connection m19;
+disconnect m19;
+connection m18;
+disconnect m18;
+connection m17;
+disconnect m17;
+connection m16;
+disconnect m16;
+connection m15;
+disconnect m15;
+connection m14;
+disconnect m14;
+connection m13;
+disconnect m13;
+connection m12;
+disconnect m12;
+connection m11;
+disconnect m11;
+connection m10;
+disconnect m10;
+connection m9;
+disconnect m9;
+connection m8;
+disconnect m8;
+connection m7;
+disconnect m7;
+connection m6;
+disconnect m6;
+connection m5;
+disconnect m5;
+connection m4;
+disconnect m4;
+connection m3;
+disconnect m3;
+connection m2;
+disconnect m2;
+connection m1;
+disconnect m1;
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled = 0;
+connection master;
set global rpl_semi_sync_master_enabled = 0;
+connection slave;
include/start_slave.inc
+connection master;
DROP EVENT ev1;
DROP EVENT ev2;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
set global rpl_semi_sync_master_wait_point=default;
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result
index 36d862dedce..68ad4877927 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_uninstall_plugin.result
@@ -3,17 +3,19 @@ include/master-slave.inc
call mtr.add_suppression("Read semi-sync reply network error");
call mtr.add_suppression("Timeout waiting for reply of binlog");
INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master';
-[connection slave]
+connection slave;
INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave';
UNINSTALL PLUGIN rpl_semi_sync_slave;
-[connection master]
+connection master;
UNINSTALL PLUGIN rpl_semi_sync_master;
CREATE TABLE t1(i int);
INSERT INTO t1 values (1);
DROP TABLE t1;
-[connection slave]
+connection slave;
include/install_semisync.inc
-[connection slave]
+connection master;
+connection slave;
+connection slave;
show global status like "Slave%_running";
Variable_name Value
Slave_running ON
@@ -24,7 +26,7 @@ Warning 1620 Plugin is busy and will be uninstalled on shutdown
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
plugin_name plugin_status
rpl_semi_sync_slave DELETED
-[connection master]
+connection master;
show global status like "Slave%_connect%";
Variable_name Value
Slave_connections 2
@@ -38,11 +40,11 @@ rpl_semi_sync_master DELETED
CREATE TABLE t1(i int);
INSERT INTO t1 values (2);
DROP TABLE t1;
-[connection slave]
+connection slave;
show status like "Rpl_semi_sync_slave_status";
Variable_name Value
Rpl_semi_sync_slave_status ON
-[connection master]
+connection master;
show status like "Rpl_semi_sync_master_status";
Variable_name Value
Rpl_semi_sync_master_status ON
@@ -52,20 +54,20 @@ Rpl_semi_sync_master_clients 1
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
plugin_name plugin_status
rpl_semi_sync_master DELETED
-[connection slave]
+connection slave;
include/stop_slave.inc
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
plugin_name plugin_status
-[connection master]
+connection master;
create table t2 (a int);
drop table t2;
-[connection slave]
+connection slave;
include/start_slave.inc
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
plugin_name plugin_status
-[connection master]
+connection master;
CREATE TABLE t1(i int);
INSERT INTO t1 values (3);
DROP TABLE t1;
-[connection slave]
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
index 36a6ea655a2..404f0890e7c 100644
--- a/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
+++ b/mysql-test/suite/rpl/r/rpl_semi_sync_wait_point.result
@@ -14,9 +14,14 @@ call mtr.add_suppression("Run function 'after_sync' in plugin 'rpl_semi_sync_mas
#
SET @@global.rpl_semi_sync_master_wait_point = AFTER_COMMIT;
# Make another connection to INSERT from.
+connect other,localhost,root,,;
+connection other;
+connection default;
SET GLOBAL rpl_semi_sync_master_enabled = 1;
# Go ahead and send the INSERT; it should block.
+connection other;
INSERT INTO t1 (i) VALUES (1);
+connection default;
# The INSERT thread should now be waiting.
SELECT state AS should_be_waiting
FROM information_schema.processlist WHERE id = @other_connection_id;
@@ -29,7 +34,9 @@ i
# Kill the waiting thread; it should die immediately.
KILL @other_connection_id;
# Collect the error from the INSERT thread; it should be disconnected.
+connection other;
Got one of the listed errors
+connection default;
# Wait for INSERT thread to actually disappear (KILL closes connection
# before thread actually finishes its processing).
# The INSERT thread should now be gone.
@@ -40,9 +47,16 @@ should_be_empty_set
SELECT * FROM t1 ORDER BY 1;
i
1
+connection default;
+disconnect other;
# Make another connection to INSERT from.
+connect other,localhost,root,,;
+connection other;
+connection default;
# Go ahead and send the INSERT; it should block.
+connection other;
INSERT INTO t1 (i) VALUES (2);
+connection default;
# The INSERT thread should now be waiting.
SELECT state AS should_be_waiting
FROM information_schema.processlist WHERE id = @other_connection_id;
@@ -63,14 +77,20 @@ SELECT * FROM t1 ORDER BY 1;
i
1
2
+disconnect other;
#
# Test wait point = AFTER_SYNC
#
SET @@global.rpl_semi_sync_master_wait_point = AFTER_SYNC;
# Make another connection to INSERT from.
+connect other,localhost,root,,;
+connection other;
+connection default;
SET GLOBAL rpl_semi_sync_master_enabled = 1;
# Go ahead and send the INSERT; it should block.
+connection other;
INSERT INTO t1 (i) VALUES (3);
+connection default;
# The INSERT thread should now be waiting.
SELECT state AS should_be_waiting
FROM information_schema.processlist WHERE id = @other_connection_id;
@@ -84,7 +104,9 @@ i
# Kill the waiting thread; it should die immediately.
KILL @other_connection_id;
# Collect the error from the INSERT thread; it should be disconnected.
+connection other;
Got one of the listed errors
+connection default;
# Wait for INSERT thread to actually disappear (KILL closes connection
# before thread actually finishes its processing).
# The INSERT thread should now be gone.
@@ -97,9 +119,16 @@ i
1
2
3
+connection default;
+disconnect other;
# Make another connection to INSERT from.
+connect other,localhost,root,,;
+connection other;
+connection default;
# Go ahead and send the INSERT; it should block.
+connection other;
INSERT INTO t1 (i) VALUES (4);
+connection default;
# The INSERT thread should now be waiting.
SELECT state AS should_be_waiting
FROM information_schema.processlist WHERE id = @other_connection_id;
@@ -123,6 +152,7 @@ i
2
3
4
+disconnect other;
#
# Cleanup
#
diff --git a/mysql-test/suite/rpl/r/rpl_server_id1.result b/mysql-test/suite/rpl/r/rpl_server_id1.result
index 80e5bbae146..5978e33f6d9 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id1.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id1.result
@@ -1,4 +1,5 @@
include/rpl_init.inc [topology=2->2]
+connection server_2;
START SLAVE;
include/wait_for_slave_io_error.inc [errno=1593]
Last_IO_Error = 'Fatal error: The slave I/O thread stops because master and slave have equal MySQL server ids; these ids must be different for replication to work (or the --replicate-same-server-id option must be used on slave but this does not always make sense; please check the manual before using it).'
diff --git a/mysql-test/suite/rpl/r/rpl_server_id2.result b/mysql-test/suite/rpl/r/rpl_server_id2.result
index 69c0e1f7d9b..74145645920 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id2.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id2.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
create table t1 (n int);
reset master;
stop slave;
@@ -15,9 +16,11 @@ n
stop slave;
include/wait_for_slave_to_stop.inc
drop table t1;
+connection master;
reset master;
create table t1(n int);
create table t2(n int);
+connection slave;
change master to master_port=MASTER_PORT;
start slave until master_log_file='master-bin.000001', master_log_pos=UNTIL_POS;
include/wait_for_slave_io_to_start.inc
@@ -26,7 +29,10 @@ include/wait_for_slave_sql_to_stop.inc
show tables;
Tables_in_test
t1
+connection slave;
start slave sql_thread;
+connection master;
drop table t1;
drop table t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
index 0a4f414ad6e..22f739d1ec0 100644
--- a/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
+++ b/mysql-test/suite/rpl/r/rpl_server_id_ignore.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
master_id: 1
stop slave;
*** --replicate-same-server-id and change master option can clash ***
@@ -20,7 +21,11 @@ change master to IGNORE_SERVER_IDS= (5, 1, 4, 3, 1);
ignore server id list: 1, 3, 4, 5
*** ignore master (server 1) queries for a while ***
start slave;
+connection master;
+connection slave;
+connection master;
create table t1 (n int);
+connection slave;
include/wait_for_slave_param.inc [Exec_Master_Log_Pos]
*** must be empty as the event is to be filtered out ***
show tables;
@@ -36,10 +41,14 @@ change master to IGNORE_SERVER_IDS= ();
ignore server id list:
change master to master_host='127.0.0.1', master_port=MASTER_PORT, master_user='root';
start slave;
+connection master;
+connection slave;
*** must have caught create table ***
show tables;
Tables_in_test
t1
+connection master;
drop table t1;
+connection slave;
end of the tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_session_var.result b/mysql-test/suite/rpl/r/rpl_session_var.result
index f58744c5d8f..67863583f8d 100644
--- a/mysql-test/suite/rpl/r/rpl_session_var.result
+++ b/mysql-test/suite/rpl/r/rpl_session_var.result
@@ -12,10 +12,12 @@ select * from t1 where b<3 order by a;
a b
1 2
MySQL 1
+connection slave;
select * from t1 where b<3 order by a;
a b
1 2
MySQL 1
+connection master;
set @@session.sql_mode=ignore_space;
insert into t1 values(password ('MySQL'), 3);
set @@session.sql_mode=ansi_quotes;
@@ -33,18 +35,24 @@ insert into t2 select 2,a from t1 where a is null;
select * from t2 order by b;
b a
1 1
+connection slave;
select * from t2 order by b;
b a
1 1
+connection master;
drop table t1,t2;
+connection slave;
+connection master;
CREATE TABLE t1 (
`id` int(11) NOT NULL auto_increment,
`data` varchar(100),
PRIMARY KEY (`id`)
) ENGINE=MyISAM;
INSERT INTO t1(data) VALUES(SESSION_USER());
+connection slave;
SELECT length(data) < 100 FROM t1;
length(data) < 100
1
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_charset.result b/mysql-test/suite/rpl/r/rpl_set_charset.result
index fa30a361d13..92749ed5d99 100644
--- a/mysql-test/suite/rpl/r/rpl_set_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_set_charset.result
@@ -14,9 +14,6 @@ INSERT INTO t1 VALUES ('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ','C0');
INSERT INTO t1 VALUES ('ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß','D0');
INSERT INTO t1 VALUES ('àáâãäåæçèéêëìíîï','E0');
INSERT INTO t1 VALUES ('ðñòóôõö÷øùúûüýþÿ','F0');
-select "--- on master ---";
---- on master ---
---- on master ---
select hex(a),b from t1 order by b;
hex(a) b
A9A6ABAEAC 80
@@ -27,10 +24,8 @@ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0
D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0
+connection slave;
use mysqltest1;
-select "--- on slave ---";
---- on slave ---
---- on slave ---
select hex(a),b from t1 order by b;
hex(a) b
A9A6ABAEAC 80
@@ -41,5 +36,7 @@ C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF C0
D0D1D2D3D4D5D6D7D8D9DADBDCDDDEDF D0
E0E1E2E3E4E5E6E7E8E9EAEBECEDEEEF E0
F0F1F2F3F4F5F6F7F8F9FAFBFCFDFEFF F0
+connection master;
drop database mysqltest1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_null_innodb.result b/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
index f099b2b7691..0daab7561c1 100644
--- a/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_set_null_innodb.result
@@ -1,22 +1,34 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=InnoDB;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DELETE FROM t1 WHERE c2=1 LIMIT 1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 CHAR) Engine=InnoDB;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DELETE FROM t1 LIMIT 2;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_null_myisam.result b/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
index 5698be4ff0c..7ec3e62fab4 100644
--- a/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_set_null_myisam.result
@@ -1,22 +1,34 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=MyISAM;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DELETE FROM t1 WHERE c2=1 LIMIT 1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 CHAR) Engine=MyISAM;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DELETE FROM t1 LIMIT 2;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement.result b/mysql-test/suite/rpl/r/rpl_set_statement.result
index c9df74b0d3b..669a9327495 100644
--- a/mysql-test/suite/rpl/r/rpl_set_statement.result
+++ b/mysql-test/suite/rpl/r/rpl_set_statement.result
@@ -1,7 +1,9 @@
include/master-slave.inc
[connection master]
set sql_mode="";
+connection slave;
set sql_mode="";
+connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
call mtr.add_suppression("Unsafe statement written to the binary log*");
@@ -11,132 +13,134 @@ CREATE TABLE t2 (a char(255) not null);
There are the following types of variables:
1) variables that are NOT replicated correctly when using STATEMENT mode;
-[connection master]
+connection master;
SELECT @@max_join_size;
@@max_join_size
18446744073709551615
-[connection slave]
+connection slave;
SELECT @@max_join_size;
@@max_join_size
18446744073709551615
-[connection master]
+connection master;
SET STATEMENT max_join_size=2 FOR
INSERT INTO t1 VALUES(@@max_join_size);
SELECT @@max_join_size;
@@max_join_size
18446744073709551615
-[connection slave]
+connection slave;
SELECT * FROM t1;
a
18446744073709551615
SELECT @@max_join_size;
@@max_join_size
18446744073709551615
-[connection master]
+connection master;
DELETE FROM t1;
2) variables thar ARE replicated correctly
They must be replicated correctly with "SET STATEMENT" too.
-[connection master]
+connection master;
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
-[connection slave]
+connection slave;
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
-[connection master]
+connection master;
SET STATEMENT auto_increment_increment=10 FOR
INSERT INTO t1 VALUES(@@auto_increment_increment);
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
-[connection slave]
+connection slave;
SELECT * FROM t1;
a
10
SELECT @@auto_increment_increment;
@@auto_increment_increment
1
-[connection master]
+connection master;
DELETE FROM t1;
3) sql_mode which is replicated correctly exept NO_DIR_IN_CREATE value;
-[connection master]
+connection master;
SELECT @@sql_mode;
@@sql_mode
-[connection slave]
+connection slave;
SELECT @@sql_mode;
@@sql_mode
-[connection master]
+connection master;
SET STATEMENT sql_mode='ERROR_FOR_DIVISION_BY_ZERO' FOR
INSERT INTO t2 VALUES(@@sql_mode);
SELECT @@sql_mode;
@@sql_mode
-[connection slave]
+connection slave;
SELECT * FROM t2;
a
ERROR_FOR_DIVISION_BY_ZERO
SELECT @@sql_mode;
@@sql_mode
-[connection master]
+connection master;
DELETE FROM t2;
-[connection master]
+connection master;
SELECT @@sql_mode;
@@sql_mode
-[connection slave]
+connection slave;
SELECT @@sql_mode;
@@sql_mode
-[connection master]
+connection master;
SET STATEMENT sql_mode='NO_DIR_IN_CREATE' FOR
INSERT INTO t2 VALUES(@@sql_mode);
SELECT @@sql_mode;
@@sql_mode
-[connection slave]
+connection slave;
SELECT * FROM t2;
a
SELECT @@sql_mode;
@@sql_mode
-[connection master]
+connection master;
DELETE FROM t2;
4) variables that are not replicated at all:
default_storage_engine, storage_engine, max_heap_table_size
-[connection master]
+connection master;
SELECT @@max_heap_table_size;
@@max_heap_table_size
1048576
-[connection slave]
+connection slave;
SELECT @@max_heap_table_size;
@@max_heap_table_size
1048576
-[connection master]
+connection master;
SET STATEMENT max_heap_table_size=16384 FOR
INSERT INTO t1 VALUES(@@max_heap_table_size);
SELECT @@max_heap_table_size;
@@max_heap_table_size
1048576
-[connection slave]
+connection slave;
SELECT * FROM t1;
a
1048576
SELECT @@max_heap_table_size;
@@max_heap_table_size
1048576
-[connection master]
+connection master;
DELETE FROM t1;
+connection master;
DROP TABLE t1;
DROP TABLE t2;
+connection slave;
include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
index fdefdc9d7c3..828e171548d 100644
--- a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
+++ b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
RESET SLAVE ALL;
# Does not work for CHANGE MASTER:
@@ -17,3 +18,5 @@ stop slave;
include/wait_for_slave_to_stop.inc
reset slave all;
set default_master_connection = '';
+disconnect slave;
+connection default;
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
index 16d71e125ab..bd605c6e0fb 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_hosts.result
@@ -1,14 +1,19 @@
include/master-slave.inc
[connection master]
+connect slave2,127.0.0.1,root,,test,$SLAVE_MYPORT2,;
+connection slave2;
RESET SLAVE;
CHANGE MASTER TO master_host='127.0.0.1',master_port=MASTER_PORT,master_user='root';
START SLAVE IO_THREAD;
include/wait_for_slave_io_to_start.inc
+connection master;
SHOW SLAVE HOSTS;
Server_id Host Port Master_id
3 slave2 SLAVE_PORT 1
2 SLAVE_PORT 1
+connection slave2;
include/stop_slave_io.inc
+connection master;
SHOW SLAVE HOSTS;
Server_id Host Port Master_id
2 SLAVE_PORT 1
diff --git a/mysql-test/suite/rpl/r/rpl_show_slave_running.result b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
index 3e5e1882bd8..729c718390a 100644
--- a/mysql-test/suite/rpl/r/rpl_show_slave_running.result
+++ b/mysql-test/suite/rpl/r/rpl_show_slave_running.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
SET DEBUG_SYNC= 'RESET';
include/stop_slave.inc
set global debug_dbug= 'd,dbug.before_get_running_status_yes';
@@ -32,6 +33,7 @@ Variable_name Value
Slave_running ON
Slave_IO_Running= Yes
Slave_SQL_Running= Yes
+connection slave;
set global debug_dbug= '';
SET DEBUG_SYNC= 'RESET';
End of tests
diff --git a/mysql-test/suite/rpl/r/rpl_skip_error.result b/mysql-test/suite/rpl/r/rpl_skip_error.result
index 105b9d5c65f..7d351339925 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_error.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_error.result
@@ -1,14 +1,13 @@
include/master-slave.inc
[connection master]
==== Test Without sql_mode=strict_trans_tables ====
-[on master]
create table t1 (n int not null primary key);
-[on slave]
+connection slave;
insert into t1 values (1);
-[on master]
+connection master;
insert into t1 values (1);
insert into t1 values (2),(3);
-[on slave]
+connection slave;
select * from t1 order by n;
n
1
@@ -16,10 +15,10 @@ n
3
==== Test With sql_mode=strict_trans_tables ====
insert into t1 values (7),(8);
-[on master]
+connection master;
set sql_mode=strict_trans_tables;
insert into t1 values (7), (8), (9);
-[on slave]
+connection slave;
select * from t1 order by n;
n
1
@@ -29,7 +28,10 @@ n
8
include/check_slave_is_running.inc
==== Clean Up ====
+connection master;
drop table t1;
+connection slave;
+connection master;
create table t1(a int primary key);
insert into t1 values (1),(2);
SET SQL_LOG_BIN=0;
@@ -37,15 +39,18 @@ delete from t1;
SET SQL_LOG_BIN=1;
set sql_mode=strict_trans_tables;
insert into t1 values (1), (2), (3);
-[on slave]
+connection slave;
select * from t1;
a
1
2
include/check_slave_is_running.inc
==== Clean Up ====
+connection master;
drop table t1;
+connection slave;
==== Using Innodb ====
+connection master;
SET SQL_LOG_BIN=0;
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
@@ -56,6 +61,7 @@ t1 CREATE TABLE `t1` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
SET SQL_LOG_BIN=1;
+connection slave;
call mtr.add_suppression("Slave SQL.*Could not execute .*te_rows event on table test.t.; Duplicate entry.* error.* 1062");
CREATE TABLE t1(id INT NOT NULL PRIMARY KEY, data INT) Engine=InnoDB;
SHOW CREATE TABLE t1;
@@ -65,6 +71,7 @@ t1 CREATE TABLE `t1` (
`data` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
+connection master;
INSERT INTO t1 VALUES(1, 1);
INSERT INTO t1 VALUES(2, 1);
INSERT INTO t1 VALUES(3, 1);
@@ -73,10 +80,12 @@ SET SQL_LOG_BIN=0;
DELETE FROM t1 WHERE id = 4;
SET SQL_LOG_BIN=1;
UPDATE t1 SET id= id + 3, data = 2;
+connection slave;
**** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR.
==== Using MyIsam ====
+connection master;
SET SQL_LOG_BIN=0;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
@@ -87,6 +96,7 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
SET SQL_LOG_BIN=1;
+connection slave;
CREATE TABLE t2(id INT NOT NULL PRIMARY KEY, data INT) Engine=MyIsam;
SHOW CREATE TABLE t2;
Table Create Table
@@ -98,6 +108,7 @@ t2 CREATE TABLE `t2` (
show global status like 'slave_skipped_errors';
Variable_name Value
Slave_skipped_errors 4
+connection master;
INSERT INTO t2 VALUES(1, 1);
INSERT INTO t2 VALUES(2, 1);
INSERT INTO t2 VALUES(3, 1);
@@ -106,6 +117,7 @@ SET SQL_LOG_BIN=0;
DELETE FROM t2 WHERE id = 5;
SET SQL_LOG_BIN=1;
UPDATE t2 SET id= id + 3, data = 2;
+connection slave;
show global status like 'slave_skipped_errors';
Variable_name Value
@@ -113,6 +125,8 @@ Slave_skipped_errors 5
**** We cannot execute a select as there are differences in the
**** behavior between STMT and RBR.
==== Clean Up ====
+connection master;
DROP TABLE t1;
DROP TABLE t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_skip_incident.result b/mysql-test/suite/rpl/r/rpl_skip_incident.result
index 1dc0508af32..31d3b50056d 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_incident.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_incident.result
@@ -9,6 +9,7 @@ a
2
3
REPLACE INTO t1 VALUES (4);
+connection slave;
SELECT * FROM t1;
a
1
@@ -16,10 +17,12 @@ a
3
4
include/check_slave_is_running.inc
+connection master;
Should have two binary logs here
show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_skip_replication.result b/mysql-test/suite/rpl/r/rpl_skip_replication.result
index 586a104239a..ded85f3edd5 100644
--- a/mysql-test/suite/rpl/r/rpl_skip_replication.result
+++ b/mysql-test/suite/rpl/r/rpl_skip_replication.result
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
+connection slave;
CREATE USER 'nonsuperuser'@'127.0.0.1';
GRANT ALTER,CREATE,DELETE,DROP,EVENT,INSERT,PROCESS,REPLICATION SLAVE,
SELECT,UPDATE ON *.* TO 'nonsuperuser'@'127.0.0.1';
+connect nonpriv, 127.0.0.1, nonsuperuser,, test, $SLAVE_MYPORT,;
+connection nonpriv;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
+disconnect nonpriv;
+connection slave;
DROP USER'nonsuperuser'@'127.0.0.1';
SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
@@ -25,6 +30,7 @@ SELECT @@global.replicate_events_marked_for_skip;
@@global.replicate_events_marked_for_skip
FILTER_ON_MASTER
START SLAVE;
+connection master;
SELECT @@skip_replication;
@@skip_replication
0
@@ -42,6 +48,8 @@ CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
INSERT INTO t1(a) VALUES (2);
INSERT INTO t2(a) VALUES (2);
FLUSH NO_WRITE_TO_BINLOG LOGS;
+connection slave;
+connection slave;
SHOW TABLES;
Tables_in_test
t1
@@ -52,16 +60,22 @@ a b
SELECT * FROM t2;
a b
1 NULL
+connection master;
DROP TABLE t3;
FLUSH NO_WRITE_TO_BINLOG LOGS;
+connection slave;
+connection slave;
STOP SLAVE;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
START SLAVE;
+connection master;
SET skip_replication=1;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
INSERT INTO t1(a) VALUES (3);
INSERT INTO t2(a) VALUES (3);
FLUSH NO_WRITE_TO_BINLOG LOGS;
+connection slave;
+connection slave;
SHOW TABLES;
Tables_in_test
t1
@@ -72,26 +86,38 @@ a b
SELECT * FROM t2;
a b
1 NULL
+connection master;
DROP TABLE t3;
FLUSH NO_WRITE_TO_BINLOG LOGS;
+connection slave;
+connection slave;
STOP SLAVE;
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
START SLAVE;
+connection master;
SET skip_replication=1;
CREATE TABLE t3 (a INT PRIMARY KEY, b INT) ENGINE=myisam;
INSERT INTO t3(a) VALUES(2);
+connection slave;
+connection slave;
SELECT * FROM t3;
a b
2 NULL
+connection master;
DROP TABLE t3;
TRUNCATE t1;
+connection slave;
+connection slave;
RESET MASTER;
+connection master;
SET skip_replication=0;
INSERT INTO t1 VALUES (1,0);
SET skip_replication=1;
INSERT INTO t1 VALUES (2,0);
SET skip_replication=0;
INSERT INTO t1 VALUES (3,0);
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER by a;
a b
1 0
@@ -99,22 +125,31 @@ a b
3 0
STOP SLAVE;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
+connection master;
TRUNCATE t1;
SELECT * FROM t1 ORDER by a;
a b
1 0
2 0
3 0
+connection slave;
START SLAVE;
+connection master;
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER by a;
a b
1 0
3 0
+connection master;
TRUNCATE t1;
+connection slave;
+connection slave;
STOP SLAVE;
SET GLOBAL sql_slave_skip_counter=6;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
START SLAVE;
+connection master;
SET @old_binlog_format= @@binlog_format;
SET binlog_format= statement;
SET skip_replication=0;
@@ -125,13 +160,17 @@ SET skip_replication=0;
INSERT INTO t1 VALUES (3,5);
INSERT INTO t1 VALUES (4,5);
SET binlog_format= @old_binlog_format;
+connection slave;
+connection slave;
SELECT * FROM t1;
a b
4 5
+connection slave;
include/stop_slave.inc
SET @old_slave_binlog_format= @@global.binlog_format;
SET GLOBAL binlog_format= row;
include/start_slave.inc
+connection master;
TRUNCATE t1;
SET @old_binlog_format= @@binlog_format;
SET binlog_format= row;
@@ -149,12 +188,15 @@ SELECT * FROM t1 ORDER BY a;
a b
1 8
2 8
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER by a;
a b
2 8
include/stop_slave.inc
SET GLOBAL binlog_format= @old_slave_binlog_format;
include/start_slave.inc
+connection master;
SET skip_replication=0;
BEGIN;
SET skip_replication=0;
@@ -209,43 +251,61 @@ SELECT @@skip_replication;
DROP FUNCTION foo;
DROP PROCEDURE bar;
DROP FUNCTION baz;
+connection master;
SET skip_replication= 0;
TRUNCATE t1;
+connection slave;
+connection slave;
STOP SLAVE;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_MASTER;
START SLAVE IO_THREAD;
+connection master;
SET skip_replication= 1;
INSERT INTO t1(a) VALUES (1);
SET skip_replication= 0;
INSERT INTO t1(a) VALUES (2);
include/save_master_pos.inc
+connection slave;
include/sync_io_with_master.inc
STOP SLAVE IO_THREAD;
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
START SLAVE;
+connection master;
+connection slave;
+connection slave;
SELECT * FROM t1;
a b
2 NULL
+connection master;
SET skip_replication= 0;
TRUNCATE t1;
+connection slave;
+connection slave;
STOP SLAVE;
SET GLOBAL replicate_events_marked_for_skip=FILTER_ON_SLAVE;
START SLAVE IO_THREAD;
+connection master;
SET skip_replication= 1;
INSERT INTO t1(a) VALUES (1);
SET skip_replication= 0;
INSERT INTO t1(a) VALUES (2);
include/save_master_pos.inc
+connection slave;
include/sync_io_with_master.inc
STOP SLAVE IO_THREAD;
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
START SLAVE;
+connection master;
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
+connection master;
SET skip_replication=0;
DROP TABLE t1,t2;
+connection slave;
STOP SLAVE;
SET GLOBAL replicate_events_marked_for_skip=REPLICATE;
START SLAVE;
diff --git a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
index d3cfbb6fa91..9a34844489f 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_grp_exec.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
*** Preparing data ***
+connection master;
CREATE TABLE t1 (a INT NOT NULL, b VARCHAR(10)) ENGINE=MyISAM;
CREATE TABLE t2 LIKE t1;
CREATE TABLE t3 LIKE t1;
@@ -15,10 +16,13 @@ UPDATE t3 SET b='ZZ' WHERE a=NEW.a;
END|
*** Test non-transactional group w/o PK ***
+connection master;
INSERT INTO t3 VALUES(1, 'AA');
INSERT INTO t2 VALUES(1, 'AA');
INSERT INTO t1 VALUES(1, 'AA');
+connection slave;
RENAME TABLE t3 TO t3_bak;
+connection master;
UPDATE t1 SET b = 'XX' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
a b
@@ -29,6 +33,7 @@ a b
SELECT * FROM t3 ORDER BY a;
a b
1 ZZ
+connection slave;
call mtr.add_suppression("Slave SQL.*Table .test.t3. doesn.t exist.* error.* 1146");
include/wait_for_slave_sql_error.inc [errno=1146]
SHOW TABLES LIKE 't%';
@@ -45,20 +50,27 @@ a b
include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
+connection master;
TRUNCATE t1;
TRUNCATE t2;
TRUNCATE t3;
+connection slave;
*** Test non-transactional group w/ PK ***
+connection master;
ALTER TABLE t1 ADD PRIMARY KEY (a);
ALTER TABLE t2 ADD PRIMARY KEY (a);
ALTER TABLE t3 ADD PRIMARY KEY (a);
+connection slave;
RENAME TABLE t3 TO t3_bak;
+connection master;
INSERT INTO t3 VALUES(2, 'B');
INSERT INTO t2 VALUES(2, 'B');
INSERT INTO t1 VALUES(2, 'B');
UPDATE t1 SET b = 'X' WHERE a = 2;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1146]
+connection master;
SELECT * FROM t1 ORDER BY a;
a b
2 X
@@ -68,6 +80,7 @@ a b
SELECT * FROM t3 ORDER BY a;
a b
2 ZZ
+connection slave;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
@@ -80,21 +93,28 @@ a b
include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
+connection master;
TRUNCATE t1;
TRUNCATE t2;
TRUNCATE t3;
+connection slave;
*** Test transactional group w/ PK ***
+connection master;
ALTER TABLE t1 ENGINE=InnoDB;
ALTER TABLE t2 ENGINE=InnoDB;
ALTER TABLE t3 ENGINE=InnoDB;
+connection slave;
RENAME TABLE t3 TO t3_bak;
+connection master;
BEGIN;
INSERT INTO t1 VALUES (3, 'C'), (4, 'D');
INSERT INTO t2 VALUES (3, 'C'), (4, 'D');
INSERT INTO t3 VALUES (3, 'C'), (4, 'D');
COMMIT;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1146]
+connection master;
SELECT * FROM t1 ORDER BY a;
a b
3 C
@@ -107,6 +127,7 @@ SELECT * FROM t3 ORDER BY a;
a b
3 C
4 D
+connection slave;
SHOW TABLES LIKE 't%';
Tables_in_test (t%)
t1
@@ -120,5 +141,7 @@ include/stop_slave_io.inc
RENAME TABLE t3_bak TO t3;
include/start_slave.inc
*** Clean up ***
+connection master;
DROP TABLE t1,t2,t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_in.result b/mysql-test/suite/rpl/r/rpl_slave_load_in.result
index 504f6f60d9e..aeabdb79677 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_in.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_in.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1(a int not null auto_increment, b int, primary key(a));
create table t2(a int not null auto_increment, b int, primary key(a)) engine=innodb;
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
@@ -9,8 +10,11 @@ insert into t2(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
load data infile '../../std_data/rpl_loaddata.dat' into table t2;
commit;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
drop table t1;
drop table t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
index 468de62731c..be2a17ea2b7 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_remove_tmpfile.result
@@ -1,13 +1,17 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @@global.debug_dbug= '+d,remove_slave_load_file_before_write';
+connection master;
create table t1(a int not null auto_increment, b int, primary key(a)) engine=innodb;
start transaction;
insert into t1(b) values (1);
insert into t1(b) values (2);
load data infile '../../std_data/rpl_loaddata.dat' into table t1;
commit;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=29, 13]
+connection master;
drop table t1;
include/sync_slave_io_with_master.inc
include/stop_slave_io.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
index 60de4a9f812..249f3514c8a 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_load_tmpdir_not_exist.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
START SLAVE;
call mtr.add_suppression("Slave SQL.*Unable to use slave.s temporary directory");
include/wait_for_slave_sql_error.inc [errno=12]
diff --git a/mysql-test/suite/rpl/r/rpl_slave_skip.result b/mysql-test/suite/rpl/r/rpl_slave_skip.result
index 422c283fa13..2a0670e0b82 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_skip.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_skip.result
@@ -1,9 +1,9 @@
include/master-slave.inc
[connection master]
-**** On Slave ****
+connection slave;
STOP SLAVE;
include/wait_for_slave_to_stop.inc
-**** On Master ****
+connection master;
SET SESSION BINLOG_FORMAT=ROW;
CREATE TABLE t1 (a INT, b INT) ENGINE=MyISAM;
CREATE TABLE t2 (c INT, d INT) ENGINE=MyISAM;
@@ -40,7 +40,7 @@ c d
1 2
2 8
3 18
-**** On Slave ****
+connection slave;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
include/wait_for_slave_sql_to_stop.inc
include/check_slave_param.inc [Exec_Master_Log_Pos]
@@ -61,6 +61,7 @@ c d
STOP SLAVE;
include/wait_for_slave_to_stop.inc
RESET SLAVE;
+connection master;
RESET MASTER;
SET SESSION BINLOG_FORMAT=STATEMENT;
SET @foo = 12;
@@ -71,13 +72,16 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # User var # # @`foo`=12
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES(@foo, 2*@foo)
master-bin.000001 # Query # # COMMIT
+connection slave;
START SLAVE UNTIL MASTER_LOG_FILE='master-bin.000001', MASTER_LOG_POS=MASTER_LOG_POS;
include/wait_for_slave_sql_to_stop.inc
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
START SLAVE;
include/wait_for_slave_to_start.inc
-**** On Master ****
+connection master;
DROP TABLE t1, t2;
+connection slave;
+connection master;
SET SESSION BINLOG_FORMAT=ROW;
SET AUTOCOMMIT=0;
CREATE TABLE t1 (a INT, b VARCHAR(20)) ENGINE=myisam;
@@ -95,9 +99,9 @@ CREATE TRIGGER tr2 AFTER INSERT on t2 FOR EACH ROW
BEGIN
UPDATE t3 SET a =2, b = 'master only';
END|
-**** On Slave ****
+connection slave;
include/stop_slave.inc
-**** On Master ****
+connection master;
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1;
DROP TRIGGER tr2;
@@ -117,7 +121,7 @@ SELECT * FROM t3 ORDER BY a;
a b
2 master only
3 master/slave
-*** On Slave ***
+connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
include/start_slave.inc
SELECT * FROM t1 ORDER BY a;
@@ -132,15 +136,17 @@ SELECT * FROM t3 ORDER BY a;
a b
1 master/slave
3 master/slave
+connection master;
DROP TABLE t1, t2, t3;
+connection slave;
**** Case 2: Row binlog format and transactional tables ****
-*** On Master ***
+connection master;
CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
-**** On Slave ****
+connection slave;
include/stop_slave.inc
-*** On Master ***
+connection master;
BEGIN;
INSERT INTO t4 VALUES (2, 'master only');
INSERT INTO t5 VALUES (2, 'master only');
@@ -163,7 +169,7 @@ SELECT * FROM t6 ORDER BY a;
a b
2 master only
3 master/slave
-*** On Slave ***
+connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
@@ -175,9 +181,9 @@ a b
SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
-**** On Slave ****
+connection slave;
include/stop_slave.inc
-*** On Master ***
+connection master;
BEGIN;
INSERT INTO t4 VALUES (6, 'master only');
INSERT INTO t5 VALUES (6, 'master only');
@@ -206,7 +212,7 @@ a b
3 master/slave
6 master only
7 master only
-*** On Slave ***
+connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
@@ -218,7 +224,9 @@ a b
SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
+connection slave;
include/stop_slave.inc
+connection master;
SET AUTOCOMMIT=0;
INSERT INTO t4 VALUES (4, 'master only');
INSERT INTO t5 VALUES (4, 'master only');
@@ -252,7 +260,7 @@ a b
5 master/slave
6 master only
7 master only
-*** On Slave ***
+connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
include/start_slave.inc
SELECT * FROM t4 ORDER BY a;
@@ -267,13 +275,15 @@ SELECT * FROM t6 ORDER BY a;
a b
3 master/slave
5 master/slave
+connection master;
DROP TABLE t4, t5, t6;
+connection slave;
**** Case 3: Statement logging format and LOAD DATA with non-transactional table ****
-*** On Master ***
+connection master;
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
-*** On Slave ***
+connection slave;
include/stop_slave.inc
-*** On Master ***
+connection master;
SET SESSION BINLOG_FORMAT=STATEMENT;
LOAD DATA INFILE 'MYSQLTEST_VARDIR/std_data/rpl_bug28618.dat' INTO TABLE t10 FIELDS TERMINATED BY '|';
SELECT * FROM t10 ORDER BY a;
@@ -281,10 +291,12 @@ a b
1 master only
2 master only
3 master only
-*** On Slave ***
+connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
include/start_slave.inc
SELECT * FROM t10 ORDER BY a;
a b
+connection master;
DROP TABLE t10;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slave_status.result b/mysql-test/suite/rpl/r/rpl_slave_status.result
index 6257c8fb5b8..1c81cec2577 100644
--- a/mysql-test/suite/rpl/r/rpl_slave_status.result
+++ b/mysql-test/suite/rpl/r/rpl_slave_status.result
@@ -1,9 +1,9 @@
include/master-slave.inc
[connection master]
==== Create new replication user ====
-[on master]
+connection master;
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
-[on slave]
+connection slave;
include/stop_slave.inc
set @save_relay_log_purge=@@global.relay_log_purge;
set @@global.relay_log_purge=0;
@@ -20,18 +20,18 @@ set @@global.relay_log_purge=@save_relay_log_purge;
CHANGE MASTER TO master_user='rpl', master_password='rpl';
include/start_slave.inc
==== Do replication as new user ====
-[on master]
+connection master;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1);
-[on slave]
+connection slave;
SELECT * FROM t1;
n
1
==== Delete new replication user ====
-[on master]
+connection master;
DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES;
-[on slave]
+connection slave;
==== Restart slave without privileges =====
include/stop_slave.inc
START SLAVE;
@@ -43,6 +43,6 @@ include/wait_for_slave_io_error.inc [errno=1045]
include/stop_slave_sql.inc
CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
include/rpl_reset.inc
-[on master]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_slow_query_log.result b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
index 2de0f5ccd82..52b83eee6ab 100644
--- a/mysql-test/suite/rpl/r/rpl_slow_query_log.result
+++ b/mysql-test/suite/rpl/r/rpl_slow_query_log.result
@@ -2,6 +2,7 @@ include/master-slave.inc
[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection slave;
include/stop_slave.inc
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
@@ -9,10 +10,14 @@ SET @old_long_query_time= @@long_query_time;
SET GLOBAL long_query_time= 2;
TRUNCATE mysql.slow_log;
include/start_slave.inc
+connection master;
CREATE TABLE t1 (a int, b int);
INSERT INTO t1 values(1, 1);
INSERT INTO t1 values(1, sleep(3));
+connection slave;
TRUNCATE mysql.slow_log;
+connect extra,127.0.0.1,root,,test,$SLAVE_MYPORT;
+connection extra;
SELECT 1, sleep(3);
1 sleep(3)
1 0
@@ -28,8 +33,11 @@ SELECT 2;
2
2
TRUNCATE mysql.slow_log;
+connect extra2,127.0.0.1,root,,test,$SLAVE_MYPORT;
+connection extra2;
SET @old_slow_query_log= @@slow_query_log;
SET GLOBAL slow_query_log= 'OFF';
+connection extra;
SELECT 3, sleep(3);
3 sleep(3)
3 0
@@ -37,19 +45,26 @@ SELECT 3;
3
3
TRUNCATE mysql.slow_log;
+connection extra2;
SET GLOBAL slow_query_log= @old_slow_query_log;
+connection master;
DROP TABLE t1;
+connection slave;
include/stop_slave.inc
SET GLOBAL long_query_time= @old_long_query_time;
SET GLOBAL log_output= @old_log_output;
include/start_slave.inc
+disconnect extra;
+disconnect extra2;
include/rpl_reset.inc
+connection master;
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
SET GLOBAL long_query_time= 2;
SET @old_long_query_time= @@long_query_time;
SET SESSION long_query_time= 2;
TRUNCATE mysql.slow_log;
+connection slave;
include/stop_slave.inc
SET @old_log_output= @@log_output;
SET GLOBAL log_output= 'TABLE';
@@ -57,15 +72,18 @@ SET @old_long_query_time= @@long_query_time;
SET GLOBAL long_query_time= 2;
TRUNCATE mysql.slow_log;
include/start_slave.inc
+connection master;
CREATE TABLE t1 (a int, b int);
********************************************************************
**** INSERT one row that exceeds long_query_time
**** Outcome: query ends up in both master and slave slow log
********************************************************************
INSERT INTO t1 values(1, sleep(3));
+connection slave;
### Assertion is good. Both Master and Slave exhibit the
### same number of queries in slow log: 1
TRUNCATE mysql.slow_log;
+connection master;
TRUNCATE mysql.slow_log;
********************************************************************
**** Now do inserts again, but first add an index to the table.
@@ -74,6 +92,7 @@ TRUNCATE mysql.slow_log;
********************************************************************
ALTER TABLE t1 ADD INDEX id1(a);
INSERT INTO t1 values(1, sleep(3));
+connection slave;
### Assertion is good. Both Master and Slave exhibit the
### same number of queries in slow log: 1
********************************************************************
@@ -83,17 +102,25 @@ INSERT INTO t1 values(1, sleep(3));
SET @old_log_slow_slave_statements= @@global.log_slow_slave_statements;
SET @@global.log_slow_slave_statements = off;
TRUNCATE mysql.slow_log;
+connection master;
INSERT INTO t1 values(1, sleep(3));;
+connection slave;
+connection slave;
SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
sql_text
SET @@global.log_slow_slave_statements = on;
+connection master;
INSERT INTO t1 values(1, sleep(3));;
+connection slave;
+connection slave;
SELECT sql_text FROM mysql.slow_log WHERE sql_text like 'INSERT INTO t1 values(1, sleep(3))';
sql_text
INSERT INTO t1 values(1, sleep(3))
+connection master;
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
DROP TABLE t1;
+connection slave;
SET @@global.log_output= @old_log_output;
SET @@global.long_query_time= @old_long_query_time;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index ea9c8906217..944f7ea06ec 100644
--- a/mysql-test/suite/rpl/r/rpl_sp.result
+++ b/mysql-test/suite/rpl/r/rpl_sp.result
@@ -6,7 +6,9 @@ drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
create table t1 (a varchar(100));
+connection slave;
use mysqltest1;
+connection master;
create procedure foo()
begin
declare b int;
@@ -27,6 +29,7 @@ set b = 8;
insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
+connection slave;
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 character_set_client collation_connection db_collation body_utf8
mysqltest1 foo PROCEDURE foo SQL CONTAINS_SQL NO DEFINER begin
@@ -40,16 +43,19 @@ set b = 8;
insert into t1 values (b);
insert into t1 values (unix_timestamp());
end
+connection master;
set timestamp=1000000000;
call foo();
select * from t1;
a
8
1000000000
+connection slave;
select * from t1;
a
8
1000000000
+connection master;
delete from t1;
create procedure foo2()
select * from mysqltest1.t1;
@@ -68,6 +74,8 @@ grant SELECT, INSERT on mysqltest1.t2 to "zedjzlcsjhd"@127.0.0.1;
SELECT 1;
1
1
+connect con1,127.0.0.1,zedjzlcsjhd,,mysqltest1,$MASTER_MYPORT,;
+connection con1;
create procedure foo4()
deterministic
begin
@@ -76,6 +84,7 @@ insert into t1 values (5);
end|
call foo4();
Got one of the listed errors
+connection master;
call foo3();
show warnings;
Level Code Message
@@ -94,6 +103,7 @@ a
3
3
3
+connection slave;
select * from t1;
a
15
@@ -103,6 +113,7 @@ a
3
3
3
+connection master;
delete from t2;
alter table t2 add unique (a);
drop procedure foo4;
@@ -120,6 +131,7 @@ Warning 1196 Some non-transactional changed tables couldn't be rolled back
select * from t2;
a
20
+connection slave;
select * from t2;
a
20
@@ -130,11 +142,14 @@ insert into t2 values(20),(20);
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
insert into t2 values(20),(20);
end
+connection master;
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 character_set_client collation_connection db_collation body_utf8
+connection slave;
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 character_set_client collation_connection db_collation body_utf8
+connection master;
drop procedure foo;
drop procedure foo2;
drop procedure foo3;
@@ -164,6 +179,7 @@ a
select * from t2;
a
23
+connection slave;
select * from t1;
a
21
@@ -171,6 +187,7 @@ a
select * from t2;
a
23
+connection master;
drop function fn1;
create function fn1()
returns int
@@ -183,6 +200,7 @@ ERROR HY000: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA
delete from t1;
set timestamp=1000000000;
insert into t1 values(fn1());
+connection con1;
create function fn2()
returns int
no sql
@@ -190,17 +208,21 @@ begin
return unix_timestamp();
end|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+connection master;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=0;
set global log_bin_trust_function_creators=1;
+connection slave;
set @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
set global log_bin_trust_function_creators=1;
+connection con1;
create function fn2()
returns int
no sql
begin
return unix_timestamp();
end|
+connection master;
create function fn3()
returns int
not deterministic
@@ -231,6 +253,7 @@ end
select * from t1;
a
1000000000
+connection slave;
use mysqltest1;
select * from t1;
a
@@ -252,6 +275,7 @@ return 0;
end root@localhost # # latin1 latin1_swedish_ci latin1_swedish_ci begin
return 0;
end
+connection master;
delete from t2;
alter table t2 add unique (a);
Warnings:
@@ -273,43 +297,56 @@ select * from t2;
a
20
100
+connection slave;
select * from t2;
a
20
100
+connection con1;
create trigger trg before insert on t1 for each row set new.a= 10;
ERROR 42000: TRIGGER command denied to user 'zedjzlcsjhd'@'localhost' for table 't1'
+connection master;
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
+connection slave;
select * from t1;
a
10
+connection master;
delete from t1;
drop trigger trg;
insert into t1 values (1);
select * from t1;
a
1
+connection slave;
select * from t1;
a
1
+connection master;
create procedure foo()
not deterministic
reads sql data
select * from t1;
+connection slave;
call foo();
a
1
+connection master;
drop procedure foo;
+connection slave;
+connection master;
drop function fn1;
drop database mysqltest1;
drop user "zedjzlcsjhd"@127.0.0.1;
use test;
+connection slave;
use test;
+connection master;
drop function if exists f1;
create function f1() returns int reads sql data
begin
@@ -328,9 +365,12 @@ a
1
drop view v1;
drop function f1;
+connection slave;
+connection slave;
select * from t1;
a
1
+connection master;
DROP PROCEDURE IF EXISTS p1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(col VARCHAR(10));
@@ -340,21 +380,23 @@ CALL p1('test');
SELECT * FROM t1;
col
test
+connection slave;
SELECT * FROM t1;
col
test
+connection master;
DROP PROCEDURE p1;
---> Test for BUG#20438
---> Preparing environment...
----> connection: master
+connection master;
DROP PROCEDURE IF EXISTS p1;
DROP FUNCTION IF EXISTS f1;
---> Synchronizing slave with master...
-
----> connection: master
+connection slave;
+connection master;
---> Creating procedure...
/*!50003 CREATE PROCEDURE p1() SET @a = 1 */;
@@ -371,7 +413,7 @@ f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci
---> Synchronizing slave with master...
----> connection: master
+connection slave;
---> Checking on slave...
SHOW CREATE PROCEDURE p1;
@@ -382,13 +424,17 @@ SHOW CREATE FUNCTION f1;
Function sql_mode Create Function character_set_client collation_connection Database Collation
f1 CREATE DEFINER=`root`@`localhost` FUNCTION `f1`() RETURNS int(11)
RETURN 0 latin1 latin1_swedish_ci latin1_swedish_ci
-
----> connection: master
+connection master;
---> Cleaning up...
DROP PROCEDURE p1;
DROP FUNCTION f1;
+connection slave;
+connection master;
+connection master;
drop table t1;
+connection slave;
+connection master;
drop database if exists mysqltest;
drop database if exists mysqltest2;
create database mysqltest;
@@ -399,13 +445,18 @@ create procedure mysqltest.test() begin end;
insert into t values ( 1 );
create procedure `\\`.test() begin end;
ERROR 42000: Unknown database '\\'
+connection master;
create function f1 () returns int
begin
insert into t values (1);
return 0;
end|
+connection slave;
+connection master;
use mysqltest;
set @a:= mysqltest2.f1();
+connection slave;
+connection master;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
@@ -668,10 +719,14 @@ end
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `mysqltest`; SELECT `mysqltest2`.`f1`()
master-bin.000001 # Query # # COMMIT
+connection slave;
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
+connection master;
set @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
drop database mysqltest;
drop database mysqltest2;
+connection slave;
+connection master;
use test;
/*!50001 create procedure `mysqltestbug36570_p1`() */
begin
@@ -700,6 +755,8 @@ Procedure sql_mode Create Procedure character_set_client collation_connection Da
begin
select a;
end latin1 latin1_swedish_ci latin1_swedish_ci
+connection slave;
+connection slave;
show procedure status like '%mysqltestbug36570%';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test mysqltestbug36570_p2 PROCEDURE root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
@@ -717,6 +774,7 @@ a
show function status like '%mysqltestbug36570%';
Db Name Type Definer Modified Created Security_type Comment character_set_client collation_connection Database Collation
test mysqltestbug36570_f1 FUNCTION root@localhost t t DEFINER latin1 latin1_swedish_ci latin1_swedish_ci
+connection master;
flush logs;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!40019 SET @@session.max_insert_delayed_threads=0*/;
@@ -1242,34 +1300,38 @@ End of 5.0 tests
# identical data. Statements in the binrary log must be
# consistent with data in the table.
#
-# --> connection default
+connection default;
drop table if exists t1, t2;
drop function if exists t1;
create table t1 (a int);
create table t2 (a int) as select 1 as a;
create function f1() returns int deterministic return (select max(a) from t2);
lock table t2 write;
-# --> connection master
+connection master;
# Sending 'insert into t1 (a) values (f1())'...
insert into t1 (a) values (f1());
+connection master1;
# Waitng for 'insert into t1 ...' to get blocked on table lock...
# Sending 'drop function f1'. It will wait till insert finishes.
drop function f1;;
-# --> connection default
+connection default;
# Check that 'drop function f1' gets blocked.
# Now let's let 'insert' go through...
unlock tables;
-# --> connection master
+connection master;
# Reaping 'insert into t1 (a) values (f1())'...
-# --> connection master1
+connection master1;
# Reaping 'drop function f1'
-# --> connection master
+connection master;
select * from t1;
a
1
+connection slave;
+connection slave;
select * from t1;
a
1
+connection master;
drop table t1, t2;
drop function f1;
ERROR 42000: FUNCTION test.f1 does not exist
@@ -1296,21 +1358,28 @@ c1
8
9
10
+connection slave;
+connection slave;
select * from t1;
c1
7
8
9
10
+connection master;
call p1(-1);
select * from t1;
c1
+connection slave;
+connection slave;
select * from t1;
c1
+connection master;
# Cleanup
set @@session.binlog_format=@save_binlog_format;
drop table t1;
drop procedure p1;
# End of 5.5 tests.
+connection slave;
include/rpl_end.inc
set global sql_mode=default;
diff --git a/mysql-test/suite/rpl/r/rpl_sp004.result b/mysql-test/suite/rpl/r/rpl_sp004.result
index 5b67d225490..72f0428ce0f 100644
--- a/mysql-test/suite/rpl/r/rpl_sp004.result
+++ b/mysql-test/suite/rpl/r/rpl_sp004.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP PROCEDURE IF EXISTS test.p2;
DROP TABLE IF EXISTS test.t2;
@@ -34,6 +35,7 @@ a
2
3
8
+connection slave;
SELECT * FROM test.t1 ORDER BY a;
a
1
@@ -46,15 +48,18 @@ a
2
3
8
+connection master;
CALL test.p2();
USE test;
SHOW TABLES;
Tables_in_test
t3
+connection slave;
USE test;
SHOW TABLES;
Tables_in_test
t3
+connection master;
CALL test.p1();
Warnings:
Note 1050 Table 't3' already exists
@@ -70,6 +75,7 @@ a
2
3
8
+connection slave;
SELECT * FROM test.t1 ORDER BY a;
a
1
@@ -82,9 +88,11 @@ a
2
3
8
+connection master;
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;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sp_effects.result b/mysql-test/suite/rpl/r/rpl_sp_effects.result
index 413ff41879d..31234a8101f 100644
--- a/mysql-test/suite/rpl/r/rpl_sp_effects.result
+++ b/mysql-test/suite/rpl/r/rpl_sp_effects.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
SET @old_log_bin_trust_function_creators= @@global.log_bin_trust_function_creators;
drop procedure if exists p1;
drop procedure if exists p2;
@@ -17,6 +18,8 @@ set spv=spv+1;
end while;
end//
call p1();
+connection slave;
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -24,6 +27,7 @@ a
3
4
5
+connection master;
SELECT * FROM t1 ORDER BY a;
a
1
@@ -40,9 +44,12 @@ call p2();
SELECT * FROM t2 ORDER BY a;
a
4
+connection slave;
+connection slave;
SELECT * FROM t2 ORDER BY a;
a
4
+connection master;
drop procedure p1;
drop procedure p2;
drop table t2;
@@ -101,6 +108,8 @@ master: 7
master: 8
master: 10
master: 11
+connection slave;
+connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 1
@@ -117,6 +126,7 @@ slave: 7
slave: 8
slave: 10
slave: 11
+connection master;
drop procedure p1;
delete from t1;
delete from t2;
@@ -131,10 +141,13 @@ SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 1
master: 2
+connection slave;
+connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 1
slave: 2
+connection master;
drop view v1;
delete from t1;
prepare s1 from 'select f1(?)';
@@ -145,9 +158,12 @@ f1(?)
SELECT 'master:',a FROM t1 ORDER BY a;
master: a
master: 123
+connection slave;
+connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 123
+connection master;
delete from t1;
create procedure p1(spv int)
begin
@@ -166,12 +182,15 @@ master: 6
master: 6
master: 15
master: 15
+connection slave;
+connection slave;
SELECT 'slave:',a FROM t1 ORDER BY a;
slave: a
slave: 6
slave: 6
slave: 15
slave: 15
+connection master;
drop procedure p1;
drop function f1;
drop table t1,t2;
@@ -217,6 +236,8 @@ master 100
master 101
master 101
master 102
+connection slave;
+connection slave;
SELECT 'slave', a FROM t1 ORDER BY a;
slave a
slave 10
@@ -228,10 +249,13 @@ slave 100
slave 101
slave 101
slave 102
+connection master;
drop table t1;
drop function f1;
drop function f2;
drop procedure p1;
+connection slave;
+connection master;
create table t2 (b BIT(7));
create procedure sp_bug26199(bitvalue BIT(7))
begin
@@ -262,6 +286,7 @@ E
7F
7F
27
+connection slave;
select hex(b) from t2;
hex(b)
E
@@ -269,10 +294,12 @@ E
7F
7F
27
+connection master;
drop table t2;
drop procedure sp_bug26199;
drop function sf_bug26199;
SET @@global.log_bin_trust_function_creators= @old_log_bin_trust_function_creators;
+connection slave;
set names utf8;
CREATE FUNCTION f() RETURNS timestamp DETERMINISTIC
BEGIN RETURN '2012-12-21 12:12:12'; END |
diff --git a/mysql-test/suite/rpl/r/rpl_special_charset.result b/mysql-test/suite/rpl/r/rpl_special_charset.result
index 99b8d3a21d1..218ced9b8ea 100644
--- a/mysql-test/suite/rpl/r/rpl_special_charset.result
+++ b/mysql-test/suite/rpl/r/rpl_special_charset.result
@@ -3,6 +3,8 @@ include/master-slave.inc
call mtr.add_suppression("Cannot use utf16 as character_set_client");
CREATE TABLE t1(i VARCHAR(20));
INSERT INTO t1 VALUES (0xFFFF);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sporadic_master.result b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
index 1ec94964acf..32ae63750a7 100644
--- a/mysql-test/suite/rpl/r/rpl_sporadic_master.result
+++ b/mysql-test/suite/rpl/r/rpl_sporadic_master.result
@@ -5,12 +5,15 @@ create table t1(n int not null auto_increment primary key);
insert into t1 values (NULL),(NULL);
truncate table t1;
insert into t1 values (4),(NULL);
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+connection master;
insert into t1 values (NULL),(NULL);
flush logs;
truncate table t1;
insert into t1 values (10),(NULL),(NULL),(NULL),(NULL),(NULL);
+connection slave;
select * from t1 ORDER BY n;
n
10
@@ -19,5 +22,7 @@ n
13
14
15
+connection master;
drop table t1,t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_ssl.result b/mysql-test/suite/rpl/r/rpl_ssl.result
index f02fa4e7b9f..0b3a6cd0eca 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl.result
@@ -1,8 +1,10 @@
include/master-slave.inc
[connection master]
+connection master;
create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int auto_increment, KEY(t));
+connection slave;
stop slave;
change master to
master_user='replssl',
@@ -12,7 +14,9 @@ master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem',
master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem',
master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
+connection master;
insert into t1 values(1);
+connection slave;
select * from t1;
t
1
@@ -26,7 +30,9 @@ STOP SLAVE;
select * from t1;
t
1
+connection master;
insert into t1 values (NULL);
+connection slave;
include/wait_for_slave_to_start.inc
Master_SSL_Allowed = 'Yes'
Master_SSL_CA_Path = ''
@@ -34,8 +40,10 @@ Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
include/check_slave_is_running.inc
+connection master;
drop user replssl@localhost;
drop table t1;
+connection slave;
include/stop_slave.inc
CHANGE MASTER TO
master_user = 'root',
diff --git a/mysql-test/suite/rpl/r/rpl_ssl1.result b/mysql-test/suite/rpl/r/rpl_ssl1.result
index c9fe21a7929..1d55fe1259e 100644
--- a/mysql-test/suite/rpl/r/rpl_ssl1.result
+++ b/mysql-test/suite/rpl/r/rpl_ssl1.result
@@ -1,13 +1,17 @@
include/master-slave.inc
[connection master]
+connection master;
create user replssl@localhost;
grant replication slave on *.* to replssl@localhost require ssl;
create table t1 (t int);
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
change master to master_user='replssl',master_password='';
start slave;
+connection master;
insert into t1 values (1);
+connection slave;
select * from t1;
t
stop slave;
@@ -15,6 +19,8 @@ include/wait_for_slave_to_stop.inc
change master to master_ssl=1 , master_ssl_ca ='MYSQL_TEST_DIR/std_data/cacert.pem', master_ssl_cert='MYSQL_TEST_DIR/std_data/client-cert.pem', master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem';
start slave;
include/wait_for_slave_to_start.inc
+connection master;
+connection slave;
select * from t1;
t
1
@@ -29,14 +35,17 @@ include/wait_for_slave_to_stop.inc
change master to master_user='root',master_password='', master_ssl=0;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
drop user replssl@localhost;
drop table t1;
+connection slave;
Master_SSL_Allowed = 'No'
Master_SSL_CA_Path = ''
Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
include/check_slave_is_running.inc
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
change master to
@@ -48,8 +57,10 @@ master_ssl_key='MYSQL_TEST_DIR/std_data/client-key.pem',
master_ssl_verify_server_cert=1;
start slave;
include/wait_for_slave_to_start.inc
+connection master;
create table t1 (t int);
insert into t1 values (1);
+connection slave;
on slave
select * from t1;
t
@@ -60,7 +71,9 @@ Master_SSL_CA_File = 'MYSQL_TEST_DIR/std_data/cacert.pem'
Master_SSL_Cert = 'MYSQL_TEST_DIR/std_data/client-cert.pem'
Master_SSL_Key = 'MYSQL_TEST_DIR/std_data/client-key.pem'
include/check_slave_is_running.inc
+connection master;
drop table t1;
+connection slave;
include/stop_slave.inc
CHANGE MASTER TO
master_host="127.0.0.1",
diff --git a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
index b6cbdc9686b..c0140962a56 100644
--- a/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_start_stop_slave.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
set @time_before_kill := (select CURRENT_TIMESTAMP);
[Time before the query]
[Connection ID of the slave I/O thread found]
@@ -8,6 +9,9 @@ set @time_after_kill := (select CURRENT_TIMESTAMP);
[Time after the query]
[Killing of the slave IO thread was successful]
START SLAVE IO_THREAD;
+connection master;
create table t1 (a int primary key);
+connection slave;
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_000001.result b/mysql-test/suite/rpl/r/rpl_stm_000001.result
index 2401fda52f9..b8a14b380db 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_000001.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_000001.result
@@ -16,12 +16,17 @@ abandoned
abandoning
abandonment
abandons
+connection slave;
stop slave;
+connection master;
set password for root@"localhost" = password('foo');
+connection slave;
start slave;
+connection master;
set password for root@"localhost" = password('');
create table t3(n int);
insert into t3 values(1),(2);
+connection slave;
select * from t3;
n
1
@@ -29,31 +34,47 @@ n
select sum(length(word)) from t1;
sum(length(word))
1022
+connection master;
drop table t1,t3;
+connection slave;
+connection master;
create table t1 (n int) engine=myisam;
+connection slave;
+connection master;
reset master;
+connection slave;
stop slave;
reset slave;
+connection master;
+connection slave;
lock tables t1 read;
start slave;
+connection master;
include/sync_slave_io_with_master.inc
unlock tables;
+connection master;
create table t2(id int);
insert into t2 values(connection_id());
+connection master1;
create temporary table t3(n int);
insert into t3 select get_lock('crash_lock%20C', 1) from t2;
+connection master;
update t1 set n = n + get_lock('crash_lock%20C', 2);
+connection master1;
select (@id := id) - id from t2;
(@id := id) - id
0
kill @id;
drop table t2;
drop temporary table t3;
+connection master;
Got one of the listed errors
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1927]
select count(*) from t1;
count(*)
5000
+connection master1;
drop table t1;
create table t1 (n int);
insert into t1 values(3456);
@@ -71,12 +92,15 @@ update mysql.user set Select_priv = "Y" where User= _binary"blafasel2";
select select_priv,user from mysql.user where user = _binary'blafasel2';
select_priv user
Y blafasel2
+connection slave;
select n from t1;
n
3456
select select_priv,user from mysql.user where user = _binary'blafasel2';
select_priv user
Y blafasel2
+connection master1;
drop table t1;
delete from mysql.user where user="blafasel2";
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
index 1c479713c89..4d666c6e8bf 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_EE_err2.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
create table t1 (a int, unique(a)) engine=myisam;
set sql_log_bin=0;
insert into t1 values(2);
@@ -7,6 +8,7 @@ set sql_log_bin=1;
insert into t1 values(1),(2);
ERROR 23000: Duplicate entry '2' for key 'a'
drop table t1;
+connection slave;
include/wait_for_slave_sql_to_stop.inc
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.* error code=1062.*Error on slave:.* error.* 0");
Error: "Query caused different errors on master and slave. Error on master: message (format)='Duplicate entry '%-.192s' for key %d' error code=1062 ; Error on slave: actual message='no error', error code=0. Default database: 'test'. Query: 'insert into t1 values(1),(2)'" (expected different error codes on master and slave)
diff --git a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
index 129b944d840..6f8f2cf89d1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_auto_increment_bug33029.result
@@ -1,7 +1,9 @@
include/master-slave.inc
[connection master]
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection slave;
CALL mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection master;
CREATE TABLE t1 (id INT AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE t2 (id INT AUTO_INCREMENT PRIMARY KEY);
CREATE PROCEDURE p1()
@@ -106,7 +108,7 @@ id
10
SELECT * FROM t2;
id
-# Result on slave
+connection slave;
SELECT * FROM t1;
id
3
@@ -119,6 +121,7 @@ id
10
SELECT * FROM t2;
id
+connection master;
DROP TRIGGER tr1;
CALL p2();
Warnings:
@@ -170,7 +173,7 @@ id
17
18
19
-# Result on slave
+connection slave;
SELECT * FROM t1;
id
5
@@ -197,9 +200,11 @@ id
17
18
19
+connection master;
DROP TABLE IF EXISTS t1, t2;
DROP PROCEDURE IF EXISTS p1;
DROP PROCEDURE IF EXISTS p2;
DROP FUNCTION IF EXISTS f1;
DROP TRIGGER IF EXISTS tr1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
index 80f76169472..388c8e67b68 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_binlog_max_cache_size.result
@@ -5,12 +5,15 @@ SET GLOBAL max_binlog_cache_size = 4096;
SET GLOBAL binlog_cache_size = 4096;
SET GLOBAL max_binlog_stmt_cache_size = 4096;
SET GLOBAL binlog_stmt_cache_size = 4096;
+disconnect master;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
CREATE TABLE t1(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
CREATE TABLE t2(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=MyIsam;
CREATE TABLE t3(a INT PRIMARY KEY, data VARCHAR(30000)) ENGINE=Innodb;
########################################################################################
# 1 - SINGLE STATEMENT
########################################################################################
+connection master;
*** Single statement on transactional table ***
Got one of the listed errors
*** Single statement on non-transactional table ***
@@ -23,6 +26,7 @@ include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 2 - BEGIN - IMPLICIT COMMIT by DDL
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -49,10 +53,12 @@ INSERT INTO t1 (a, data) VALUES (27, 's');;
INSERT INTO t2 (a, data) VALUES (28, 's');;
INSERT INTO t1 (a, data) VALUES (29, 's');;
CREATE TABLE t5 (a int);
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 3 - BEGIN - COMMIT
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -61,10 +67,12 @@ Got one of the listed errors
Got one of the listed errors
Got one of the listed errors
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 4 - BEGIN - ROLLBACK
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -75,10 +83,12 @@ Got one of the listed errors
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 5 - PROCEDURE
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -99,10 +109,12 @@ TRUNCATE TABLE t1;
BEGIN;
Got one of the listed errors
ROLLBACK;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 6 - XID
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -117,10 +129,12 @@ ROLLBACK TO sv;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################################
# 7 - NON-TRANS TABLE
########################################################################################
+connection master;
TRUNCATE TABLE t1;
TRUNCATE TABLE t2;
TRUNCATE TABLE t3;
@@ -136,6 +150,7 @@ COMMIT;
BEGIN;
Got one of the listed errors
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
########################################################################
# 8 - Bug#55375(Regression Bug) Transaction bigger than
@@ -152,14 +167,20 @@ CALL mtr.add_suppression("Multi-statement transaction required more than 'max_bi
CALL mtr.add_suppression("Multi-statement transaction required more than 'max_binlog_stmt_cache_size' bytes of storage.*");
CALL mtr.add_suppression("Writing one row to the row-based binary log failed.*");
CALL mtr.add_suppression("Slave SQL.*The incident LOST_EVENTS occurred on the master. Message: error writing to the binary log");
+connection master;
TRUNCATE t1;
+connection slave;
+connection master;
SET GLOBAL max_binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_cache_size= ORIGINAL_VALUE;
SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
+disconnect master;
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
BEGIN;
Repeat statement 'INSERT INTO t1 VALUES($n, repeat("a", 32))' 128 times
COMMIT;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1197]
SELECT count(*) FROM t1;
count(*)
@@ -171,12 +192,15 @@ SET GLOBAL max_binlog_stmt_cache_size= ORIGINAL_VALUE;
SET GLOBAL binlog_stmt_cache_size= ORIGINAL_VALUE;
include/stop_slave.inc
include/start_slave.inc
+connection master;
+connection slave;
SELECT count(*) FROM t1;
count(*)
128
########################################################################################
# CLEAN
########################################################################################
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
index 07c5b0d445e..ae10c545ef6 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_conflicts.result
@@ -1,19 +1,19 @@
include/master-slave.inc
[connection master]
==== Initialize ====
-[on master]
+connection master;
CREATE TABLE t1(a INT PRIMARY KEY);
-[on slave]
+connection slave;
==== Test: SQL thread sees 'INSERT' of existing key ====
---- Prepare slave so that it will get duplicate key error ----
INSERT INTO t1 VALUES (1);
---- Insert rows on master ----
-[on master]
+connection master;
INSERT INTO t1 VALUES (1);
SELECT * FROM t1;
a
1
-[on slave]
+connection slave;
---- Wait until slave stops with an error ----
include/wait_for_slave_sql_error.inc [errno=1062]
Last_SQL_Error (expected "duplicate key" error)
@@ -33,23 +33,23 @@ a
1
==== Test: SQL thread sees 'DELETE' of non-existing row ====
---- On master, insert two rows, the second with binlogging off ----
-[on master]
+connection master;
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
-[on slave]
+connection slave;
DELETE FROM t1 WHERE a = 1;
---- On master, remove the row that does not exist on slave ----
-[on master]
+connection master;
DELETE FROM t1 WHERE a = 1;
SELECT * FROM t1;
a
-[on slave]
+connection slave;
---- Sync slave and verify that there is no error ----
Last_SQL_Error = (expected no error)
SELECT * FROM t1;
a
==== Clean up ====
-[on master]
+connection master;
DROP TABLE t1;
-[on slave]
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
index 9dc86c0bfa7..d63b00de30a 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_drop_create_temp_table.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT.");
SET @commands= 'configure';
+connection master;
CREATE TABLE tt_xx_1 ( id INT ) ENGINE = Innodb;
CREATE TABLE nt_xx_1 ( id INT ) ENGINE = MyIsam;
CREATE TABLE tt_error_1 ( id INT, PRIMARY KEY (id) ) ENGINE = Innodb;
@@ -54,6 +55,7 @@ SET @commands= '';
#########################################################################
# 1 - Tables dropped by "DROP TEMPORARY TABLE"
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1206,6 +1208,7 @@ master-bin.000001 # Query # # ROLLBACK
#########################################################################
# 2 - Tables dropped by "DROP TABLE"
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1541,6 +1544,7 @@ master-bin.000001 # Query # # use `test`; DROP TEMPORARY TABLE `tt_tmp_2` /* gen
#########################################################################
# 3 - CREATE TEMPORARY TABLE
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -1820,6 +1824,7 @@ master-bin.000001 # Query # # ROLLBACK
#########################################################################
# 4 - CHANGING TEMPORARY TABLES
#########################################################################
+connection master;
#
#1) Generates in the binlog what follows:
@@ -2210,10 +2215,13 @@ master-bin.000001 # Query # # ROLLBACK
###################################################################################
# CHECK CONSISTENCY
###################################################################################
+connection master;
+connection slave;
#########################################################################
# CLEAN
#########################################################################
SET @commands= 'clean';
+connection master;
DROP TABLE IF EXISTS tt_xx_1;
DROP TABLE IF EXISTS nt_xx_1;
DROP TABLE IF EXISTS tt_error_1;
@@ -2230,5 +2238,6 @@ DROP TEMPORARY TABLE IF EXISTS tt_tmp_1;
DROP TEMPORARY TABLE IF EXISTS nt_tmp_1;
DROP TABLE IF EXISTS tt_2;
DROP TABLE IF EXISTS tt_1;
+connection slave;
SET @commands= '';
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
index 27b23739831..660c736795b 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_flsh_tbls.result
@@ -15,11 +15,14 @@ master-bin.000001 # Query # # use `test`; rename table t1 to t5, t2 to t1
select * from t3;
a
flush tables;
+connection slave;
select * from t3;
a
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
drop table t1;
+connection slave;
flush tables with read lock;
start slave;
include/wait_for_slave_param.inc [Slave_IO_Running]
@@ -27,5 +30,6 @@ include/wait_for_slave_sql_to_start.inc
stop slave;
ERROR HY000: Can't execute the given command because you have active locked tables or an active transaction
unlock tables;
+connection master;
drop table t3, t4, t5;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
index eff96952918..68bdaaf52b8 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_found_rows.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialize ====
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT);
CREATE TABLE logtbl (sect INT, test INT, count INT);
INSERT INTO t1 VALUES (1),(2),(3);
@@ -26,13 +26,13 @@ SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
sect test count
1 1 183
1 2 3
-**** On Slave ****
+connection slave;
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
sect test count
1 1 183
1 2 3
==== Stored procedure ====
-**** On Master ****
+connection master;
CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN
DECLARE cnt INT;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1;
@@ -60,14 +60,14 @@ sect test count
2 1 3
2 2 183
2 3 183
-**** On Slave ****
+connection slave;
SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test;
sect test count
2 1 3
2 2 183
2 3 183
==== Stored functions ====
-**** On Master ****
+connection master;
CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT)
RETURNS INT
BEGIN
@@ -85,13 +85,13 @@ SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test;
sect test count
3 1 183
3 2 183
-**** On Slave ****
+connection slave;
SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test;
sect test count
3 1 183
3 2 183
==== Cleanup ====
-**** On Master ****
+connection master;
DROP TABLE t1, logtbl;
DROP PROCEDURE just_log;
DROP PROCEDURE calc_and_log;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
index cb702ad64ef..3d5a6964be4 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_implicit_commit_binlog.result
@@ -4,6 +4,7 @@ set session storage_engine=innodb;
#########################################################################
# CONFIGURATION
#########################################################################
+connection master;
CREATE TABLE tt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb;
CREATE TABLE tt_2 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = Innodb;
CREATE TABLE nt_1 (ddl_case INT, PRIMARY KEY(ddl_case)) ENGINE = MyIsam;
diff --git a/mysql-test/suite/rpl/r/rpl_stm_innodb.result b/mysql-test/suite/rpl/r/rpl_stm_innodb.result
index 6f54b232e71..7e37277a825 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_innodb.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t4 (
id INT(5) unsigned NOT NULL auto_increment,
name varchar(15) NOT NULL default '',
@@ -15,10 +16,12 @@ SELECT * FROM t4;
id name number
1 XXX 12345
2 XXY 12345
+connection slave;
SELECT * FROM t4;
id name number
1 XXX 12345
2 XXY 12345
+connection master;
LOAD DATA
INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
@@ -27,25 +30,32 @@ SELECT * FROM t4;
id name number
4 XXX 12345
5 XXY 12345
+connection slave;
SELECT * FROM t4;
id name number
4 XXX 12345
5 XXY 12345
+connection master;
+connection slave;
+connection master;
FLUSH LOGS;
+connection slave;
FLUSH LOGS;
+connection master;
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT);
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="InnoDB";
SET AUTOCOMMIT = 0;
--------- switch to slave --------
+connection slave;
+connection slave;
ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
--------- switch to master --------
+connection master;
INSERT INTO mysqltest1.t1 SET f1= 1;
DROP TEMPORARY TABLE mysqltest1.tmp;
ROLLBACK;
@@ -67,7 +77,8 @@ tmp2 CREATE TEMPORARY TABLE `tmp2` (
SELECT COUNT(*) FROM mysqltest1.t1;
COUNT(*)
0
--------- switch to slave --------
+connection slave;
+connection slave;
SHOW CREATE TABLE mysqltest1.tmp;
ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
SHOW CREATE TABLE mysqltest1.tmp2;
@@ -77,7 +88,7 @@ SELECT COUNT(*) FROM mysqltest1.t1;
COUNT(*)
2
FLUSH LOGS;
--------- switch to master --------
+connection master;
FLUSH LOGS;
DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
DROP DATABASE mysqltest1;
@@ -100,12 +111,12 @@ b INT DEFAULT NULL
INSERT INTO t1 (b) VALUES (1),(2),(3);
BEGIN;
INSERT INTO t1(b) VALUES (4);
--------- switch to master1 --------
+connection master1;
RENAME TABLE t1 TO t3, t2 TO t1;;
--------- switch to master --------
+connection master;
COMMIT;
--------- switch to master1 --------
--------- switch to master --------
+connection master1;
+connection master;
SELECT * FROM t1;
id b
SELECT * FROM t3;
@@ -114,7 +125,8 @@ id b
2 2
3 3
4 4
--------- switch to slave --------
+connection slave;
+connection slave;
SELECT * FROM t1;
id b
SELECT * FROM t3;
@@ -123,7 +135,7 @@ id b
2 2
3 3
4 4
--------- switch to master --------
+connection master;
DROP TABLE t1;
DROP TABLE t3;
End of 6.0 tests
diff --git a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
index ab6f63845a5..f510eae74f8 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result
@@ -29,6 +29,7 @@ create temporary table t2 (day date,id int(9),category enum('a','b','c'),name va
load data CONCURRENT 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;
+connection slave;
select * from t1;
a b
1 10
@@ -38,20 +39,26 @@ day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
2003-03-22 2416 a bbbbb
+connection master;
drop table t1;
drop table t2;
drop table t3;
create table t1(a int, b int, unique(b));
+connection slave;
insert into t1 values(1,10);
+connection master;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
call mtr.add_suppression("Slave SQL.*Error .Duplicate entry .10. for key .b.. on query.* error.* 1062");
call mtr.add_suppression("Slave SQL.*Query caused different errors on master and slave.*Error on master:.*error code=1062.*Error on slave:.*error.* 0");
include/wait_for_slave_sql_error_and_skip.inc [errno=1062]
include/check_slave_no_error.inc
+connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
include/stop_slave_io.inc
change master to master_user='test';
@@ -59,14 +66,17 @@ change master to master_user='root';
include/check_slave_no_error.inc
set global sql_slave_skip_counter=1;
start slave;
+connection master;
set sql_log_bin=0;
delete from t1;
set sql_log_bin=1;
load data CONCURRENT infile '../../std_data/rpl_loaddata.dat' into table t1;
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1062]
stop slave;
reset slave;
include/check_slave_no_error.inc
+connection master;
reset master;
create table t2 (day date,id int(9),category enum('a','b','c'),name varchar(60),
unique(day)) engine=MyISAM;
@@ -78,25 +88,30 @@ select * from t2;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
+connection slave;
start slave;
select * from t2;
day id category name
2003-02-22 2461 b a a a @ %  ' " a
2003-03-22 2161 c asdf
alter table t2 drop key day;
+connection master;
delete from t2;
load data CONCURRENT 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;
ERROR 23000: Duplicate entry '2003-03-22' for key 'day'
+connection slave;
include/wait_for_slave_sql_error.inc [errno=0]
drop table t1, t2;
+connection master;
drop table t1, t2;
CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
LOAD DATA CONCURRENT INFILE "../../std_data/words.dat" INTO TABLE t1;
ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
DROP TABLE t1;
include/rpl_reset.inc
+connection master;
drop database if exists b48297_db1;
drop database if exists b42897_db2;
create database b48297_db1;
@@ -112,15 +127,21 @@ LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO
### assertion: works without fully qualified name on current database
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE t1;
### create connection without default database
-### connect (conn2,localhost,root,,*NO-ONE*);
+connect conn2,localhost,root,,*NO-ONE*;
+connection conn2;
### assertion: works without stating the default database
LOAD DATA CONCURRENT LOCAL INFILE 'MYSQLTEST_VARDIR/std_data/loaddata5.dat' INTO TABLE b48297_db1.t1;
-### disconnect and switch back to master connection
+disconnect conn2;
+connection master;
+connection slave;
use b48297_db1;
include/diff_tables.inc [master:b48297_db1.t1, slave:b48297_db1.t1]
+connection master;
DROP DATABASE b48297_db1;
DROP DATABASE b42897_db2;
+connection slave;
include/rpl_reset.inc
+connection master;
use test;
CREATE TABLE t1 (`key` TEXT, `text` TEXT);
LOAD DATA INFILE '../../std_data/loaddata2.dat' REPLACE INTO TABLE `t1` FIELDS TERMINATED BY ',';
@@ -131,5 +152,7 @@ Field 1 'Field 2'
Field 3 'Field 4'
'Field 5' 'Field 6'
Field 6 'Field 7'
+connection slave;
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
index 72fae5ce6ee..d0332b6b3b1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_loadfile.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE IF EXISTS test.t1;
CREATE TABLE test.t1 (a INT, blob_column LONGBLOB, PRIMARY KEY(a));
@@ -119,6 +120,8 @@ Abernathy
aberrant
aberration
+connection slave;
+connection slave;
SELECT * FROM test.t1 ORDER BY blob_column;
a blob_column
1 abase
@@ -223,6 +226,8 @@ Abernathy
aberrant
aberration
+connection master;
DROP PROCEDURE IF EXISTS test.p1;
DROP TABLE test.t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_log.result b/mysql-test/suite/rpl/r/rpl_stm_log.result
index da925035c9c..bfa39abdcfc 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_log.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_log.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection slave;
set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode;
set @@global.slave_ddl_exec_mode=STRICT;
+connection master;
create table t1(n int not null auto_increment primary key)ENGINE=MyISAM;
insert into t1 values (NULL);
drop table t1;
@@ -49,6 +52,7 @@ master-bin.000001 # Query # # use `test`; insert into t1 values (NULL)
master-bin.000001 # Query # # COMMIT
flush logs;
create table t3 (a int)ENGINE=MyISAM;
+connection master;
select * from t1 order by 1 asc;
word
Aarhus
@@ -120,6 +124,7 @@ Aberdeen
Abernathy
aberrant
aberration
+connection slave;
select * from t1 order by 1 asc;
word
Aarhus
@@ -194,6 +199,7 @@ aberration
flush logs;
include/stop_slave.inc
include/start_slave.inc
+connection master;
create table t2 (n int)ENGINE=MyISAM;
insert into t2 values (1);
include/show_binlog_events.inc
@@ -227,6 +233,7 @@ show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
+connection slave;
show binary logs;
Log_name File_size
slave-bin.000001 #
@@ -261,10 +268,12 @@ slave-bin.000002 # Query # # COMMIT
include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
include/rpl_reset.inc
+connection master;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -288,5 +297,7 @@ a b
5 1
6 1
drop table t1;
+connection slave;
set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_maria.result b/mysql-test/suite/rpl/r/rpl_stm_maria.result
index 7a9dfcd6061..dd444e1fdd7 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_maria.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_maria.result
@@ -45,5 +45,8 @@ a name old_a old_b truncate(rand_value,4)
105 t2 4 0 0.6635
106 t2 5 0 0.6699
107 t2 500 0 0.3593
+connection slave;
+connection master;
drop table t1,t2,t3;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
index 88d68bb50ee..41d18d7f9fe 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_max_relay_size.result
@@ -1,11 +1,14 @@
include/master-slave.inc
[connection master]
+connection slave;
stop slave;
+connection master;
#
# Generate a big enough master's binlog to cause relay log rotations
#
create table t1 (a int);
drop table t1;
+connection slave;
reset slave;
#
# Test 1
@@ -54,18 +57,24 @@ flush logs;
reset slave;
start slave;
flush logs;
+connection master;
create table t1 (a int);
+connection slave;
include/check_slave_is_running.inc
#
# Test 6: one more rotation, to be sure Relay_Log_Space is correctly updated
#
flush logs;
+connection master;
drop table t1;
+connection slave;
include/check_slave_is_running.inc
+connection master;
flush logs;
show master status;
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000002 # <Binlog_Do_DB> <Binlog_Ignore_DB>
+connection slave;
set global max_binlog_size= @my_max_binlog_size;
set global max_relay_log_size= @my_max_relay_log_size;
#
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
index 69e144b5cd1..627dfb066ba 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mix_show_relaylog_events.result
@@ -1,6 +1,8 @@
include/master-slave.inc
[connection master]
+connection master;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (2);
@@ -44,6 +46,7 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
+connection slave;
******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -117,6 +120,7 @@ include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-relay-bin.000001 # Rotate # # slave-relay-bin.000002;pos=POS
FLUSH LOGS;
+connection master;
FLUSH LOGS;
DROP TABLE t1;
******** [master] SHOW BINLOG EVENTS IN <FILE> ********
@@ -149,6 +153,7 @@ master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (3)
master-bin.000001 # Query # # COMMIT
master-bin.000001 # Rotate # # master-bin.000002;pos=POS
+connection slave;
******** [slave] SHOW BINLOG EVENTS IN <FILE> ********
include/show_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
diff --git a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
index 1cf49b30fcd..79a01809cbd 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_mixing_engines.result
@@ -5,6 +5,7 @@ include/master-slave.inc
#########################################################################
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
rpl_mixing_engines.inc [commands=configure]
+connection master;
CREATE TABLE nt_1 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_2 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
CREATE TABLE nt_3 (trans_id INT, stmt_id INT, info VARCHAR(64), PRIMARY KEY(trans_id, stmt_id)) ENGINE = MyISAM;
@@ -109,6 +110,7 @@ END|
#########################################################################
# 1 - MIXING TRANSACTIONAL and NON-TRANSACTIONAL TABLES
#########################################################################
+connection master;
@@ -12894,7 +12896,9 @@ DROP PROCEDURE pc_i_nt_5_suc;
DROP FUNCTION fc_i_tt_5_suc;
DROP FUNCTION fc_i_nt_5_suc;
DROP FUNCTION fc_i_nt_3_tt_3_suc;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE `t1` (
`c1` int(10) unsigned NOT NULL AUTO_INCREMENT,
`c2` tinyint(1) unsigned DEFAULT NULL,
@@ -12902,12 +12906,17 @@ CREATE TABLE `t1` (
`c4` int(10) unsigned NOT NULL,
`c5` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`c1`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+connection slave;
ALTER TABLE `t1` Engine=InnoDB;
+connection master;
SET AUTOCOMMIT=0;
INSERT INTO t1 (c1,c2,c3,c4,c5) VALUES (1, 1, 'X', 1, NULL);
COMMIT;
ROLLBACK;
SET AUTOCOMMIT=1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE `t1`;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
index c893ff39a6c..3618c0302f2 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_multi_query.result
@@ -7,6 +7,7 @@ insert into mysqltest.t1 values(2);
insert into mysqltest.t1 values(3);
insert into mysqltest.t1 values(4);
insert into mysqltest.t1 values(5)/
+connection slave;
select * from mysqltest.t1;
n
1
@@ -14,6 +15,7 @@ n
3
4
5
+connection master;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_stm_no_op.result b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
index 52e893d616b..2505660f863 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_no_op.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_no_op.result
@@ -1,49 +1,71 @@
include/master-slave.inc
[connection master]
+connection slave;
create database mysqltest;
+connection master;
drop database if exists mysqltest;
Warnings:
Note 1008 Can't drop database 'mysqltest'; database doesn't exist
+connection slave;
show tables from mysqltest;
ERROR 42000: Unknown database 'mysqltest'
+connection slave;
create table t1 (a int);
+connection master;
drop table if exists t1;
Warnings:
Note 1051 Unknown table 'test.t1'
+connection slave;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
+connection master;
create table t1 (a int, b int);
+connection slave;
insert into t1 values(1,1);
+connection master;
delete from t1;
+connection slave;
select * from t1;
a b
insert into t1 values(1,1);
+connection master;
insert into t1 values(2,1);
update t1 set a=2;
+connection slave;
select * from t1;
a b
2 1
2 1
+connection master;
create table t2 (a int, b int);
delete from t1;
insert into t1 values(1,1);
insert into t2 values(1,1);
+connection slave;
update t1 set a=2;
+connection master;
UPDATE t1, t2 SET t1.a = t2.a;
+connection slave;
select * from t1;
a b
1 1
select * from t2;
a b
1 1
+connection master;
delete from t1;
delete from t2;
+connection slave;
insert into t1 values(1,1);
insert into t2 values(1,1);
+connection master;
DELETE t1.*, t2.* from t1, t2;
+connection slave;
select * from t1;
a b
select * from t2;
a b
+connection master;
drop table t1, t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result b/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result
index 7820f1ef97f..3113eec9e10 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_relay_ign_space.result
@@ -2,4 +2,5 @@ include/master-slave.inc
[connection master]
include/assert.inc [Assert that relay log space is close to the limit]
include/diff_tables.inc [master:test.t1,slave:test.t1]
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
index 7eb29085099..1ba2d1b624b 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_reset_slave.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
Master_User = 'root'
Master_Host = '127.0.0.1'
include/stop_slave.inc
@@ -16,14 +17,18 @@ Master_Host = '127.0.0.1'
include/stop_slave.inc
reset slave;
include/start_slave.inc
+connection master;
create temporary table t1 (a int);
+connection slave;
include/stop_slave.inc
reset slave;
include/start_slave.inc
show status like 'slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
+connection master;
drop temporary table if exists t1;
+connection slave;
include/stop_slave.inc
reset slave;
include/check_slave_no_error.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result b/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
index fa5ac2a0c85..8a28eca37b8 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_sql_mode.result
@@ -12,4 +12,5 @@ DROP TABLE t1;
# assertion: sync slave with master makes slave not to stop with
# duplicate key error (because it has received event
# with expected error code).
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
index 2aa2ee3b573..74e1bc8d3c0 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_start_stop_slave.result
@@ -1,20 +1,31 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
SET @@global.innodb_flush_log_at_trx_commit= 0;
+connection master;
SET @old_innodb_flush_log_at_trx_commit= @@global.innodb_flush_log_at_trx_commit;
SET @@global.innodb_flush_log_at_trx_commit= 0;
SET @@session.binlog_direct_non_transactional_updates= FALSE;
+connection master;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection slave;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
+connection master;
create table t1(n int);
+connection slave;
stop slave;
include/wait_for_slave_to_stop.inc
+connection master;
+connection slave;
start slave;
stop slave io_thread;
start slave io_thread;
include/wait_for_slave_to_start.inc
+connection master;
drop table t1;
+connection slave;
+connection master;
create table t1i(n int primary key) engine=innodb;
create table t2m(n int primary key) engine=myisam;
begin;
@@ -22,8 +33,11 @@ insert into t1i values (1);
insert into t1i values (2);
insert into t1i values (3);
commit;
+connection slave;
+connection slave;
begin;
insert into t1i values (5);
+connection master;
begin;
insert into t1i values (4);
insert into t2m values (1);
@@ -31,12 +45,18 @@ Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
insert into t1i values (5);
commit;
+connection slave;
zero
0
+connection slave1;
stop slave;
+connection slave;
rollback;
+connection slave1;
include/wait_for_slave_to_stop.inc
*** sql thread is *not* running: No ***
+connection master;
+connection slave;
*** the prove: the stopped slave has finished the current transaction ***
five
5
@@ -45,31 +65,44 @@ zero
one
1
include/start_slave.inc
+connection master;
drop table t1i, t2m;
+connection slave;
#
# Bug#56096 STOP SLAVE hangs if executed in parallel with user sleep
#
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT );
-# Slave1: lock table for synchronization
+connection slave;
+connection slave1;
+# lock table for synchronization
LOCK TABLES t1 WRITE;
-# Master: insert into the table
+connection master;
+# insert into the table
INSERT INTO t1 SELECT SLEEP(4);
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
+connection slave;
# Slave: wait for the insert
-# Slave: send slave stop
+# send slave stop
STOP SLAVE;
-# Slave1: wait for stop slave
+connection slave1;
+# wait for stop slave
# Slave1: unlock the table
UNLOCK TABLES;
-# Slave: wait for the slave to stop
+connection slave;
+# wait for the slave to stop
include/wait_for_slave_to_stop.inc
# Start slave again
include/start_slave.inc
# Clean up
+connection master;
DROP TABLE t1;
+connection slave;
+connection master;
RESET MASTER;
+connection slave;
include/stop_slave.inc
CHANGE MASTER TO master_log_pos=MASTER_POS;
START SLAVE;
@@ -78,8 +111,11 @@ Last_IO_Errno = '1236'
Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position; the first event 'master-bin.000001' at XXX, the last event read from 'master-bin.000001' at XXX, the last byte read from 'master-bin.000001' at XXX.''
include/stop_slave.inc
RESET SLAVE;
+connection master;
RESET MASTER;
+connection slave;
SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
+connection master;
SET @@global.innodb_flush_log_at_trx_commit= @old_innodb_flush_log_at_trx_commit;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
index e72d8a53a42..a7cf6c612d1 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_stop_middle_group.result
@@ -1,16 +1,20 @@
include/master-slave.inc
[connection master]
SET @@session.binlog_direct_non_transactional_updates= FALSE;
+connection master;
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
create table tm (a int auto_increment primary key) engine=myisam;
create table ti (a int auto_increment primary key) engine=innodb;
+connection slave;
set @@global.debug_dbug="+d,stop_slave_middle_group";
+connection master;
begin;
insert into ti set a=null;
insert into tm set a=null;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
commit;
+connection slave;
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
call mtr.add_suppression("Slave SQL.*Slave SQL Thread stopped with incomplete event group having non-transactional changes");
include/wait_for_slave_sql_to_stop.inc
@@ -25,16 +29,20 @@ one
1
set @@global.debug_dbug="-d";
include/start_slave.inc
+connection master;
truncate table tm;
truncate table ti;
+connection slave;
set @@global.debug_dbug="+d,stop_slave_middle_group";
set @@global.debug_dbug="+d,incomplete_group_in_relay_log";
+connection master;
begin;
insert into ti set a=null;
insert into tm set a=null;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it accesses a non-transactional table after accessing a transactional table within the same transaction.
commit;
+connection slave;
include/wait_for_slave_sql_to_stop.inc
SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
@@ -49,9 +57,13 @@ set @@global.debug_dbug="-d";
stop slave;
truncate table tm;
include/start_slave.inc
+connection master;
+connection slave;
set @@global.debug_dbug="+d,stop_slave_middle_group";
set @@global.debug_dbug="+d,incomplete_group_in_relay_log";
+connection master;
update tm as t1, ti as t2 set t1.a=t1.a * 2, t2.a=t2.a * 2;
+connection slave;
include/wait_for_slave_sql_to_stop.inc
SELECT "Fatal error: ... Slave SQL Thread stopped with incomplete event group having non-transactional changes. If the group consists solely of row-based events, you can try to restart the slave with --slave-exec-mode=IDEMPOTENT, which ignores duplicate key, key not found, and similar errors (see documentation for details)." AS Last_SQL_Error, @check as `true`;
Last_SQL_Error true
@@ -64,5 +76,7 @@ one
1
set @@global.debug_dbug="-d";
include/rpl_reset.inc
+connection master;
drop table tm, ti;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_until.result b/mysql-test/suite/rpl/r/rpl_stm_until.result
index 967acb540bd..65f188c11a0 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_until.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_until.result
@@ -2,10 +2,10 @@ include/master-slave.inc
[connection master]
include/rpl_reset.inc
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
-[on slave]
+connection slave;
include/stop_slave.inc
==== Create some events on master ====
-[on master]
+connection master;
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
drop table t1;
@@ -14,7 +14,7 @@ insert into t2 values (1),(2);
insert into t2 values (3),(4);
drop table t2;
==== Replicate one event at a time on slave ====
-[on slave]
+connection slave;
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
include/wait_for_slave_io_to_start.inc
include/wait_for_slave_sql_to_stop.inc
@@ -44,8 +44,8 @@ n
2
include/check_slave_param.inc [Exec_Master_Log_Pos]
start slave;
-[on master]
-[on slave]
+connection master;
+connection slave;
include/stop_slave.inc
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos=MASTER_LOG_POS;
include/wait_for_slave_io_to_start.inc
@@ -66,24 +66,29 @@ start slave sql_thread;
start slave until master_log_file='master-bin.000001', master_log_pos=776;
Warnings:
Note 1254 Slave is already running
+connection slave;
include/stop_slave.inc
drop table if exists t1;
reset slave;
change master to master_host='127.0.0.1',master_port=MASTER_PORT, master_user='root';
+connection master;
drop table if exists t1;
reset master;
create table t1 (a int primary key auto_increment);
+connection slave;
start slave;
include/stop_slave.inc
master and slave are in sync now
select 0 as zero;
zero
0
+connection master;
insert into t1 set a=null;
insert into t1 set a=null;
select count(*) as two from t1;
two
2
+connection slave;
start slave until master_log_file='MASTER_LOG_FILE', master_log_pos= UNTIL_POS;;
include/wait_for_slave_sql_to_stop.inc
slave stopped at the prescribed position
@@ -93,6 +98,8 @@ zero
select count(*) as one from t1;
one
1
+connection master;
drop table t1;
+connection slave;
start slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
index efb0f051fd4..5f31cff94cf 100644
--- a/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_stm_user_variables.result
@@ -20,7 +20,6 @@ CREATE TABLE t1 (`tinyint` TINYINT,
### a) declarative
INSERT INTO t1 VALUES (18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615,18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615, 18446744073709551615);;
#########################################
-#### [ on master ]
SELECT * FROM t1;
tinyint 127
smallint 32767
@@ -36,7 +35,7 @@ double 1.8446744073709552e19
float 1.84467e19
real 18446744073709552000.00
decimal 18446744073709551615.00
-#### [ on slave ]
+connection slave;
SELECT * FROM t1;
tinyint 127
smallint 32767
@@ -53,8 +52,10 @@ float 1.84467e19
real 18446744073709552000.00
decimal 18446744073709551615.00
#########################################
+connection master;
## assertion: master and slave tables are in sync
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
TRUNCATE t1;
### b) user var
INSERT INTO t1 VALUES (@positive,
@@ -72,7 +73,6 @@ INSERT INTO t1 VALUES (@positive,
@positive,
@positive);
#########################################
-#### [ on master ]
SELECT * FROM t1;
tinyint 127
smallint 32767
@@ -88,7 +88,7 @@ double 1.8446744073709552e19
float 1.84467e19
real 18446744073709552000.00
decimal 18446744073709551615.00
-#### [ on slave ]
+connection slave;
SELECT * FROM t1;
tinyint 127
smallint 32767
@@ -105,14 +105,15 @@ float 1.84467e19
real 18446744073709552000.00
decimal 18446744073709551615.00
#########################################
+connection master;
## assertion: master and slave tables are in sync
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
TRUNCATE t1;
### insert min signed
### a) declarative
INSERT INTO t1 VALUES (-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808,-9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808, -9223372036854775808);;
#########################################
-#### [ on master ]
SELECT * FROM t1;
tinyint -128
smallint -32768
@@ -128,7 +129,7 @@ double -9.223372036854776e18
float -9.22337e18
real -9223372036854776000.00
decimal -9223372036854775808.00
-#### [ on slave ]
+connection slave;
SELECT * FROM t1;
tinyint -128
smallint -32768
@@ -145,8 +146,10 @@ float -9.22337e18
real -9223372036854776000.00
decimal -9223372036854775808.00
#########################################
+connection master;
## assertion: master and slave tables are in sync
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
TRUNCATE t1;
### b) user var
INSERT INTO t1 VALUES (@negative,
@@ -164,7 +167,6 @@ INSERT INTO t1 VALUES (@negative,
@negative,
@negative);
#########################################
-#### [ on master ]
SELECT * FROM t1;
tinyint -128
smallint -32768
@@ -180,7 +182,7 @@ double -9.223372036854776e18
float -9.22337e18
real -9223372036854776000.00
decimal -9223372036854775808.00
-#### [ on slave ]
+connection slave;
SELECT * FROM t1;
tinyint -128
smallint -32768
@@ -197,27 +199,36 @@ float -9.22337e18
real -9223372036854776000.00
decimal -9223372036854775808.00
#########################################
+connection master;
## assertion: master and slave tables are in sync
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
TRUNCATE t1;
## check: contents of both tables master's and slave's
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 ( c INT, PRIMARY KEY (c)) Engine=MyISAM;
CREATE TRIGGER tr1 AFTER INSERT ON t1 FOR EACH ROW SET @aux = -1 ;
SET @aux = 10294947273192243200;
SET @aux1= @aux;
INSERT INTO t1 VALUES (@aux) , (@aux1);
ERROR 23000: Duplicate entry '2147483647' for key 'PRIMARY'
+connection slave;
## assertion: master and slave tables are in sync
include/diff_tables.inc [master:t1,slave:t1]
+connection master;
DROP TRIGGER tr1;
DROP TABLE t1;
+connection slave;
# The GET DIAGNOSTICS itself is not replicated, but it can set
# variables which can be used in statements that are replicated.
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a INT, b INT);
GET DIAGNOSTICS @var1 = NUMBER;
INSERT INTO t1 VALUES (@var1, 0), (@var1, 0);
@@ -230,12 +241,15 @@ GET DIAGNOSTICS count = ROW_COUNT;
INSERT INTO t1 VALUES (1, count);
END|
CALL p1();
-# On slave, check if the statement was replicated.
+connection slave;
+connection slave;
+# check if the statement was replicated.
SELECT * FROM t1 ORDER BY a;
a b
0 2
0 2
1 2
+connection master;
# Show events and cleanup
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
@@ -261,4 +275,5 @@ master-bin.000001 # Query # # use `test`; INSERT INTO t1 VALUES (1, NAME_CONST(
master-bin.000001 # Query # # COMMIT
DROP TABLE t1;
DROP PROCEDURE p1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_stop_slave.result b/mysql-test/suite/rpl/r/rpl_stop_slave.result
index b93ecce3597..2417c5abda8 100644
--- a/mysql-test/suite/rpl/r/rpl_stop_slave.result
+++ b/mysql-test/suite/rpl/r/rpl_stop_slave.result
@@ -8,6 +8,7 @@ include/master-slave.inc
# STOP SLAVE should wait until the transaction has finished.
CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+connection slave;
SET DEBUG_SYNC= 'RESET';
include/stop_slave.inc
@@ -19,36 +20,34 @@ include/start_slave.inc
# CREATE TEMPORARY TABLE with InnoDB engine
# -----------------------------------------
-
-[ On Master ]
+connection master;
BEGIN;
DELETE FROM t1;
CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE tt1;
COMMIT;
-
-[ On Slave ]
+connection slave;
STOP SLAVE SQL_THREAD;
-
-[ On Slave1 ]
+connection slave1;
# To resume slave SQL thread
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
SET DEBUG_SYNC= 'RESET';
-
-[ On Slave ]
+connection slave;
include/wait_for_slave_sql_to_stop.inc
# Slave should stop after the transaction has committed.
# So t1 on master is same to t1 on slave.
include/diff_tables.inc [master:t1, slave:t1]
+connection slave;
START SLAVE SQL_THREAD;
include/wait_for_slave_sql_to_start.inc
+connection master;
+connection slave;
# CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
# ----------------------------------------------------
-
-[ On Master ]
+connection master;
BEGIN;
DELETE FROM t1;
CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
@@ -56,28 +55,29 @@ SELECT c1 FROM t2;
INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE tt1;
COMMIT;
-
-[ On Slave ]
+connection slave;
STOP SLAVE SQL_THREAD;
-
-[ On Slave1 ]
+connection slave1;
# To resume slave SQL thread
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
SET DEBUG_SYNC= 'RESET';
-
-[ On Slave ]
+connection slave;
include/wait_for_slave_sql_to_stop.inc
# Slave should stop after the transaction has committed.
# So t1 on master is same to t1 on slave.
include/diff_tables.inc [master:t1, slave:t1]
+connection slave;
START SLAVE SQL_THREAD;
include/wait_for_slave_sql_to_start.inc
+connection master;
+connection slave;
# Test end
include/restart_slave.inc
+connection slave;
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
-[connection master]
+connection master;
DROP TABLE t1, t2;
# Bug#58546 test rpl_packet timeout failure sporadically on PB
@@ -94,35 +94,36 @@ DROP TABLE t1, t2;
CREATE TABLE t1 (c1 INT KEY, c2 INT) ENGINE=InnoDB;
CREATE TABLE t2 (c1 INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES(1, 1);
+connection slave;
include/stop_slave.inc
-[connection master]
+connection master;
include/stop_dump_threads.inc
SET GLOBAL debug_dbug= '+d,dump_thread_wait_before_send_xid,*';
-[connection slave]
+connection slave;
include/start_slave.inc
BEGIN;
UPDATE t1 SET c2 = 2 WHERE c1 = 1;
-[connection master]
+connection master;
BEGIN;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t2 VALUES(1);
UPDATE t1 SET c2 = 3 WHERE c1 = 1;
COMMIT;
-[connection slave1]
+connection slave1;
STOP SLAVE;
-[connection slave]
+connection slave;
ROLLBACK;
-[connection master]
+connection master;
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
-[connection slave]
+connection slave;
include/wait_for_slave_to_stop.inc
-[connection slave1]
-[connection master]
+connection slave1;
+connection master;
include/stop_dump_threads.inc
-[connection slave1]
+connection slave1;
include/start_slave.inc
-[connection master]
+connection master;
DROP TABLE t1, t2;
include/rpl_end.inc
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
index 7fcb0601ebf..6c709945111 100644
--- a/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
+++ b/mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result
@@ -1,5 +1,7 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection master;
drop database if exists mysqltest1;
create database mysqltest1;
use mysqltest1;
@@ -255,6 +257,8 @@ insert delayed into t2 values("delay_6_");
insert delayed into t2 values(rand());
set @a=2.345;
insert delayed into t2 values(@a);
+connection slave;
+connection master;
create table t20 select * from t1;
create table t21 select * from t2;
create table t22 select * from t3;
@@ -271,14 +275,18 @@ end|
select f("try_41_");
f("try_41_")
1
+connection slave;
use mysqltest1;
insert into t2 values(2,null),(3,null),(4,null);
delete from t2 where a>=2;
+connection master;
select f("try_42_");
f("try_42_")
1
+connection slave;
insert into t2 values(3,null),(4,null);
delete from t2 where a>=3;
+connection master;
prepare stmt1 from 'select f(?)';
set @string="try_43_";
insert into t1 values(null,"try_44_");
@@ -286,6 +294,8 @@ execute stmt1 using @string;
f(?)
1
deallocate prepare stmt1;
+connection slave;
+connection master;
create table t12 select * from t1;
drop table t1;
create table t1 (a int, b varchar(100), key(a));
@@ -311,12 +321,16 @@ end|
select f1("try_46_"),f2("try_47_");
f1("try_46_") f2("try_47_")
1 1
+connection slave;
insert into t2 values(2,null),(3,null),(4,null);
delete from t2 where a>=2;
+connection master;
select f1("try_48_"),f2("try_49_");
f1("try_48_") f2("try_49_")
1 1
insert into t3 values(concat("try_50_",f1("try_51_"),f2("try_52_")));
+connection slave;
+connection master;
drop function f2;
create function f2 (x varchar(100)) returns int deterministic
begin
@@ -328,6 +342,8 @@ end|
select f1("try_53_"),f2("try_54_");
f1("try_53_") f2("try_54_")
1 3
+connection slave;
+connection master;
drop function f2;
create trigger t1_bi before insert on t1 for each row
begin
@@ -336,12 +352,16 @@ end|
insert into t1 values(null,"try_56_");
alter table t1 modify a int, drop primary key;
insert into t1 values(null,"try_57_");
+connection slave;
+connection master;
CREATE TEMPORARY TABLE t15 SELECT UUID();
create table t16 like t15;
INSERT INTO t16 SELECT * FROM t15;
insert into t16 values("try_65_");
drop table t15;
insert into t16 values("try_66_");
+connection slave;
+connection master;
select count(*) from t1;
count(*)
7
@@ -381,6 +401,8 @@ count(*)
select count(*) from t16;
count(*)
3
+connection slave;
+connection master;
DROP TABLE IF EXISTS t11;
SET SESSION BINLOG_FORMAT=STATEMENT;
CREATE TABLE t11 (song VARCHAR(255));
@@ -393,16 +415,20 @@ UNLOCK TABLES;
SELECT * FROM t11;
song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
song Careful With That Axe, Eugene
+connection slave;
USE mysqltest1;
SELECT * FROM t11;
song Several Species of Small Furry Animals Gathered Together in a Cave and Grooving With a Pict
song Careful With That Axe, Eugene
+connection master;
DROP TABLE IF EXISTS t12;
SET SESSION BINLOG_FORMAT=MIXED;
CREATE TABLE t12 (data LONG);
LOCK TABLES t12 WRITE;
INSERT INTO t12 VALUES(UUID());
UNLOCK TABLES;
+connection slave;
+connection master;
CREATE FUNCTION my_user()
RETURNS CHAR(64)
BEGIN
@@ -423,6 +449,10 @@ INSERT INTO t13 VALUES (USER());
INSERT INTO t13 VALUES (my_user());
INSERT INTO t13 VALUES (CURRENT_USER());
INSERT INTO t13 VALUES (my_current_user());
+connection slave;
+connection master;
drop database mysqltest1;
+connection slave;
+connection master;
set global binlog_format =@my_binlog_format;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_sync.result b/mysql-test/suite/rpl/r/rpl_sync.result
index 84c100970e4..1240c446164 100644
--- a/mysql-test/suite/rpl/r/rpl_sync.result
+++ b/mysql-test/suite/rpl/r/rpl_sync.result
@@ -10,11 +10,15 @@ insert into t1(a) values(1);
insert into t1(a) values(2);
insert into t1(a) values(3);
=====Inserting data on the master but without the SQL Thread being running=======;
+connection slave;
+connection slave;
include/stop_slave_sql.inc
+connection master;
insert into t1(a) values(4);
insert into t1(a) values(5);
insert into t1(a) values(6);
=====Removing relay log files and crashing/recoverying the slave=======;
+connection slave;
include/stop_slave_io.inc
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
@@ -22,20 +26,28 @@ ERROR HY000: Lost connection to MySQL server during query
include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
include/start_slave.inc
+connection master;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
=====Corrupting the master.info=======;
+connection slave;
include/stop_slave.inc
+connection master;
FLUSH LOGS;
insert into t1(a) values(7);
insert into t1(a) values(8);
insert into t1(a) values(9);
+connection slave;
SET SESSION debug_dbug="d,crash_before_rotate_relaylog";
FLUSH LOGS;
ERROR HY000: Lost connection to MySQL server during query
include/rpl_reconnect.inc
=====Dumping and comparing tables=======;
include/start_slave.inc
+connection master;
+connection slave;
include/diff_tables.inc [master:t1,slave:t1]
=====Clean up=======;
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_table_options.result b/mysql-test/suite/rpl/r/rpl_table_options.result
index a417aaf720d..87fd8c2b2fb 100644
--- a/mysql-test/suite/rpl/r/rpl_table_options.result
+++ b/mysql-test/suite/rpl/r/rpl_table_options.result
@@ -2,12 +2,16 @@ include/master-slave.inc
[connection master]
install plugin example soname 'ha_example.so';
set storage_engine=example;
+connection slave;
+connection master;
create table t1 (a int not null) ull=12340;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
) ENGINE=EXAMPLE DEFAULT CHARSET=latin1 `ull`=12340
+connection slave;
+connection slave;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -19,6 +23,7 @@ Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 `ull`=12340
+connection master;
drop table t1;
set storage_engine=default;
select 1;
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table.result b/mysql-test/suite/rpl/r/rpl_temp_table.result
index 08504ce175d..ff3e52f77b5 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table.result
@@ -11,10 +11,16 @@ insert into t3 values (1010);
insert into t2 select * from t3;
drop table if exists t3;
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;
+disconnect master;
+connection slave;
+connection master1;
insert into t2 values(61);
+disconnect master1;
+connection slave;
select * from t2;
n
1
@@ -40,11 +46,18 @@ show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
*** MDEV-8016: Replication aborts on DROP /*!40005 TEMPORARY */ TABLE IF EXISTS ***
+connect master2,localhost,root,,;
INSERT INTO t2 VALUES (2000), (2001);
CREATE FUNCTION f() RETURNS INTEGER RETURN 1;
CREATE TEMPORARY TABLE t3 AS SELECT f() AS col FROM t2;
+disconnect master2;
+connection default;
+connection slave;
+connect master2,localhost,root,,;
+connection master2;
drop table if exists t1,t2;
Warnings:
Note 1051 Unknown table 'test.t1'
drop function f;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
index 5e70bf85ab9..e330576be54 100644
--- a/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
+++ b/mysql-test/suite/rpl/r/rpl_temp_table_mix_row.result
@@ -1,28 +1,30 @@
include/master-slave.inc
[connection master]
==== Initialize ====
-[on master]
+connection master;
CREATE TABLE t1 (a CHAR(48));
CREATE TEMPORARY TABLE t1_tmp1(a INT);
INSERT INTO t1 VALUES (UUID());
-[on slave]
+connection slave;
==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
Variable_name Value
Slave_open_temp_tables 1
-[on master]
-[on master1]
-[on slave]
+connection master;
+disconnect master;
+connection master1;
+connection slave;
==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
Variable_name Value
Slave_open_temp_tables 0
==== Clean up ====
-[on master]
include/rpl_connect.inc [creating master]
+connection master;
DROP TABLE t1;
-[on slave]
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (a int) engine=innodb;
CREATE TABLE t2 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
CREATE TABLE t3 ( i1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (i1) );
@@ -33,18 +35,23 @@ DELETE FROM t2;
CREATE TEMPORARY TABLE t2_tmp (a int);
ALTER TABLE t1_tmp ADD COLUMN c INT;
### assertion: assert that there is one open temp table on slave
+connection slave;
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
+connection master;
DROP TABLE t1_tmp, t2;
INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t2_tmp;
INSERT INTO t1 VALUES (2);
+connection slave;
### assertion: assert that slave has no temporary tables opened
SHOW STATUS LIKE 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
+connection master;
DROP TABLE t3, t1;
+connection slave;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
@@ -75,6 +82,7 @@ slave-bin.000001 # Query # # use `test`; DROP TABLE IF EXISTS `t3`,`t1` /* gener
# Bug#55478 Row events wrongly apply on the temporary table of the same name
# ==========================================================================
+connection master;
# The statement should be binlogged
CREATE TEMPORARY TABLE t1(c1 INT) ENGINE=InnoDB;
@@ -111,8 +119,10 @@ master-bin.000001 # Query # # COMMIT
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # DROP TEMPORARY TABLE IF EXISTS `test`.`t1` /* generated by server */
master-bin.000001 # Query # # COMMIT
+connection slave;
# Compare the base table.
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result b/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result
index 2e9116ced2d..d61255c00a3 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_default_to_default.result
@@ -1,11 +1,14 @@
include/master-slave.inc
[connection master]
+connection master;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
1
+connection slave;
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
1
+connection master;
CREATE TABLE t1
(
c0 TIME(0),
@@ -45,6 +48,8 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
+connection slave;
+connection slave;
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
@@ -75,9 +80,12 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result
index 7cb7d177f1a..9f8f409e70e 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mariadb53.result
@@ -1,13 +1,18 @@
include/master-slave.inc
[connection master]
+connection master;
SET @@global.mysql56_temporal_format=false;;
+connection slave;
SET @@global.mysql56_temporal_format=false;;
+connection master;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
0
+connection slave;
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
0
+connection master;
CREATE TABLE t1
(
c0 TIME(0),
@@ -47,6 +52,8 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
+connection slave;
+connection slave;
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
@@ -77,9 +84,12 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result
index 74c287578d7..5c518163cdd 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mariadb53_to_mysql56.result
@@ -1,13 +1,18 @@
include/master-slave.inc
[connection master]
+connection master;
SET @@global.mysql56_temporal_format=false;;
+connection slave;
SET @@global.mysql56_temporal_format=true;;
+connection master;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
0
+connection slave;
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
1
+connection master;
CREATE TABLE t1
(
c0 TIME(0),
@@ -47,6 +52,8 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
+connection slave;
+connection slave;
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
@@ -77,9 +84,12 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result
index cc22e00aeb1..9d086d340f4 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mariadb53.result
@@ -1,13 +1,18 @@
include/master-slave.inc
[connection master]
+connection master;
SET @@global.mysql56_temporal_format=true;;
+connection slave;
SET @@global.mysql56_temporal_format=false;;
+connection master;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
1
+connection slave;
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
0
+connection master;
CREATE TABLE t1
(
c0 TIME(0),
@@ -47,6 +52,8 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
+connection slave;
+connection slave;
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
@@ -77,9 +84,12 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 33 33
t2 1 41 41
t3 1 50 50
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result
index 8675283435a..22783d4c239 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_format_mysql56_to_mysql56.result
@@ -1,13 +1,18 @@
include/master-slave.inc
[connection master]
+connection master;
SET @@global.mysql56_temporal_format=true;;
+connection slave;
SET @@global.mysql56_temporal_format=true;;
+connection master;
SELECT @@global.mysql56_temporal_format AS on_master;
on_master
1
+connection slave;
SELECT @@global.mysql56_temporal_format AS on_slave;
on_slave
1
+connection master;
CREATE TABLE t1
(
c0 TIME(0),
@@ -47,6 +52,8 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
+connection slave;
+connection slave;
SELECT * FROM t1;;
c0 01:01:01
c1 01:01:01.1
@@ -77,9 +84,12 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
t1 1 34 34
t2 1 41 41
t3 1 48 48
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
SET @@global.mysql56_temporal_format=DEFAULT;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56.result
index 99f81abb166..a39cfd2a413 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_mysql56.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56.result
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
+connection master;
SET TIME_ZONE='+00:00';
+connection slave;
SET TIME_ZONE='+00:00';
+connection master;
INSERT INTO mysql56time VALUES ('01:01:01','01:01:01.1','01:01:01.11','01:01:01.111','01:01:01.1111','01:01:01.11111','01:01:01.111111');
INSERT INTO mysql56datetime VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
INSERT INTO mysql56timestamp VALUES ('2001-01-01 01:01:01','2001-01-01 01:01:01.1','2001-01-01 01:01:01.11','2001-01-01 01:01:01.111','2001-01-01 01:01:01.1111','2001-01-01 01:01:01.11111','2001-01-01 01:01:01.111111');
+connection slave;
+connection slave;
SELECT * FROM mysql56time;
t0 838:59:59
t1 838:59:59.0
@@ -78,6 +83,7 @@ ts3 2001-01-01 01:01:01.111
ts4 2001-01-01 01:01:01.1111
ts5 2001-01-01 01:01:01.11111
ts6 2001-01-01 01:01:01.111111
+connection master;
DROP TABLE mysql56time;
DROP TABLE mysql56datetime;
DROP TABLE mysql56timestamp;
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result
index de4c9dafc1c..41b3ca9d6fe 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb.result
@@ -5,6 +5,7 @@ include/master-slave.inc
# started over MySQL-5.6 data directory
# to MariaDB-10.0 slave running with natively created tables
#
+connection master;
SET TIME_ZONE='+00:00';
SHOW CREATE TABLE mysql050614_temporal0;
Table Create Table
@@ -20,12 +21,14 @@ mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
SELECT @@mysql56_temporal_format;
@@mysql56_temporal_format
1
SET TIME_ZONE='+00:00';
CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
+connection master;
INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
@@ -33,6 +36,8 @@ WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 2 13 26
mysql050614_temporal1 1 16 16
+connection slave;
+connection slave;
SELECT * FROM mysql050614_temporal0;
a b c
00:00:02 2001-01-01 00:00:02 2001-01-01 00:00:02
@@ -45,6 +50,7 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 1 13 13
mysql050614_temporal1 1 16 16
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result
index 37373367f8a..2e3af3367ff 100644
--- a/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result
+++ b/mysql-test/suite/rpl/r/rpl_temporal_mysql56_to_mariadb53.result
@@ -1,11 +1,14 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @@global.mysql56_temporal_format=false;;
+connection master;
#
# Testing replication from MariaDB-10.0 master
# started over MySQL-5.6 data directory
# to MariaDB-10.0 slave running with natively created tables
#
+connection master;
SET TIME_ZONE='+00:00';
SHOW CREATE TABLE mysql050614_temporal0;
Table Create Table
@@ -21,12 +24,14 @@ mysql050614_temporal1 CREATE TABLE `mysql050614_temporal1` (
`b` datetime(1) DEFAULT NULL,
`c` timestamp(1) NOT NULL DEFAULT CURRENT_TIMESTAMP(1) ON UPDATE CURRENT_TIMESTAMP(1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+connection slave;
SELECT @@mysql56_temporal_format;
@@mysql56_temporal_format
0
SET TIME_ZONE='+00:00';
CREATE TABLE mysql050614_temporal0 (a time(0), b datetime(0), c timestamp(0)) engine=myisam;
CREATE TABLE mysql050614_temporal1 (a time(1), b datetime(1), c timestamp(1)) engine=myisam;
+connection master;
INSERT INTO mysql050614_temporal0 VALUES ('00:00:02','2001-01-01 00:00:02','2001-01-01 00:00:02');
INSERT INTO mysql050614_temporal1 VALUES ('00:00:02.1','2001-01-01 00:00:02.2','2001-01-01 00:00:02.3');
SELECT TABLE_NAME, TABLE_ROWS, AVG_ROW_LENGTH, DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES
@@ -34,6 +39,8 @@ WHERE TABLE_NAME LIKE 'mysql050614_temporal%' ORDER BY TABLE_NAME;
TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 2 13 26
mysql050614_temporal1 1 16 16
+connection slave;
+connection slave;
SELECT * FROM mysql050614_temporal0;
a b c
00:00:02 2001-01-01 00:00:02 2001-01-01 00:00:02
@@ -46,6 +53,7 @@ TABLE_NAME TABLE_ROWS AVG_ROW_LENGTH DATA_LENGTH
mysql050614_temporal0 1 16 16
mysql050614_temporal1 1 16 16
SET @@global.mysql56_temporal_format=DEFAULT;
+connection master;
DROP TABLE mysql050614_temporal0;
DROP TABLE mysql050614_temporal1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary.result b/mysql-test/suite/rpl/r/rpl_temporary.result
index b5458a7a11a..e1b34026cb7 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary.result
@@ -2,26 +2,42 @@ SET sql_log_bin = 0;
SET sql_log_bin = 1;
include/master-slave.inc
[connection master]
+connection slave;
reset master;
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE t1 (a char(1));
INSERT INTO t1 VALUES ('a');
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+connection master;
INSERT INTO t1 VALUES ('b');
+connection slave;
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TEMPORARY TABLE `t1`(`a` tinyint,`b` char(1))engine=myisam;
INSERT INTO `t1` set `a`=128,`b`='128';
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
+connection slave;
include/stop_slave.inc
include/start_slave.inc
+connection master;
INSERT INTO `t1` set `a`=128,`b`='128';
Warnings:
Warning 1264 Out of range value for column 'a' at row 1
Warning 1265 Data truncated for column 'b' at row 1
+connection slave;
+connection master;
DROP TABLE t1;
+connection slave;
+connection master;
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connect con3,localhost,zedjzlcsjhd,,;
+connection con3;
SET @save_select_limit=@@session.sql_select_limit;
SET @@session.sql_select_limit=10, @@session.pseudo_thread_id=100;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
@@ -33,12 +49,14 @@ ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) fo
SELECT @@session.sql_select_limit = @save_select_limit;
@@session.sql_select_limit = @save_select_limit
1
+connection con2;
SET @save_conn_id= connection_id();
SET @@session.pseudo_thread_id=100;
SET @@session.pseudo_thread_id=connection_id();
SET @@session.pseudo_thread_id=@save_conn_id;
SET @@session.sql_log_bin=0;
SET @@session.sql_log_bin=1;
+connection con3;
drop table if exists t1,t2;
create table t1(f int);
create table t2(f int);
@@ -46,12 +64,18 @@ insert into t1 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
SELECT COUNT(*) FROM t1;
COUNT(*)
10
+connection con1;
create temporary table t3(f int);
insert into t3 select * from t1 where f<6;
+connection con2;
create temporary table t3(f int);
+connection con1;
insert into t2 select count(*) from t3;
+connection con2;
insert into t3 select * from t1 where f>=4;
+connection con1;
drop temporary table t3;
+connection con2;
insert into t2 select count(*) from t3;
drop temporary table t3;
select * from t2 ORDER BY f;
@@ -96,15 +120,22 @@ f
7
drop table t1,t2;
create temporary table t3 (f int);
+connection slave;
+connection master;
create temporary table t4 (f int);
create table t5 (f int);
+connection slave;
stop slave;
+connection master;
insert into t5 select * from t4;
+connection slave;
start slave;
select * from t5 /* must be 1 after reconnection */;
f
+connection master;
drop temporary table t4;
drop table t5;
+connection con1;
set @@session.pseudo_thread_id=100;
create temporary table t101 (id int);
create temporary table t102 (id int);
@@ -116,28 +147,41 @@ set @@session.pseudo_thread_id=300;
create temporary table t301 (id int);
create temporary table t302 (id int);
create temporary table `#sql_not_user_table303` (id int);
+disconnect con1;
+connection master;
create table t1(f int);
insert into t1 values (1);
+connection slave;
select * from t1 /* must be 1 */;
f
1
+connection master;
drop table t1;
+connection slave;
select * from t1;
a
1
+connection master;
drop table t1;
+connection slave;
include/stop_slave.inc
+connection master;
include/rpl_reset.inc
-- Bug#43748
-- make a user on the slave that can list but not kill system threads.
+connection slave;
FLUSH PRIVILEGES;
GRANT USAGE ON *.* TO user43748@127.0.0.1 IDENTIFIED BY 'meow';
GRANT PROCESS ON *.* TO user43748@127.0.0.1;
-- try to KILL system-thread as that non-privileged user (on slave).
+connect cont43748,127.0.0.1,user43748,meow,test,$SLAVE_MYPORT,;
+connection cont43748;
SELECT id INTO @id FROM information_schema.processlist WHERE user='system user' LIMIT 1;
KILL @id;
Got one of the listed errors
+disconnect cont43748;
-- throw out test-user on slave.
+connection slave;
DROP USER user43748@127.0.0.1;
End of 5.1 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_error2.result b/mysql-test/suite/rpl/r/rpl_temporary_error2.result
index 7c7663b8824..901fbb18c32 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_error2.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_error2.result
@@ -1,9 +1,11 @@
include/master-slave.inc
[connection master]
*** Provoke a deadlock on the slave, check that transaction retry succeeds. ***
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) ENGINE=InnoDB;
CREATE TABLE t2 (a INT) ENGINE=InnoDB;
INSERT INTO t1(a) VALUES (1), (2), (3), (4), (5);
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
@@ -14,15 +16,20 @@ a b
SET sql_log_bin=0;
ALTER TABLE t2 ENGINE=MyISAM;
SET sql_log_bin=1;
+connect con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,;
+connection con_temp1;
BEGIN;
UPDATE t1 SET b=2 WHERE a=4;
INSERT INTO t2 VALUES (2);
DELETE FROM t2 WHERE a=2;
+connection master;
BEGIN;
UPDATE t1 SET b=1 WHERE a=2;
INSERT INTO t2 VALUES (1);
UPDATE t1 SET b=1 WHERE a=4;
COMMIT;
+connection slave;
+connection con_temp1;
UPDATE t1 SET b=2 WHERE a=2;
SELECT * FROM t1 WHERE a<10 ORDER BY a;
a b
@@ -34,6 +41,7 @@ a b
ROLLBACK;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
@@ -50,6 +58,7 @@ retries
1
Last_SQL_Errno = '0'
Last_SQL_Error = ''
+connection master;
DROP TABLE t1;
DROP TABLE t2;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_temporary_errors.result b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
index 36dad2235f8..8654fe218dc 100644
--- a/mysql-test/suite/rpl/r/rpl_temporary_errors.result
+++ b/mysql-test/suite/rpl/r/rpl_temporary_errors.result
@@ -2,10 +2,10 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression("Deadlock found");
call mtr.add_suppression("Can't find record in 't.'");
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
-**** On Slave ****
+connection slave;
SHOW STATUS LIKE 'Slave_retried_transactions';
Variable_name Value
Slave_retried_transactions 0
@@ -17,7 +17,7 @@ a b
2 2
3 3
4 4
-**** On Master ****
+connection master;
UPDATE t1 SET a = 5, b = 5 WHERE a = 1;
SELECT * FROM t1;
a b
@@ -25,7 +25,7 @@ a b
2 2
3 3
4 4
-**** On Slave ****
+connection slave;
set @@global.slave_exec_mode= default;
SHOW STATUS LIKE 'Slave_retried_transactions';
Variable_name Value
@@ -37,7 +37,10 @@ a b
3 3
4 4
include/check_slave_is_running.inc
+connection slave;
call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
-**** On Master ****
+connection master;
DROP TABLE t1;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_test_framework.result b/mysql-test/suite/rpl/r/rpl_test_framework.result
index e45c12ba0ec..63585deb56a 100644
--- a/mysql-test/suite/rpl/r/rpl_test_framework.result
+++ b/mysql-test/suite/rpl/r/rpl_test_framework.result
@@ -6,10 +6,10 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1 -> 2]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 12'
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (1);
include/rpl_sync.inc
@@ -18,10 +18,10 @@ include/rpl_end.inc
include/rpl_init.inc [topology=2 -> 3]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 23'
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (2);
-[connection server_2]
+connection server_2;
DELETE FROM t1;
INSERT INTO t1 VALUES (2);
include/rpl_sync.inc
@@ -30,13 +30,13 @@ include/rpl_end.inc
include/rpl_init.inc [topology=none]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ''
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (3);
-[connection server_2]
+connection server_2;
DELETE FROM t1;
INSERT INTO t1 VALUES (3);
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (3);
include/rpl_sync.inc
@@ -45,10 +45,10 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2, 2->1]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 212'
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (4);
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (4);
include/rpl_sync.inc
@@ -57,10 +57,10 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2->1]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 212'
-[connection server_2]
+connection server_2;
DELETE FROM t1;
INSERT INTO t1 VALUES (5);
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (5);
include/rpl_sync.inc
@@ -69,10 +69,10 @@ include/rpl_end.inc
include/rpl_init.inc [topology=2->1->2]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 212'
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (6);
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (6);
include/rpl_sync.inc
@@ -81,7 +81,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2->3]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 123'
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (7);
include/rpl_sync.inc
@@ -90,7 +90,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=2->3->2->1]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 323 21'
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (8);
include/rpl_sync.inc
@@ -99,7 +99,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2,2->3,3->1]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 23123'
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (9);
include/rpl_sync.inc
@@ -108,7 +108,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->3->2->1]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 13213'
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (10);
include/rpl_sync.inc
@@ -118,7 +118,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2->3->4->1->5->6]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 341234156'
-[connection server_1]
+connection server_1;
DELETE FROM t1;
INSERT INTO t1 VALUES (11);
include/rpl_sync.inc
@@ -127,7 +127,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=3->4->5->6->3->1->2]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 4563456 312'
-[connection server_4]
+connection server_4;
DELETE FROM t1;
INSERT INTO t1 VALUES (12);
include/rpl_sync.inc
@@ -136,7 +136,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=6->5->4->3->2->1]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 65 54 43 32 21'
-[connection server_6]
+connection server_6;
DELETE FROM t1;
INSERT INTO t1 VALUES (13);
include/rpl_sync.inc
@@ -145,10 +145,10 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2->3->1,4->5->6]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 456 23123'
-[connection server_3]
+connection server_3;
DELETE FROM t1;
INSERT INTO t1 VALUES (14);
-[connection server_4]
+connection server_4;
DELETE FROM t1;
INSERT INTO t1 VALUES (14);
include/rpl_sync.inc
@@ -158,7 +158,7 @@ include/rpl_end.inc
include/rpl_init.inc [topology=1->2, 2->3, 3->4, 4->5, 5->1, 1->6, 6->7, 6->8, 8->9]
include/rpl_generate_sync_chain.inc
rpl_sync_chain= ' 345123451689 67'
-[connection server_2]
+connection server_2;
DELETE FROM t1;
INSERT INTO t1 VALUES (15);
include/rpl_sync.inc
@@ -166,5 +166,6 @@ include/diff_tables.inc [server_1:t1,server_2:t1,server_3:t1,server_4:t1,server_
include/rpl_end.inc
==== Clean up ====
include/rpl_init.inc [topology=1->2->3->4->5->6->7->8->9]
+connection server_1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_timezone.result b/mysql-test/suite/rpl/r/rpl_timezone.result
index ce93c3030c0..b9b890443eb 100644
--- a/mysql-test/suite/rpl/r/rpl_timezone.result
+++ b/mysql-test/suite/rpl/r/rpl_timezone.result
@@ -4,9 +4,11 @@ set @my_time_zone= @@global.time_zone;
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));
+connection slave;
select @@time_zone;
@@time_zone
Japan
+connection master;
select @@time_zone;
@@time_zone
Europe/Moscow
@@ -18,12 +20,14 @@ t n
2005-06-11 09:39:02 2
2004-01-01 00:00:00 3
2004-06-11 09:39:02 4
+connection slave;
SELECT * FROM t1 ORDER BY n;
t n
2005-01-01 06:00:00 1
2005-06-11 14:39:02 2
2004-01-01 06:00:00 3
2004-06-11 14:39:02 4
+connection master;
delete from t1;
set time_zone='Europe/Moscow';
insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
@@ -31,11 +35,14 @@ SELECT * FROM t1 ORDER BY n;
t n
2004-01-01 00:00:00 5
2004-06-11 09:39:02 6
+connection slave;
set time_zone='Europe/Moscow';
SELECT * FROM t1 ORDER BY n;
t n
2004-01-01 00:00:00 5
2004-06-11 09:39:02 6
+connection master;
+connection master;
delete from t1;
set time_zone='UTC';
load data infile '../../std_data/rpl_timezone2.dat' into table t1;
@@ -48,12 +55,14 @@ SELECT * FROM t1 ORDER BY n;
t n
0000-00-00 00:00:00 7
0000-00-00 00:00:00 8
+connection slave;
set time_zone='UTC';
SELECT * FROM t1 ORDER BY n;
t n
0000-00-00 00:00:00 7
0000-00-00 00:00:00 8
set time_zone='Europe/Moscow';
+connection master;
set time_zone='Europe/Moscow';
delete from t1;
insert into t1 values ('20040101000000',NULL), ('20040611093902',NULL);
@@ -63,18 +72,22 @@ SELECT * FROM t1 ORDER BY n;
t n
2003-12-31 22:00:00 9
2004-06-11 07:39:02 10
+connection slave;
SELECT * FROM t2 ORDER BY n;
t n
2003-12-31 22:00:00 9
2004-06-11 07:39:02 10
+connection master;
delete from t2;
set timestamp=1000072000;
insert into t2 values (current_timestamp,NULL), (current_date,NULL), (current_time,NULL);
+connection slave;
SELECT * FROM t2 ORDER BY n;
t n
2001-09-09 23:46:40 11
2001-09-09 12
23:46:40 13
+connection master;
delete from t2;
insert into t2 values (from_unixtime(1000000000),NULL),
(unix_timestamp('2001-09-09 03:46:40'),NULL);
@@ -82,10 +95,12 @@ SELECT * FROM t2 ORDER BY n;
t n
2001-09-09 03:46:40 14
1000000000 15
+connection slave;
SELECT * FROM t2 ORDER BY n;
t n
2001-09-09 03:46:40 14
1000000000 15
+connection master;
set global time_zone='MET';
delete from t2;
set time_zone='UTC';
@@ -95,13 +110,18 @@ SELECT * FROM t2 ORDER BY n;
t n
2003-12-31 23:00:00 16
2005-01-01 08:00:00 17
+connection slave;
SELECT * FROM t2 ORDER BY n;
t n
2003-12-31 23:00:00 16
2005-01-01 08:00:00 17
+connection master;
drop table t1, t2;
+connection slave;
+connection master;
set global time_zone= @my_time_zone;
End of 4.1 tests
+connection master;
CREATE TABLE t1 (a INT, b TIMESTAMP);
INSERT INTO t1 VALUES (1, NOW());
SET @@session.time_zone='Japan';
@@ -111,18 +131,23 @@ Warning 1264 Out of range value for column 'b' at row 1
SELECT * FROM t1 ORDER BY a;
a b
1 0000-00-00 00:00:00
+connection slave;
SET @@session.time_zone='Japan';
SELECT * FROM t1 ORDER BY a;
a b
1 0000-00-00 00:00:00
SET @@session.time_zone = default;
+connection master;
DROP TABLE t1;
SET @@session.time_zone = default;
+connection slave;
include/stop_slave.inc
+connection master;
reset master;
CREATE TABLE t1 (date timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, a int(11) default NULL);
SET @@session.time_zone='+01:00';
insert into t1 values('2008-12-23 19:39:39',1);
+connection master1;
SET @@session.time_zone='+02:00';
insert delayed into t1 values ('2008-12-23 19:39:39',2);
flush table t1;
@@ -132,6 +157,7 @@ date a
2008-12-23 20:39:39 1
2008-12-23 19:39:39 2
DROP TABLE t1;
+connection master1;
select * from t1 order by a;
date a
2008-12-23 20:39:39 1
diff --git a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
index 0264c9421fc..e8e95ab7c4c 100644
--- a/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
+++ b/mysql-test/suite/rpl/r/rpl_tmp_table_and_DDL.result
@@ -90,6 +90,8 @@ INSERT INTO t1 VALUES (1);
DROP TABLE t2;
INSERT INTO t1 VALUES (1);
DROP TEMPORARY TABLE t1;
+connection slave;
+connection master;
CREATE TABLE t1 (a CHAR(30));
CREATE TEMPORARY TABLE t2 (b CHAR(60));
LOCK TABLE t1 WRITE;
diff --git a/mysql-test/suite/rpl/r/rpl_trigger.result b/mysql-test/suite/rpl/r/rpl_trigger.result
index 6b63d8cda31..729d31fb001 100644
--- a/mysql-test/suite/rpl/r/rpl_trigger.result
+++ b/mysql-test/suite/rpl/r/rpl_trigger.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
DROP TABLE IF EXISTS t3;
@@ -41,8 +42,7 @@ a name old_a old_b truncate(rand_value,4)
105 t2 4 0 0.6635
106 t2 6 0 0.6699
107 t2 500 0 0.3593
-
---- On slave --
+connection slave;
select a,b, truncate(rand_value,4) from t1;
a b truncate(rand_value,4)
1 1 0.4320
@@ -64,10 +64,14 @@ a name old_a old_b truncate(rand_value,4)
105 t2 4 0 0.6635
106 t2 6 0 0.6699
107 t2 500 0 0.3593
+connection master;
drop table t1,t2,t3;
+connect con2,localhost,root,,;
+connection con2;
select get_lock("bug12480",2);
get_lock("bug12480",2)
1
+connection default;
create table t1 (a datetime,b datetime, c datetime);
drop function if exists bug12480;
create function bug12480() returns datetime
@@ -96,8 +100,7 @@ FROM information_schema.triggers
WHERE trigger_name = 't1_first';
trigger_name definer
t1_first root@localhost
-
---- On slave --
+connection slave;
SELECT routine_name, definer
FROM information_schema.routines
WHERE routine_name = 'bug12480';
@@ -113,6 +116,8 @@ a=b && a=c
1
test
1
+connection master;
+disconnect con2;
truncate table t1;
drop trigger t1_first;
insert into t1 values ("2003-03-03","2003-03-03","2003-03-03"),(bug12480(),bug12480(),bug12480()),(now(),now(),now());
@@ -132,6 +137,8 @@ end|
create database other;
use other;
insert into test.t1 values (1);
+connection slave;
+connection master;
use test;
drop table t1,t2;
drop database other;
@@ -139,14 +146,18 @@ test case for BUG#13227
-------------------
10
-------------------
+connection master;
drop table if exists t110;
+connection slave;
drop table if exists t210,t310;
+connection master;
create table t110 (f1 int) /* 2 replicate */;
insert into t110 values (-5);
insert into t110 values (-4);
insert into t110 values (-3);
insert into t110 values (-2);
insert into t110 values (-1);
+connection slave;
select * from t110;
f1
-5
@@ -186,11 +197,13 @@ f1
SELECT * from t310 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t110 SET f1=5 where f1=-5;
UPDATE t110 SET f1=4 where f1=-4;
UPDATE t110 SET f1=3 where f1=-3;
UPDATE t110 SET f1=2 where f1=-2;
UPDATE t110 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t110 /* must be f1 5 ... 1 */;
f1
5
@@ -207,18 +220,25 @@ f3
100
drop trigger trg110;
drop table t210,t310;
+connection master;
drop table t110;
+connection slave;
+connection master;
-------------------
9
-------------------
+connection master;
drop table if exists t19;
+connection slave;
drop table if exists t29,t39;
+connection master;
create table t19 (f1 int) /* 2 replicate */;
insert into t19 values (-5);
insert into t19 values (-4);
insert into t19 values (-3);
insert into t19 values (-2);
insert into t19 values (-1);
+connection slave;
select * from t19;
f1
-5
@@ -258,11 +278,13 @@ f1
SELECT * from t39 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t19 SET f1=5 where f1=-5;
UPDATE t19 SET f1=4 where f1=-4;
UPDATE t19 SET f1=3 where f1=-3;
UPDATE t19 SET f1=2 where f1=-2;
UPDATE t19 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t19 /* must be f1 5 ... 1 */;
f1
5
@@ -279,18 +301,25 @@ f3
100
drop trigger trg19;
drop table t29,t39;
+connection master;
drop table t19;
+connection slave;
+connection master;
-------------------
8
-------------------
+connection master;
drop table if exists t18;
+connection slave;
drop table if exists t28,t38;
+connection master;
create table t18 (f1 int) /* 2 replicate */;
insert into t18 values (-5);
insert into t18 values (-4);
insert into t18 values (-3);
insert into t18 values (-2);
insert into t18 values (-1);
+connection slave;
select * from t18;
f1
-5
@@ -330,11 +359,13 @@ f1
SELECT * from t38 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t18 SET f1=5 where f1=-5;
UPDATE t18 SET f1=4 where f1=-4;
UPDATE t18 SET f1=3 where f1=-3;
UPDATE t18 SET f1=2 where f1=-2;
UPDATE t18 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t18 /* must be f1 5 ... 1 */;
f1
5
@@ -351,18 +382,25 @@ f3
100
drop trigger trg18;
drop table t28,t38;
+connection master;
drop table t18;
+connection slave;
+connection master;
-------------------
7
-------------------
+connection master;
drop table if exists t17;
+connection slave;
drop table if exists t27,t37;
+connection master;
create table t17 (f1 int) /* 2 replicate */;
insert into t17 values (-5);
insert into t17 values (-4);
insert into t17 values (-3);
insert into t17 values (-2);
insert into t17 values (-1);
+connection slave;
select * from t17;
f1
-5
@@ -402,11 +440,13 @@ f1
SELECT * from t37 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t17 SET f1=5 where f1=-5;
UPDATE t17 SET f1=4 where f1=-4;
UPDATE t17 SET f1=3 where f1=-3;
UPDATE t17 SET f1=2 where f1=-2;
UPDATE t17 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t17 /* must be f1 5 ... 1 */;
f1
5
@@ -423,18 +463,25 @@ f3
100
drop trigger trg17;
drop table t27,t37;
+connection master;
drop table t17;
+connection slave;
+connection master;
-------------------
6
-------------------
+connection master;
drop table if exists t16;
+connection slave;
drop table if exists t26,t36;
+connection master;
create table t16 (f1 int) /* 2 replicate */;
insert into t16 values (-5);
insert into t16 values (-4);
insert into t16 values (-3);
insert into t16 values (-2);
insert into t16 values (-1);
+connection slave;
select * from t16;
f1
-5
@@ -474,11 +521,13 @@ f1
SELECT * from t36 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t16 SET f1=5 where f1=-5;
UPDATE t16 SET f1=4 where f1=-4;
UPDATE t16 SET f1=3 where f1=-3;
UPDATE t16 SET f1=2 where f1=-2;
UPDATE t16 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t16 /* must be f1 5 ... 1 */;
f1
5
@@ -495,18 +544,25 @@ f3
100
drop trigger trg16;
drop table t26,t36;
+connection master;
drop table t16;
+connection slave;
+connection master;
-------------------
5
-------------------
+connection master;
drop table if exists t15;
+connection slave;
drop table if exists t25,t35;
+connection master;
create table t15 (f1 int) /* 2 replicate */;
insert into t15 values (-5);
insert into t15 values (-4);
insert into t15 values (-3);
insert into t15 values (-2);
insert into t15 values (-1);
+connection slave;
select * from t15;
f1
-5
@@ -546,11 +602,13 @@ f1
SELECT * from t35 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t15 SET f1=5 where f1=-5;
UPDATE t15 SET f1=4 where f1=-4;
UPDATE t15 SET f1=3 where f1=-3;
UPDATE t15 SET f1=2 where f1=-2;
UPDATE t15 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t15 /* must be f1 5 ... 1 */;
f1
5
@@ -567,18 +625,25 @@ f3
100
drop trigger trg15;
drop table t25,t35;
+connection master;
drop table t15;
+connection slave;
+connection master;
-------------------
4
-------------------
+connection master;
drop table if exists t14;
+connection slave;
drop table if exists t24,t34;
+connection master;
create table t14 (f1 int) /* 2 replicate */;
insert into t14 values (-5);
insert into t14 values (-4);
insert into t14 values (-3);
insert into t14 values (-2);
insert into t14 values (-1);
+connection slave;
select * from t14;
f1
-5
@@ -618,11 +683,13 @@ f1
SELECT * from t34 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t14 SET f1=5 where f1=-5;
UPDATE t14 SET f1=4 where f1=-4;
UPDATE t14 SET f1=3 where f1=-3;
UPDATE t14 SET f1=2 where f1=-2;
UPDATE t14 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t14 /* must be f1 5 ... 1 */;
f1
5
@@ -639,18 +706,25 @@ f3
100
drop trigger trg14;
drop table t24,t34;
+connection master;
drop table t14;
+connection slave;
+connection master;
-------------------
3
-------------------
+connection master;
drop table if exists t13;
+connection slave;
drop table if exists t23,t33;
+connection master;
create table t13 (f1 int) /* 2 replicate */;
insert into t13 values (-5);
insert into t13 values (-4);
insert into t13 values (-3);
insert into t13 values (-2);
insert into t13 values (-1);
+connection slave;
select * from t13;
f1
-5
@@ -690,11 +764,13 @@ f1
SELECT * from t33 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t13 SET f1=5 where f1=-5;
UPDATE t13 SET f1=4 where f1=-4;
UPDATE t13 SET f1=3 where f1=-3;
UPDATE t13 SET f1=2 where f1=-2;
UPDATE t13 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t13 /* must be f1 5 ... 1 */;
f1
5
@@ -711,18 +787,25 @@ f3
100
drop trigger trg13;
drop table t23,t33;
+connection master;
drop table t13;
+connection slave;
+connection master;
-------------------
2
-------------------
+connection master;
drop table if exists t12;
+connection slave;
drop table if exists t22,t32;
+connection master;
create table t12 (f1 int) /* 2 replicate */;
insert into t12 values (-5);
insert into t12 values (-4);
insert into t12 values (-3);
insert into t12 values (-2);
insert into t12 values (-1);
+connection slave;
select * from t12;
f1
-5
@@ -762,11 +845,13 @@ f1
SELECT * from t32 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t12 SET f1=5 where f1=-5;
UPDATE t12 SET f1=4 where f1=-4;
UPDATE t12 SET f1=3 where f1=-3;
UPDATE t12 SET f1=2 where f1=-2;
UPDATE t12 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t12 /* must be f1 5 ... 1 */;
f1
5
@@ -783,18 +868,25 @@ f3
100
drop trigger trg12;
drop table t22,t32;
+connection master;
drop table t12;
+connection slave;
+connection master;
-------------------
1
-------------------
+connection master;
drop table if exists t11;
+connection slave;
drop table if exists t21,t31;
+connection master;
create table t11 (f1 int) /* 2 replicate */;
insert into t11 values (-5);
insert into t11 values (-4);
insert into t11 values (-3);
insert into t11 values (-2);
insert into t11 values (-1);
+connection slave;
select * from t11;
f1
-5
@@ -834,11 +926,13 @@ f1
SELECT * from t31 /* must be f3 5*100 */;
f3
500
+connection master;
UPDATE t11 SET f1=5 where f1=-5;
UPDATE t11 SET f1=4 where f1=-4;
UPDATE t11 SET f1=3 where f1=-3;
UPDATE t11 SET f1=2 where f1=-2;
UPDATE t11 SET f1=1 where f1=-1;
+connection slave;
SELECT * from t11 /* must be f1 5 ... 1 */;
f1
5
@@ -855,12 +949,18 @@ f3
100
drop trigger trg11;
drop table t21,t31;
+connection master;
drop table t11;
+connection slave;
+connection master;
+connection slave;
STOP SLAVE;
+connection master;
FLUSH LOGS;
include/rpl_stop_server.inc [server_number=1]
include/rpl_start_server.inc [server_number=1]
--> Master binlog: Server ver: 5.0.16-debug-log, Binlog ver: 4
+connection slave;
RESET SLAVE;
START SLAVE;
SELECT MASTER_POS_WAIT('master-bin.000001', 513) >= 0;
@@ -893,23 +993,26 @@ DROP TABLE t1;
DROP TABLE t2;
STOP SLAVE;
RESET SLAVE;
+connection master;
SHOW TABLES LIKE 't_';
Tables_in_test (t_)
SHOW TRIGGERS;
Trigger Event Table Statement Timing Created sql_mode Definer character_set_client collation_connection Database Collation
RESET MASTER;
+connection slave;
START SLAVE;
---> Test for BUG#20438
---> Preparing environment...
----> connection: master
+connection master;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
---> Synchronizing slave with master...
+connection slave;
----> connection: master
+connection master;
---> Creating objects...
CREATE TABLE t1(c INT);
@@ -930,7 +1033,7 @@ c
10
---> Synchronizing slave with master...
----> connection: master
+connection slave;
---> Checking on slave...
SELECT * FROM t1;
@@ -940,11 +1043,14 @@ SELECT * FROM t2;
c
10
----> connection: master
+connection master;
---> Cleaning up...
DROP TABLE t1;
DROP TABLE t2;
+connection slave;
+connection master;
+connection master;
drop table if exists t1;
create table t1(a int, b varchar(50));
drop trigger not_a_trigger;
@@ -966,13 +1072,19 @@ a b
1 In trigger t1_bi
2 b
3 c
+connection slave;
select * from t1;
a b
1 In trigger t1_bi
2 b
3 c
+connection master;
drop table t1;
+connection slave;
+connection master;
include/rpl_reset.inc
+connection slave;
+connection master;
create table t1 ( f int ) engine = innodb;
create table log ( r int ) engine = myisam;
create trigger tr
@@ -983,9 +1095,13 @@ insert into t1 values ( 1 );
rollback;
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:log, slave:log]
+connection master;
drop table t1, log;
+connection slave;
+connection master;
drop trigger if exists notexistent;
Warnings:
Note 1360 Trigger does not exist
@@ -993,8 +1109,10 @@ include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test`; drop trigger if exists notexistent
+connection slave;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Gtid # # GTID #-#-#
slave-bin.000001 # Query # # use `test`; drop trigger if exists notexistent
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_trunc_temp.result b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
index ae2c9973c9f..35cd91d795b 100644
--- a/mysql-test/suite/rpl/r/rpl_trunc_temp.result
+++ b/mysql-test/suite/rpl/r/rpl_trunc_temp.result
@@ -2,17 +2,24 @@ include/master-slave.inc
[connection master]
create temporary table t1 (n int);
insert into t1 values(1);
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
+connection master;
delete from t1;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
+connection master;
truncate t1;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 1
+disconnect master;
+connection slave;
show status like 'Slave_open_temp_tables';
Variable_name Value
Slave_open_temp_tables 0
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
index da8db64cef4..a8a08ef564d 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_2myisam.result
@@ -1,35 +1,47 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
-**** On Master ****
+connection slave;
+connection master;
TRUNCATE TABLE t1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
-**** On Master ****
+connection master;
SET @count := 1;
CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
-**** On Master ****
+connection slave;
+connection master;
TRUNCATE TABLE t1;
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT, b LONG) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,1), (2,2);
-**** On Master ****
+connection slave;
+connection master;
DELETE FROM t1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
-**** On Master ****
+connection master;
SET @count := 1;
CREATE TABLE t2 (a INT, b LONG) ENGINE=MyISAM;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
-**** On Master ****
+connection slave;
+connection master;
DELETE FROM t1;
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
index d8a4443022d..da03d2e8cc3 100644
--- a/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_truncate_3innodb.result
@@ -1,35 +1,47 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
-**** On Master ****
+connection slave;
+connection master;
TRUNCATE TABLE t1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
-**** On Master ****
+connection master;
SET @count := 1;
CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
-**** On Master ****
+connection slave;
+connection master;
TRUNCATE TABLE t1;
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT, b LONG) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1,1), (2,2);
-**** On Master ****
+connection slave;
+connection master;
DELETE FROM t1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
-**** On Master ****
+connection master;
SET @count := 1;
CREATE TABLE t2 (a INT, b LONG) ENGINE=InnoDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
-**** On Master ****
+connection slave;
+connection master;
DELETE FROM t1;
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv.result b/mysql-test/suite/rpl/r/rpl_typeconv.result
index 813c105c7dc..988962ff6f0 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
set @saved_slave_type_conversions = @@global.slave_type_conversions;
CREATE TABLE type_conversions (
TestNo INT AUTO_INCREMENT PRIMARY KEY,
@@ -35,18 +36,23 @@ ERROR 42000: Variable 'slave_type_conversions' can't be set to the value of 'NON
SELECT @@global.slave_type_conversions;
@@global.slave_type_conversions
ALL_LOSSY,ALL_NON_LOSSY
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = '' ****
include/rpl_reset.inc
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY' ****
include/rpl_reset.inc
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY' ****
include/rpl_reset.inc
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS='ALL_LOSSY,ALL_NON_LOSSY';
**** Running tests with @@SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY,ALL_NON_LOSSY' ****
include/rpl_reset.inc
+connection slave;
**** Result of conversions ****
Source_Type Target_Type All_Type_Conversion_Flags Value_On_Slave
TINYBLOB TINYBLOB <Correct value>
@@ -535,6 +541,8 @@ BIT(5) BIT(12) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
BIT(12) BIT(5) ALL_LOSSY,ALL_NON_LOSSY <Correct value>
DROP TABLE type_conversions;
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t1. cannot be converted from type.* error.* 1677");
+connection master;
DROP TABLE t1;
+connection slave;
set global slave_type_conversions = @saved_slave_type_conversions;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
index 67ac642bc5a..0ea02440b93 100644
--- a/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
+++ b/mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
+connection master;
CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=InnoDB;
INSERT INTO t1 VALUES (b'0', b'01', b'101');
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_udf.result b/mysql-test/suite/rpl/r/rpl_udf.result
index f9a5765d3a3..61ea8043440 100644
--- a/mysql-test/suite/rpl/r/rpl_udf.result
+++ b/mysql-test/suite/rpl/r/rpl_udf.result
@@ -1,8 +1,8 @@
include/master-slave.inc
[connection master]
+connection master;
drop table if exists t1;
"*** Test 1) Test UDFs via loadable libraries ***
-"Running on the master"
CREATE FUNCTION myfunc_double RETURNS REAL SONAME "UDF_EXAMPLE_LIB";
affected rows: 0
CREATE FUNCTION myfunc_int RETURNS INTEGER SONAME "UDF_EXAMPLE_LIB";
@@ -14,13 +14,13 @@ name ret dl type
myfunc_double 1 UDF_LIB function
myfunc_int 2 UDF_LIB function
affected rows: 2
-"Running on the slave"
+connection slave;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
myfunc_double 1 UDF_LIB function
myfunc_int 2 UDF_LIB function
affected rows: 2
-"Running on the master"
+connection master;
CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
affected rows: 0
INSERT INTO t1 VALUES(myfunc_int(100), myfunc_double(50.00));
@@ -38,7 +38,7 @@ sum price
100 48.6
200 49
affected rows: 4
-"Running on the slave"
+connection slave;
SELECT * FROM t1 ORDER BY sum;
sum price
1 48.5
@@ -54,7 +54,7 @@ SELECT myfunc_double(75.00);
myfunc_double(75.00)
50.00
affected rows: 1
-"Running on the master"
+connection master;
DROP FUNCTION myfunc_double;
affected rows: 0
DROP FUNCTION myfunc_int;
@@ -62,15 +62,14 @@ affected rows: 0
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
affected rows: 0
-"Running on the slave"
+connection slave;
SELECT * FROM mysql.func ORDER BY name;
name ret dl type
affected rows: 0
-"Running on the master"
+connection master;
DROP TABLE t1;
affected rows: 0
"*** Test 2) Test UDFs with SQL body ***
-"Running on the master"
CREATE FUNCTION myfuncsql_int(i INT) RETURNS INTEGER DETERMINISTIC RETURN i;
affected rows: 0
CREATE FUNCTION myfuncsql_double(d DOUBLE) RETURNS INTEGER DETERMINISTIC RETURN d * 2.00;
@@ -80,13 +79,13 @@ db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
test myfuncsql_int FUNCTION i INT RETURN i
affected rows: 2
-"Running on the slave"
+connection slave;
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00
test myfuncsql_int FUNCTION i INT RETURN i
affected rows: 2
-"Running on the master"
+connection master;
CREATE TABLE t1(sum INT, price FLOAT(24)) ENGINE=MyISAM;
affected rows: 0
INSERT INTO t1 VALUES(myfuncsql_int(100), myfuncsql_double(50.00));
@@ -104,7 +103,7 @@ sum price
100 100
200 50
affected rows: 4
-"Running on the slave"
+connection slave;
SELECT * FROM t1 ORDER BY sum;
sum price
1 1000
@@ -112,7 +111,7 @@ sum price
100 100
200 50
affected rows: 4
-"Running on the master"
+connection master;
ALTER FUNCTION myfuncsql_int COMMENT "This was altered.";
affected rows: 0
ALTER FUNCTION myfuncsql_double COMMENT "This was altered.";
@@ -122,7 +121,7 @@ db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
test myfuncsql_int FUNCTION i INT RETURN i This was altered.
affected rows: 2
-"Running on the slave"
+connection slave;
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
test myfuncsql_double FUNCTION d DOUBLE RETURN d * 2.00 This was altered.
@@ -136,7 +135,7 @@ SELECT myfuncsql_double(75.00);
myfuncsql_double(75.00)
150
affected rows: 1
-"Running on the master"
+connection master;
DROP FUNCTION myfuncsql_double;
affected rows: 0
DROP FUNCTION myfuncsql_int;
@@ -144,11 +143,11 @@ affected rows: 0
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
affected rows: 0
-"Running on the slave"
+connection slave;
SELECT db, name, type, param_list, body, comment FROM mysql.proc WHERE db = 'test' AND name LIKE 'myfuncsql%' ORDER BY name;
db name type param_list body comment
affected rows: 0
-"Running on the master"
+connection master;
DROP TABLE t1;
affected rows: 0
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
index 2efb3eba2b1..ca790f5d148 100644
--- a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
+++ b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result
@@ -14,8 +14,10 @@ LOCK TABLES t1 WRITE, t2 WRITE;
INSERT INTO t1(i) VALUES(3);
UNLOCK TABLES;
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
CREATE TABLE t1(i INT) ENGINE=INNODB;
CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB;
@@ -29,8 +31,10 @@ LOCK TABLES t2 WRITE, t1 READ;
INSERT INTO t2(i) SELECT i FROM t1;
UNLOCK TABLES;
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
CREATE TABLE t1(i int, id INT AUTO_INCREMENT, PRIMARY KEY (i, id)) ENGINE=MYISAM;
INSERT INTO t1 (i) values (1);
@@ -39,7 +43,9 @@ LOCK TABLES t1 WRITE;
INSERT INTO t1 (i) values (2);
UNLOCK TABLES;
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB;
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
@@ -48,6 +54,8 @@ LOCK TABLES t1 WRITE;
INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1;
UNLOCK TABLES;
COMMIT;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_user.result b/mysql-test/suite/rpl/r/rpl_user.result
index 005765e60d6..34f15d41209 100644
--- a/mysql-test/suite/rpl/r/rpl_user.result
+++ b/mysql-test/suite/rpl/r/rpl_user.result
@@ -1,36 +1,45 @@
include/master-slave.inc
[connection master]
+connection master;
set session sql_log_bin=0;
delete from mysql.user where Host='fakehost';
set session sql_log_bin=1;
+connection slave;
set session sql_log_bin=0;
delete from mysql.user where Host='fakehost';
set session sql_log_bin=1;
+connection master;
create user 'foo'@'fakehost';
create user 'foo'@'fakehost', 'bar'@'fakehost';
ERROR HY000: Operation CREATE USER failed for 'foo'@'fakehost'
create user 'foo'@'fakehost', 'bar'@'fakehost';
ERROR HY000: Operation CREATE USER failed for 'foo'@'fakehost','bar'@'fakehost'
+connection slave;
select Host,User from mysql.user where Host='fakehost';
Host User
fakehost bar
fakehost foo
+connection master;
rename user 'foo'@'fakehost' to 'foofoo'@'fakehost';
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'bar'@'fakehost' to 'barbar'@'fakehost';
ERROR HY000: Operation RENAME USER failed for 'not_exist_user1'@'fakehost'
rename user 'not_exist_user1'@'fakehost' to 'foobar'@'fakehost', 'not_exist_user2'@'fakehost' to 'barfoo'@'fakehost';
ERROR HY000: Operation RENAME USER failed for 'not_exist_user1'@'fakehost','not_exist_user2'@'fakehost'
+connection slave;
select Host,User from mysql.user where Host='fakehost';
Host User
fakehost barbar
fakehost foofoo
+connection master;
drop user 'foofoo'@'fakehost';
drop user 'not_exist_user1'@'fakehost', 'barbar'@'fakehost';
ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost'
drop user 'not_exist_user1'@'fakehost', 'not_exist_user2'@'fakehost';
ERROR HY000: Operation DROP USER failed for 'not_exist_user1'@'fakehost','not_exist_user2'@'fakehost'
+connection slave;
select Host,User from mysql.user where Host='fakehost';
Host User
+connection master;
include/show_binlog_events.inc
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid # # GTID #-#-#
diff --git a/mysql-test/suite/rpl/r/rpl_user_variables.result b/mysql-test/suite/rpl/r/rpl_user_variables.result
index e302ec0aceb..0efdbff5522 100644
--- a/mysql-test/suite/rpl/r/rpl_user_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_user_variables.result
@@ -1,6 +1,8 @@
include/master-slave.inc
[connection master]
+connection slave;
reset master;
+connection 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;
@@ -19,6 +21,7 @@ set @a:=5;
insert into t1 values (@a),(@a);
select * from t1 where n = '<nonexistant>';
n
+connection master1;
insert into t1 values (@a),(@a),(@a*5);
SELECT * FROM t1 ORDER BY n;
n
@@ -47,6 +50,7 @@ abcn1
abcn1n2
abc\def
This is a test
+connection slave;
SELECT * FROM t1 ORDER BY n;
n
NULL
@@ -74,6 +78,7 @@ abcn1
abcn1n2
abc\def
This is a test
+connection master;
insert into t1 select * FROM (select @var1 union select @var2) AS t2;
drop table t1;
End of 4.1 tests.
@@ -101,11 +106,13 @@ ELSE
INSERT INTO test.t21 VALUES ('TRIG_FALSE');
END IF;
END|
+connection slave;
+connection master;
SET @VAR=0;
CALL test.insert();
SET @VAR=1;
CALL test.insert();
-On master: Check the tables for correct data
+Check the tables for correct data
SELECT * FROM t20;
a
SP_FALSE
@@ -114,7 +121,8 @@ SELECT * FROM t21;
a
TRIG_FALSE
TRIG_TRUE
-On slave: Check the tables for correct data and it matches master
+connection slave;
+Check the tables for correct data and it matches master
SELECT * FROM t20;
a
SP_FALSE
@@ -123,6 +131,7 @@ SELECT * FROM t21;
a
TRIG_FALSE
TRIG_TRUE
+connection master;
DROP TABLE t20;
DROP TABLE t21;
DROP PROCEDURE test.insert;
@@ -141,7 +150,7 @@ SET @var = 4;
INSERT INTO t1 VALUES (square());
SET @var = 5;
INSERT INTO t1 VALUES (square());
-On master: Retrieve the values from the table
+Retrieve the values from the table
SELECT * FROM t1;
i
1
@@ -149,7 +158,8 @@ i
9
16
25
-On slave: Retrieve the values from the table and verify they are the same as on master
+connection slave;
+Retrieve the values from the table and verify they are the same as on master
SELECT * FROM t1;
i
1
@@ -157,6 +167,7 @@ i
9
16
25
+connection master;
DROP TABLE t1;
DROP FUNCTION test.square;
DROP TABLE IF EXISTS t1;
@@ -174,21 +185,27 @@ SET @c = (@a - 1);
END if;
return @c;
END |
+connection slave;
+connection master;
SET @a=500;
INSERT INTO t1 values(f1());
SET @b = 125;
SET @c = 1;
INSERT INTO t1 values(f2());
-On master: Retrieve the values from the table
+Retrieve the values from the table
+connection slave;
+connection master;
SELECT * from t1;
a
500
625
-On slave: Check the tables for correct data and it matches master
+connection slave;
+Check the tables for correct data and it matches master
SELECT * from t1;
a
500
625
+connection master;
DROP TABLE t1;
DROP FUNCTION f1;
DROP FUNCTION f2;
@@ -201,9 +218,11 @@ INSERT INTO t2 values (@a);
SET @a:=42;
INSERT INTO t2 values (@a);
END |
+connection slave;
+connection master;
SET @a:=100;
INSERT INTO t1 values (5);
-On master: Check to see that data was inserted correctly in both tables
+Check to see that data was inserted correctly in both tables
SELECT * from t1;
i
5
@@ -211,7 +230,8 @@ SELECT * from t2;
k
100
42
-On slave: Check the tables for correct data and it matches master
+connection slave;
+Check the tables for correct data and it matches master
SELECT * from t1;
i
5
@@ -219,7 +239,9 @@ SELECT * from t2;
k
100
42
+connection master;
drop table t1, t2;
+connection master;
create table t1(a int, b int);
prepare s1 from 'insert into t1 values (@x:=@x+1, ?)';
set @x=1;
@@ -227,10 +249,14 @@ execute s1 using @x;
select * from t1;
a b
2 1
+connection slave;
+connection slave;
select * from t1;
a b
2 1
+connection master;
drop table t1;
+connection master;
create table t1(a int);
insert into t1 values (1),(2);
prepare s1 from 'insert into t1 select a from t1 limit ?';
@@ -241,11 +267,14 @@ a
1
2
1
+connection slave;
+connection slave;
select * from t1;
a
1
2
1
+connection master;
drop table t1;
End of 5.0 tests.
DROP FUNCTION IF EXISTS f1;
@@ -257,22 +286,27 @@ FUNCTION f2() RETURNS INT BEGIN
INSERT INTO t1 VALUES (10 + @a);
RETURN 0;
END|
+connection slave;
+connection master;
SET @a:=123;
SELECT f1(), f2();
f1() f2()
123 0
-On master: Check to see that data was inserted correctly
+Check to see that data was inserted correctly
INSERT INTO t1 VALUES(f1());
SELECT * FROM t1;
i
133
123
-On slave: Check the table for correct data and it matches master
+connection slave;
+Check the table for correct data and it matches master
SELECT * FROM t1;
i
133
123
+connection master;
DROP FUNCTION f1;
DROP FUNCTION f2;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables.result b/mysql-test/suite/rpl/r/rpl_variables.result
index f91cdad6e47..dcd4b4ec884 100644
--- a/mysql-test/suite/rpl/r/rpl_variables.result
+++ b/mysql-test/suite/rpl/r/rpl_variables.result
@@ -1,7 +1,7 @@
include/master-slave.inc
[connection master]
==== Initialization ====
-[on master]
+connection master;
SET @m_default_week_format= @@global.default_week_format;
SET @m_init_slave= @@global.init_slave;
SET @m_lc_time_names= @@global.lc_time_names;
@@ -10,7 +10,7 @@ SET @m_relay_log_purge= @@global.relay_log_purge;
SET @m_slave_exec_mode= @@global.slave_exec_mode;
SET @m_sql_mode= @@global.sql_mode;
SET @m_sync_binlog= @@global.sync_binlog;
-[on slave]
+connection slave;
SET @s_default_week_format= @@global.default_week_format;
SET @s_init_slave= @@global.init_slave;
SET @s_lc_time_names= @@global.lc_time_names;
@@ -37,7 +37,7 @@ SET @user_text = 'Alunda';
include/stop_slave.inc
include/start_slave.inc
SET @@global.init_slave = 'SELECT 1';
-[on master]
+connection master;
SELECT @@pid_file, @@datadir;
@@pid_file MYSQLTEST_VARDIR/run/mysqld.1.pid
@@datadir MYSQLTEST_VARDIR/mysqld.1/data/
@@ -51,7 +51,7 @@ SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
@@log_bin 1
@@log_bin_index MYSQLTEST_VARDIR/mysqld.1/data/master-bin.index
@@log_bin_basename MYSQLTEST_VARDIR/mysqld.1/data/master-bin
-[on slave]
+connection slave;
SELECT @@pid_file, @@datadir;
@@pid_file MYSQLTEST_VARDIR/run/mysqld.2.pid
@@datadir MYSQLTEST_VARDIR/mysqld.2/data/
@@ -65,7 +65,7 @@ SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
@@log_bin 1
@@log_bin_index MYSQLTEST_VARDIR/mysqld.2/data/slave-bin.index
@@log_bin_basename MYSQLTEST_VARDIR/mysqld.2/data/slave-bin
-[on master]
+connection master;
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
truth BOOLEAN,
num INT,
@@ -534,6 +534,8 @@ EXECUTE p61;
EXECUTE p62;
EXECUTE p63;
EXECUTE p64;
+connection slave;
+connection master;
==== Results ====
SELECT * FROM tstmt ORDER BY id;
id truth num text
@@ -569,9 +571,10 @@ id truth num text
30 NULL 30 NULL
31 NULL NULL Bergsbrunna
32 NULL NULL Centrum
+connection slave;
include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep]
==== Clean up ====
-[on master]
+connection master;
DROP PROCEDURE proc;
DROP FUNCTION func;
DROP TRIGGER trig;
@@ -584,7 +587,7 @@ SET @@global.relay_log_purge= @m_relay_log_purge;
SET @@global.slave_exec_mode= @m_slave_exec_mode;
SET @@global.sql_mode= @m_sql_mode;
SET @@global.sync_binlog= @m_sync_binlog;
-[on slave]
+connection slave;
SET @@global.default_week_format= @s_default_week_format;
SET @@global.init_slave= @s_init_slave;
SET @@global.lc_time_names= @s_lc_time_names;
@@ -593,4 +596,6 @@ SET @@global.relay_log_purge= @s_relay_log_purge;
SET @@global.slave_exec_mode= @s_slave_exec_mode;
SET @@global.sql_mode= @s_sql_mode;
SET @@global.sync_binlog= @s_sync_binlog;
+connection master;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_variables_stm.result b/mysql-test/suite/rpl/r/rpl_variables_stm.result
index dfd78742e75..f3d80977a6b 100644
--- a/mysql-test/suite/rpl/r/rpl_variables_stm.result
+++ b/mysql-test/suite/rpl/r/rpl_variables_stm.result
@@ -2,7 +2,7 @@ include/master-slave.inc
[connection master]
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
==== Initialization ====
-[on master]
+connection master;
SET @m_auto_increment_increment= @@global.auto_increment_increment;
SET @m_auto_increment_offset= @@global.auto_increment_offset;
SET @m_character_set_client= @@global.character_set_client;
@@ -11,7 +11,7 @@ SET @m_collation_server= @@global.collation_server;
SET @m_time_zone= @@global.time_zone;
SET @m_lc_time_names= @@global.lc_time_names;
SET @m_collation_database= @@global.collation_database;
-[on slave]
+connection slave;
SET @s_auto_increment_increment= @@global.auto_increment_increment;
SET @s_auto_increment_offset= @@global.auto_increment_offset;
SET @s_character_set_client= @@global.character_set_client;
@@ -28,7 +28,7 @@ SET @@global.collation_server='geostd8_general_ci';
SET @@global.time_zone='Japan';
SET @@global.lc_time_names='sv_SE';
SET @@global.collation_database='geostd8_bin';
-[on master]
+connection master;
CREATE TABLE tstmt (id INT AUTO_INCREMENT PRIMARY KEY,
num INT,
text VARCHAR(100));
@@ -447,6 +447,8 @@ EXECUTE p61;
EXECUTE p62;
EXECUTE p63;
EXECUTE p64;
+connection slave;
+connection master;
==== Results ====
SELECT * FROM tstmt ORDER BY id;
id num text
@@ -484,9 +486,10 @@ id num text
56 NULL 47124712
57 NULL 1616
58 NULL 1717
+connection slave;
include/diff_tables.inc [master:tstmt, master:tproc, master:tfunc, master:ttrig, master:tprep, slave:tstmt, slave:tproc, slave:tfunc, slave:ttrig, slave:tprep]
==== Clean up ====
-[on master]
+connection master;
DROP PROCEDURE proc;
DROP FUNCTION func;
DROP TRIGGER trig;
@@ -499,7 +502,7 @@ SET @@global.collation_server= @m_collation_server;
SET @@global.time_zone= @m_time_zone;
SET @@global.lc_time_names= @m_lc_time_names;
SET @@global.collation_database= @m_collation_database;
-[on slave]
+connection slave;
SET @@global.auto_increment_increment= @s_auto_increment_increment;
SET @@global.auto_increment_offset= @s_auto_increment_offset;
SET @@global.character_set_client= @s_character_set_client;
@@ -508,4 +511,6 @@ SET @@global.collation_server= @s_collation_server;
SET @@global.time_zone= @s_time_zone;
SET @@global.lc_time_names= @s_lc_time_names;
SET @@global.collation_database= @s_collation_database;
+connection master;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view.result b/mysql-test/suite/rpl/r/rpl_view.result
index 307b88ff6f9..b6d9691f1d5 100644
--- a/mysql-test/suite/rpl/r/rpl_view.result
+++ b/mysql-test/suite/rpl/r/rpl_view.result
@@ -2,7 +2,9 @@ include/master-slave.inc
[connection master]
drop table if exists t1,v1;
drop view if exists t1,v1;
+connection slave;
reset master;
+connection master;
create table t1 (a int);
insert into t1 values (1);
create view v1 as select a from t1;
@@ -11,45 +13,57 @@ select * from v1 order by a;
a
1
2
+connection slave;
select * from v1 order by a;
a
1
2
+connection master;
update v1 set a=3 where a=1;
select * from v1 order by a;
a
2
3
+connection slave;
select * from v1 order by a;
a
2
3
+connection master;
delete from v1 where a=2;
select * from v1 order by a;
a
3
+connection slave;
select * from v1 order by a;
a
3
+connection master;
alter view v1 as select a as b from t1;
+connection slave;
select * from v1 order by 1;
b
3
+connection master;
drop view v1;
+connection slave;
select * from v1 order by a;
ERROR 42S02: Table 'test.v1' doesn't exist
+connection master;
drop table t1;
+connection slave;
---> Test for BUG#20438
---> Preparing environment...
----> connection: master
+connection master;
DROP TABLE IF EXISTS t1;
DROP VIEW IF EXISTS v1;
---> Synchronizing slave with master...
+connection slave;
----> connection: master
+connection master;
---> Creating objects...
CREATE TABLE t1(c INT);
@@ -64,21 +78,22 @@ c
1
---> Synchronizing slave with master...
----> connection: master
-
----> Checking on slave...
+connection slave;
SELECT * FROM t1;
c
1
-
----> connection: master
+connection master;
---> Cleaning up...
DROP VIEW v1;
DROP TABLE t1;
+connection slave;
+connection master;
+connection master;
create table t1(a int, b int);
insert into t1 values (1, 1), (1, 2), (1, 3);
create view v1(a, b) as select a, sum(b) from t1 group by a;
+connection slave;
explain v1;
Field Type Null Key Default Extra
a int(11) YES NULL
@@ -89,14 +104,19 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
select * from v1;
a b
1 6
+connection master;
drop table t1;
drop view v1;
+connection slave;
+connection master;
CREATE TABLE t1(a INT);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 42S01: Table 'v1' already exists
DROP VIEW v1;
DROP TABLE t1;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT);
# create view as output from mysqldump 10.11 (5.0.62)
/*!50001 CREATE ALGORITHM=UNDEFINED */
@@ -106,10 +126,13 @@ CREATE TABLE t1 (a INT);
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
+connection slave;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a` from `t1` where (`t1`.`a` < 3) WITH CASCADED CHECK OPTION latin1 latin1_swedish_ci
+connection master;
DROP VIEW v1;
DROP TABLE t1;
+connection slave;
End of 5.0 tests
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view_debug.result b/mysql-test/suite/rpl/r/rpl_view_debug.result
index e4d97741d9f..22032c3fb90 100644
--- a/mysql-test/suite/rpl/r/rpl_view_debug.result
+++ b/mysql-test/suite/rpl/r/rpl_view_debug.result
@@ -6,6 +6,7 @@ include/master-slave.inc
# Check the bug where if an error occurs in mysql_register_view the view
# is still replicated to the slave
#
+connection master;
create table t1 (a int);
insert into t1 values (1);
create view v1 as select a from t1;
@@ -14,10 +15,12 @@ select * from v1 order by a;
a
1
2
+connection slave;
show tables;
Tables_in_test
t1
v1
+connection master;
set @@debug_dbug="d,simulate_register_view_failure";
CREATE VIEW v2 as SELECT * FROM t1;
ERROR HY000: Out of memory; check if mysqld or some other process uses all available memory; if not, you may have to use 'ulimit' to allow mysqld to use more memory or you can add more swap space
@@ -25,10 +28,12 @@ show tables;
Tables_in_test
t1
v1
+connection slave;
show tables;
Tables_in_test
t1
v1
+connection master;
DROP VIEW IF EXISTS v1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/rpl_view_multi.result b/mysql-test/suite/rpl/r/rpl_view_multi.result
index e42c8e51411..9f23e151206 100644
--- a/mysql-test/suite/rpl/r/rpl_view_multi.result
+++ b/mysql-test/suite/rpl/r/rpl_view_multi.result
@@ -8,8 +8,10 @@ include/master-slave.inc
#
drop tables if exists t1, t2;
drop view if exists v1;
-# Syncing slave with master and switching to connection 'slave'
-# Switching to connection 'master'
+# Syncing slave with master
+connection slave;
+connect master2,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connection master;
create table t1 (i int);
create table t2 (i int);
create view v1 as select * from t1;
@@ -19,51 +21,52 @@ create view v1 as select * from t1;
select get_lock("lock_bg25144", 1);
get_lock("lock_bg25144", 1)
1
-# Switching to connection 'master1'
+connection master1;
insert into v1 values (get_lock("lock_bg25144", 100));
-# Switching to connection 'master2'
+connection master2;
drop view v1;
-# Switching to connection 'master'
+connection master;
select release_lock("lock_bg25144");
release_lock("lock_bg25144")
1
-# Switching to connection 'master1'
+connection master1;
select release_lock("lock_bg25144");
release_lock("lock_bg25144")
1
-# Switching to connection 'master2'
-# Switching to connection 'master'
+connection master2;
+connection master;
# Check that insertion through view did happen.
select * from t1;
i
1
-# Syncing slave with master and switching to connection 'slave'
+# Syncing slave with master
+connection slave;
# Check that slave was able to replicate this sequence
# which means that we got correct binlog order.
select * from t1;
i
1
-# Switching to connection 'master'
+connection master;
# Now we will repeat the test by trying concurrently execute
# statement that uses a view and statement that alters it.
create view v1 as select * from t1;
select get_lock("lock_bg25144", 1);
get_lock("lock_bg25144", 1)
1
-# Switching to connection 'master1'
+connection master1;
insert into v1 values (get_lock("lock_bg25144", 100));
-# Switching to connection 'master2'
+connection master2;
alter view v1 as select * from t2;
-# Switching to connection 'master'
+connection master;
select release_lock("lock_bg25144");
release_lock("lock_bg25144")
1
-# Switching to connection 'master1'
+connection master1;
select release_lock("lock_bg25144");
release_lock("lock_bg25144")
1
-# Switching to connection 'master2'
-# Switching to connection 'master'
+connection master2;
+connection master;
# Second insertion should go to t1 as well.
select * from t1;
i
@@ -71,7 +74,8 @@ i
1
select * from t2;
i
-# Syncing slave with master and switching to connection 'slave'
+# Syncing slave with master
+connection slave;
# Now let us check that statements were logged in proper order
# So we have same result on slave.
select * from t1;
@@ -80,8 +84,9 @@ i
1
select * from t2;
i
-# Switching to connection 'master'
+connection master;
drop table t1, t2;
drop view v1;
-# Syncing slave with master and switching to connection 'slave'
+# Syncing slave with master
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/sec_behind_master-5114.result b/mysql-test/suite/rpl/r/sec_behind_master-5114.result
index 5554b17347d..fde02be55fe 100644
--- a/mysql-test/suite/rpl/r/sec_behind_master-5114.result
+++ b/mysql-test/suite/rpl/r/sec_behind_master-5114.result
@@ -3,7 +3,9 @@ include/master-slave.inc
call mtr.add_suppression("Unsafe statement written to the binary log");
CREATE TABLE t1 (a int);
INSERT INTO t1 VALUES(SLEEP(2));
+connection slave;
Seconds_Behind_Master: 1
+connection master;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave.
drop table t1;
diff --git a/mysql-test/suite/rpl/r/semisync_future-7591.result b/mysql-test/suite/rpl/r/semisync_future-7591.result
index 732ae09daaf..9dc0ee51e53 100644
--- a/mysql-test/suite/rpl/r/semisync_future-7591.result
+++ b/mysql-test/suite/rpl/r/semisync_future-7591.result
@@ -3,17 +3,23 @@ include/master-slave.inc
call mtr.add_suppression("Timeout waiting for reply of binlog*");
create table t1 (i int);
set global rpl_semi_sync_master_enabled = ON;
+connection slave;
include/stop_slave.inc
set global rpl_semi_sync_slave_enabled = ON;
change master to master_log_file='master-bin.000002', master_log_pos = 320;
start slave;
include/wait_for_slave_io_error.inc [errno=1236]
+connection master;
insert into t1 values (1);
reset master;
+connection slave;
include/stop_slave.inc
reset slave;
include/start_slave.inc
set global rpl_semi_sync_slave_enabled = OFF;
+connection master;
drop table t1;
+connection slave;
+connection master;
set global rpl_semi_sync_master_enabled = OFF;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/semisync_memleak_4066.result b/mysql-test/suite/rpl/r/semisync_memleak_4066.result
index c599f1426d3..3fa697532b6 100644
--- a/mysql-test/suite/rpl/r/semisync_memleak_4066.result
+++ b/mysql-test/suite/rpl/r/semisync_memleak_4066.result
@@ -1,4 +1,7 @@
include/master-slave.inc
[connection master]
+connection master;
+connect con1,localhost,root,,;
CREATE TEMPORARY TABLE tmp (i INT);
+disconnect con1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
index c2a0498509b..277b3e74696 100644
--- a/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
+++ b/mysql-test/suite/rpl/r/show_status_stop_slave_race-7126.result
@@ -1,4 +1,7 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection slave;
start slave;
+connection master;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/r/temporal_row-9560.result b/mysql-test/suite/rpl/r/temporal_row-9560.result
index c6a57d43fd0..beb72d300a9 100644
--- a/mysql-test/suite/rpl/r/temporal_row-9560.result
+++ b/mysql-test/suite/rpl/r/temporal_row-9560.result
@@ -5,11 +5,13 @@ select @@mysql56_temporal_format;
0
create table t1 (ts timestamp(3), t time(3), dt datetime(3));
insert into t1 values ('2016-02-15 12:50:06.123', '12:50:06.123', '2016-02-15 12:50:06.123');
+connection slave;
select @@mysql56_temporal_format;
@@mysql56_temporal_format
0
select * from t1;
ts t dt
2016-02-15 12:50:06.123 12:50:06.123 2016-02-15 12:50:06.123
+connection master;
drop table t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/create_or_replace2.test b/mysql-test/suite/rpl/t/create_or_replace2.test
index 79c92a7ec5b..f0091db7fb9 100644
--- a/mysql-test/suite/rpl/t/create_or_replace2.test
+++ b/mysql-test/suite/rpl/t/create_or_replace2.test
@@ -2,7 +2,6 @@
--source include/have_binlog_format_row_or_statement.inc
--source include/have_metadata_lock_info.inc
--source include/master-slave.inc
---enable_connect_log
--echo #
--echo # MDEV-6525 ; Problems with CREATE OR REPLACE under lock
@@ -40,5 +39,4 @@ unlock tables;
# Cleanup
drop function f1;
drop table t1;
---disable_connect_log
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/create_select.test b/mysql-test/suite/rpl/t/create_select.test
index c55dea92744..c1f8fc8fbf7 100644
--- a/mysql-test/suite/rpl/t/create_select.test
+++ b/mysql-test/suite/rpl/t/create_select.test
@@ -10,7 +10,6 @@
connection server_1;
---echo # On server_1
CREATE DATABASE test_8428;
USE test_8428;
CREATE TABLE t1(i INT) ENGINE=INNODB;
@@ -22,14 +21,12 @@ save_master_pos;
connection server_2;
sync_with_master;
---echo # On server_2
SHOW TABLES IN test_8428;
save_master_pos;
connection server_3;
sync_with_master;
---echo # On server_3
SHOW TABLES IN test_8428;
SELECT * from test_8428.t1;
@@ -38,4 +35,3 @@ connection server_1;
DROP DATABASE test_8428;
--source include/rpl_end.inc
--echo # End of test
-
diff --git a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
index b4798691ca3..347e88412c1 100644
--- a/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
+++ b/mysql-test/suite/rpl/t/rpl_begin_commit_rollback.test
@@ -26,7 +26,6 @@ CREATE TABLE db1.t2 (s CHAR(255)) ENGINE=MyISAM;
sync_slave_with_master;
source include/stop_slave.inc;
connection master;
-echo [on master];
DELIMITER //;
CREATE PROCEDURE db1.p1 ()
@@ -74,7 +73,6 @@ SELECT * FROM db1.t1;
SELECT * FROM db1.t2;
connection slave;
-echo [on slave];
replace_result $master_pos MASTER_POS;
eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_pos;
@@ -90,7 +88,6 @@ SELECT * from db1.t1;
SELECT * from db1.t2;
connection master;
-echo [on master];
INSERT INTO db1.t2 VALUES ('before call db1.p2()');
@@ -110,7 +107,6 @@ SELECT * FROM db1.t1;
SELECT * FROM db1.t2;
connection slave;
-echo [on slave];
replace_result $master_pos MASTER_POS;
eval start slave until master_log_file='master-bin.000001', master_log_pos=$master_pos;
@@ -133,8 +129,7 @@ source include/wait_for_slave_sql_to_start.inc;
--echo # SAVEPOINT and ROLLBACK TO have the same problem in BUG#43263
--echo # This was reported by BUG#50407
connection master;
-echo [on master]
-SET SESSION AUTOCOMMIT=0;
+echo SET SESSION AUTOCOMMIT=0;
let $binlog_start=query_get_value(SHOW MASTER STATUS, Position, 1);
BEGIN;
diff --git a/mysql-test/suite/rpl/t/rpl_bug26395.test b/mysql-test/suite/rpl/t/rpl_bug26395.test
index 2d6252c3ad9..0c1b2a7a0ac 100644
--- a/mysql-test/suite/rpl/t/rpl_bug26395.test
+++ b/mysql-test/suite/rpl/t/rpl_bug26395.test
@@ -37,7 +37,6 @@ source include/master-slave.inc;
--echo ==== Initialize ====
---echo [on master]
--connection master
CREATE TABLE tinnodb (a INT) ENGINE = INNODB;
@@ -82,12 +81,10 @@ SELECT * FROM tinnodb ORDER BY a;
# Easiest to clean up master and slave separately, without
# replication, since master and slave are out of sync.
---echo [on master]
connection master;
DROP TABLE tinnodb;
set @@debug_dbug= @old_debug;
---echo [on slave]
connection slave;
DROP TABLE tinnodb;
diff --git a/mysql-test/suite/rpl/t/rpl_charset_sjis.test b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
index 7d3d21cf9a0..af4e8ff57ec 100644
--- a/mysql-test/suite/rpl/t/rpl_charset_sjis.test
+++ b/mysql-test/suite/rpl/t/rpl_charset_sjis.test
@@ -10,11 +10,9 @@ create procedure p1 (in a varchar(255) character set sjis) insert into t1 values
SET NAMES binary;
CALL p1 ('–\\');
-select "--- on master ---";
select hex(a) from t1 ;
sync_slave_with_master;
connection slave;
-select "--- on slave ---";
select hex(a) from t1;
connection master;
drop table t1;
@@ -33,7 +31,6 @@ connection master;
--echo #
connection master;
---echo --- on master ---
SET NAMES sjis;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0x31),(X'31'),('1');
@@ -44,10 +41,8 @@ DROP PREPARE stmt;
SELECT * FROM t1;
sync_slave_with_master;
connection slave;
---echo --- on slave ---
SELECT * FROM t1;
connection master;
---echo --- on master ---
DROP TABLE t1;
sync_slave_with_master;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
index aea43a1c2a1..8d610a87b89 100644
--- a/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
+++ b/mysql-test/suite/rpl/t/rpl_circular_for_4_hosts.test
@@ -27,8 +27,7 @@ let $keep_connection= 1;
--let $_rpl_server= $rpl_server_count
while ($_rpl_server)
{
- --let $rpl_connection_name= server_$_rpl_server
- --source include/rpl_connection.inc
+ connection server_$_rpl_server;
eval SET auto_increment_increment= $rpl_server_count;
eval SET auto_increment_offset= $_rpl_server;
diff --git a/mysql-test/suite/rpl/t/rpl_create_drop_index.test b/mysql-test/suite/rpl/t/rpl_create_drop_index.test
index ee183ac331b..f1b653491b3 100644
--- a/mysql-test/suite/rpl/t/rpl_create_drop_index.test
+++ b/mysql-test/suite/rpl/t/rpl_create_drop_index.test
@@ -7,11 +7,9 @@ CREATE INDEX i1 ON t1 (a);
CREATE OR REPLACE INDEX i1 ON t1 (a, b);
sync_slave_with_master;
---echo # On slave:
SHOW CREATE TABLE t1;
connection master;
---echo # On master:
SHOW CREATE TABLE t1;
DROP TABLE t1;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_current_user.test b/mysql-test/suite/rpl/t/rpl_current_user.test
index 1f5a82486e3..391606e3720 100644
--- a/mysql-test/suite/rpl/t/rpl_current_user.test
+++ b/mysql-test/suite/rpl/t/rpl_current_user.test
@@ -58,7 +58,6 @@ GRANT CREATE USER ON *.* TO 'fakename'@'0123456789012345678901234567890123456789
--echo # User 'bug48321_1-01234' connects to master by conn1
connect (conn1, 127.0.0.1, 'bug48321_1-01234'@'localhost',,);
connection conn1;
---echo # [On conn1]
--echo # Verify 'REVOKE ALL' statement
REVOKE ALL PRIVILEGES, GRANT OPTION FROM CURRENT_USER();
--source include/rpl_sync.inc
@@ -168,40 +167,30 @@ source include/diff_tables.inc;
--echo # Verify that this patch does not affect the calling of CURRENT_USER()
--echo # in the other statements
connection master;
---echo # [On master]
INSERT INTO t1 VALUES(CURRENT_USER()), ('1234');
SELECT * FROM t1;
sync_slave_with_master;
---echo # [On slave]
SELECT * FROM t1;
---echo # [On server_3]
sync_slave_with_master server_3;
SELECT * FROM t1;
connection master;
---echo # [On master]
UPDATE t1 SET c1=CURRENT_USER() WHERE c1='1234';
SELECT * FROM t1;
sync_slave_with_master;
---echo # [On slave]
SELECT * FROM t1;
sync_slave_with_master server_3;
---echo # [On server_3]
SELECT * FROM t1;
connection master;
---echo # [On master]
DELETE FROM t1 WHERE c1=CURRENT_USER();
SELECT * FROM t1;
sync_slave_with_master;
---echo # [On slave]
SELECT * FROM t1;
sync_slave_with_master server_3;
---echo # [On server_3]
SELECT * FROM t1;
connection master;
---echo # [On master]
CREATE TABLE t2(c1 char(100));
DELIMITER |;
@@ -217,11 +206,9 @@ INSERT INTO t1 VALUES(my_user());
SELECT * FROM t1;
SELECT * FROM t2;
sync_slave_with_master;
---echo # [On slave]
SELECT * FROM t1;
SELECT * FROM t2;
sync_slave_with_master server_3;
---echo # [On server_3]
SELECT * FROM t1;
SELECT * FROM t2;
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter.test
index 1503ee1adaa..2b8ac17c1b1 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter.test
@@ -5,12 +5,10 @@
# Test for DO_DOMAIN_IDS=(M1, M2, ..) and IGNORE_DOMAIN_IDS=(N1, N2, ..)
#
---echo # On slave
connection slave;
call mtr.add_suppression("Both DO_DOMAIN_IDS & IGNORE_DOMAIN_IDS lists can't be non-empty at the same time");
call mtr.add_suppression("DO_DOMAIN_IDS or IGNORE_DOMAIN_IDS lists can't be non-empty in non-GTID mode.*");
---echo # On master
connection master;
SET @@session.gtid_domain_id= 1;
SELECT @@session.gtid_domain_id;
@@ -19,7 +17,6 @@ INSERT INTO t1 VALUES(1);
SELECT * FROM t1;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
##### Case 0 : When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are empty.
@@ -41,7 +38,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
# Lets change the session domain_id to 2(not in DO_DOMAIN_IDS).
SET @@session.gtid_domain_id= 2;
@@ -55,7 +51,6 @@ INSERT INTO t1 VALUES(3);
SELECT * FROM t1;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
SELECT * FROM t1;
@@ -76,7 +71,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
# @@session.gtid_domain_id = 1 (in IGNORE_DOMAIN_IDS)
SELECT @@session.gtid_domain_id;
@@ -90,7 +84,6 @@ INSERT INTO t1 VALUES(5);
SELECT * FROM t1;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
SELECT * FROM t1;
@@ -128,7 +121,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
# @@session.gtid_domain_id = 1 (in DO_DOMAIN_IDS)
SELECT @@session.gtid_domain_id;
@@ -151,13 +143,11 @@ INSERT INTO t1 VALUES(14);
INSERT INTO t1 VALUES(15);
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
SELECT * FROM t1;
##### Case 5: Seconds_Behind_Master
---echo # On slave
connection slave;
--echo # Seconds_Behind_Master should be zero here because the slave is fully caught up and idle.
--let $status_items= Seconds_Behind_Master
@@ -166,7 +156,6 @@ connection slave;
##### Case 6: Stop slave before a transaction (involving MyISAM and InnoDB
# table) being filtered commits.
---echo # On slave
connection slave;
--source include/stop_slave.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
@@ -183,7 +172,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
# following statements should not get filtered.
SET @@session.gtid_domain_id=2;
@@ -196,13 +184,11 @@ INSERT INTO t2 VALUES(1);
INSERT INTO t3 VALUES(1);
# Now switch to slave to stop replication.
---echo # On slave
connection slave;
--source include/stop_slave.inc
--source include/wait_for_slave_to_stop.inc
# Back to master to finish the transaction.
---echo # On master
connection master;
INSERT INTO t2 VALUES(2);
INSERT INTO t3 VALUES(2);
@@ -210,7 +196,6 @@ COMMIT;
--source include/save_master_gtid.inc
# On slave to start replication.
---echo # On slave
connection slave;
--source include/start_slave.inc
--source include/sync_with_master_gtid.inc
@@ -222,7 +207,6 @@ SELECT * FROM t3;
# table) being filtered commits and start it back with filtering
# disabled.
---echo # On master
connection master;
SET @@session.gtid_domain_id=1;
BEGIN;
@@ -230,7 +214,6 @@ INSERT INTO t2 VALUES(3);
INSERT INTO t3 VALUES(3);
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
--source include/stop_slave.inc
@@ -248,14 +231,12 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
INSERT INTO t2 VALUES(4);
INSERT INTO t3 VALUES(4);
COMMIT;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
SELECT * FROM t2;
@@ -264,7 +245,6 @@ SELECT * FROM t3;
##### Case 8: Stop slave into the middle of a transaction and start it back
# with filtering enabled.
---echo # On master
connection master;
SET @@session.gtid_domain_id=1;
BEGIN;
@@ -272,7 +252,6 @@ INSERT INTO t2 VALUES(5);
INSERT INTO t3 VALUES(5);
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
--source include/stop_slave.inc
@@ -290,14 +269,12 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
INSERT INTO t2 VALUES(6);
INSERT INTO t3 VALUES(6);
COMMIT;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
SELECT * FROM t2;
@@ -306,7 +283,6 @@ SELECT * FROM t3;
##### Case 9: Initially filter out events belonging to domain_id=2 and then
# remove the rule to check if event are not being filtered out.
---echo # On slave
connection slave;
--source include/stop_slave.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
@@ -323,7 +299,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
SET @@session.gtid_domain_id=2;
BEGIN;
@@ -333,7 +308,6 @@ COMMIT;
--source include/save_master_gtid.inc
# Clear the filter
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
--source include/stop_slave.inc
@@ -351,7 +325,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
SET @@session.gtid_domain_id=2;
BEGIN;
@@ -360,14 +333,12 @@ INSERT INTO t3 VALUES(8);
COMMIT;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
SELECT * FROM t2;
SELECT * FROM t3;
##### Case 10: Test CHANGE MASTER with various "incompatible" combinations.
-# On slave
connection slave;
--source include/stop_slave.inc
@@ -415,13 +386,11 @@ CHANGE MASTER TO IGNORE_DOMAIN_IDS=(1), DO_DOMAIN_IDS=(), MASTER_USE_GTID=SLAVE_
--source include/start_slave.inc
# Cleanup
---echo # On master
connection master;
SET @@session.gtid_domain_id=2;
DROP TABLE t1, t2, t3;
--source include/save_master_gtid.inc
---echo # On slave
connection slave;
--source include/sync_with_master_gtid.inc
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
index a28edfc0c83..9088866d28b 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_io_crash.test
@@ -2,7 +2,6 @@
--source include/have_innodb.inc
--source include/master-slave.inc
---echo # On master
connection master;
SET @@session.gtid_domain_id= 1;
SELECT @@session.gtid_domain_id;
@@ -11,7 +10,6 @@ INSERT INTO t1 VALUES(1);
SELECT * FROM t1;
sync_slave_with_master;
---echo # On slave
connection slave;
call mtr.add_suppression("Slave I/O: Relay log write failure: could not queue event from master.*");
@@ -39,7 +37,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
---echo # On master
connection master;
START TRANSACTION;
@@ -49,7 +46,6 @@ COMMIT;
save_master_pos;
SELECT * FROM t1;
---echo # On slave
connection slave;
--let $slave_io_errno= 1595
--source include/wait_for_slave_io_error.inc
@@ -82,7 +78,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
---echo # On master
connection master;
START TRANSACTION;
@@ -93,7 +88,6 @@ COMMIT;
save_master_pos;
SELECT * FROM t1;
---echo # On slave
connection slave;
--let $slave_io_errno= 1595
--source include/wait_for_slave_io_error.inc
@@ -126,7 +120,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
---echo # On master
connection master;
START TRANSACTION;
@@ -149,7 +142,6 @@ COMMIT;
save_master_pos;
SELECT * FROM t1;
---echo # On slave
connection slave;
--let $slave_io_errno= 1595
--source include/wait_for_slave_io_error.inc
@@ -195,7 +187,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SET @@global.debug_dbug="+d,kill_slave_io_before_commit";
---echo # On master
connection master;
SET @@session.gtid_domain_id= 1;
@@ -219,7 +210,6 @@ COMMIT;
save_master_pos;
SELECT * FROM t1;
---echo # On slave
connection slave;
--let $slave_io_errno= 1595
--source include/wait_for_slave_io_error.inc
@@ -265,7 +255,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
---echo # On master
connection master;
SET @@session.gtid_domain_id= 1;
@@ -289,7 +278,6 @@ COMMIT;
save_master_pos;
SELECT * FROM t1;
---echo # On slave
connection slave;
--let $slave_io_errno= 1595
--source include/wait_for_slave_io_error.inc
@@ -335,7 +323,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SET @@global.debug_dbug="+d,kill_slave_io_after_2_events";
---echo # On master
connection master;
SET @@session.gtid_domain_id= 1;
@@ -359,7 +346,6 @@ COMMIT;
save_master_pos;
SELECT * FROM t1;
---echo # On slave
connection slave;
--let $slave_io_errno= 1595
--source include/wait_for_slave_io_error.inc
@@ -385,12 +371,10 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SELECT * FROM t1;
# Cleanup
---echo # On master
connection master;
DROP TABLE t1;
sync_slave_with_master;
---echo # On slave
connection slave;
--source include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
index 032dbfdd184..0ed936d0267 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_master_crash.test
@@ -4,7 +4,6 @@
--source include/not_valgrind.inc
--source include/master-slave.inc
---echo # On master
connection master;
call mtr.add_suppression("mysqld: Table './mysql/gtid_slave_pos' is marked as crashed and should be repaired");
@@ -21,7 +20,6 @@ insert into tm set a=null;
save_master_pos;
---echo # On slave
connection slave;
sync_with_master;
--source include/stop_slave.inc
@@ -29,7 +27,6 @@ sync_with_master;
select * from ti;
select * from tm;
---echo # On master
connection master;
SET @@session.gtid_domain_id= 1;
@@ -45,7 +42,6 @@ insert into tm set a=null;
set @@global.debug_dbug="+d,crash_before_send_xid";
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
---echo # On slave
connection slave;
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
let $ignore_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Ignore_Domain_Ids, 1);
@@ -61,7 +57,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
--source include/wait_until_disconnected.inc
--enable_reconnect
@@ -73,7 +68,6 @@ connection master;
set @@global.debug_dbug="-d";
save_master_pos;
---echo # On slave
--connection slave
--source include/stop_slave.inc
--source include/start_slave.inc
@@ -82,17 +76,14 @@ select * from ti;
select * from tm;
# Cleanup
---echo # On master
--connection master
drop table ti;
drop table tm;
sync_slave_with_master;
---echo # On slave
--connection slave
--source include/stop_slave.inc
CHANGE MASTER TO DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=(), MASTER_USE_GTID=NO;
--source include/start_slave.inc
--source include/rpl_end.inc
-
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test
index 4a997dbdf52..902f6b5208d 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_parallel.test
@@ -4,7 +4,6 @@
--let $rpl_topology=1->2
--source include/rpl_init.inc
---echo # On slave
--connection server_2
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
--source include/stop_slave.inc
@@ -12,12 +11,10 @@ SET GLOBAL slave_parallel_threads=10;
##### Case 0 : When both DO_DOMAIN_IDS and IGNORE_DOMAIN_IDS are empty.
---echo # On slave
--connection server_2
CHANGE MASTER TO master_use_gtid=slave_pos, DO_DOMAIN_IDS=(), IGNORE_DOMAIN_IDS=();
--source include/start_slave.inc
---echo # On master
--connection server_1
SELECT @@session.gtid_domain_id;
ALTER TABLE mysql.gtid_slave_pos ENGINE=InnoDB;
@@ -27,16 +24,13 @@ INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1);
--save_master_pos
---echo # On slave
--connection server_2
--sync_with_master
---echo # New connection 'con_temp1'
# Block the table t1 to simulate a replicated query taking a long time.
--connect (con_temp1,127.0.0.1,root,,test,$SERVER_MYPORT_2,)
LOCK TABLE t1 WRITE;
---echo # On master
--connection server_1
SET @@session.gtid_domain_id=1;
# This query will be blocked on the slave until UNLOCK TABLES.
@@ -52,19 +46,16 @@ INSERT INTO t2 VALUES (5);
COMMIT;
INSERT INTO t2 VALUES (6);
---echo # On slave
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 6 FROM t2
--source include/wait_condition.inc
SELECT * FROM t2 ORDER by a;
---echo # On con_temp1
--connection con_temp1
SELECT * FROM t1;
UNLOCK TABLES;
---echo # On slave
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
--source include/wait_condition.inc
@@ -73,7 +64,6 @@ SELECT * FROM t1 ORDER BY a;
##### Case 1 : When DO_DOMAIN_IDS=(1)
---echo # On slave
--connection server_2
--source include/stop_slave.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
@@ -91,16 +81,13 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On slave
--connection server_2
--sync_with_master
---echo # On con_temp1
# Block the table t1 to simulate a replicated query taking a long time.
--connection con_temp1
LOCK TABLE t1 WRITE;
---echo # On master
--connection server_1
SET @@session.gtid_domain_id=0;
# This query will be blocked on the slave until UNLOCK TABLES.
@@ -118,19 +105,16 @@ INSERT INTO t2 VALUES (10);
COMMIT;
INSERT INTO t2 VALUES (11);
---echo # On slave
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 11 FROM t2
--source include/wait_condition.inc
SELECT * FROM t2 ORDER by a;
---echo # On con_temp1
--connection con_temp1
SELECT * FROM t1;
UNLOCK TABLES;
---echo # On slave
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
--source include/wait_condition.inc
@@ -139,7 +123,6 @@ SELECT * FROM t1 ORDER BY a;
##### Case 2 : When IGNORE_DOMAIN_IDS=(1)
---echo # On slave
--connection server_2
--source include/stop_slave.inc
let $do_domain_ids_before= query_get_value(SHOW SLAVE STATUS, Replicate_Do_Domain_Ids, 1);
@@ -157,16 +140,13 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On slave
--connection server_2
--sync_with_master
---echo # On con_temp1
# Block the table t1 to simulate a replicated query taking a long time.
--connection con_temp1
LOCK TABLE t1 WRITE;
---echo # On master
--connection server_1
SET @@session.gtid_domain_id=1;
# This query will be blocked on the slave until UNLOCK TABLES. However, since
@@ -183,19 +163,16 @@ INSERT INTO t2 VALUES (15);
COMMIT;
INSERT INTO t2 VALUES (16);
---echo # On slave
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 16 FROM t2
--source include/wait_condition.inc
SELECT * FROM t2 ORDER by a;
---echo # On con_temp1
--connection con_temp1
SELECT * FROM t1;
UNLOCK TABLES;
---echo # On slave
--connection server_2
--let $wait_condition= SELECT COUNT(*) = 2 FROM t1
--source include/wait_condition.inc
@@ -204,13 +181,11 @@ SELECT * FROM t1 ORDER BY a;
SELECT * FROM t2;
--echo # Restore original settings.
---echo # On master
--connection server_1
SET @@session.gtid_domain_id=0;
DROP TABLE t1, t2;
--save_master_pos
---echo # On slave
--connection server_2
--sync_with_master
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test b/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test
index e21700995bb..8083b8f232f 100644
--- a/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test
+++ b/mysql-test/suite/rpl/t/rpl_domain_id_filter_restart.test
@@ -5,7 +5,6 @@
#
---echo # On slave
connection slave;
source include/stop_slave.inc;
@@ -23,7 +22,6 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
--echo DO_DOMAIN_IDS (AFTER) : $do_domain_ids_after
--echo IGNORE_DOMAIN_IDS (AFTER) : $ignore_domain_ids_after
---echo # On master
connection master;
SET @@session.gtid_domain_id= 0;
CREATE TABLE t1(i INT);
@@ -39,7 +37,6 @@ SELECT * FROM t2;
sync_slave_with_master;
---echo # On slave
connection slave;
SELECT * FROM t1;
SELECT * FROM t2;
@@ -48,7 +45,6 @@ SELECT * FROM t2;
--let $rpl_server_number= 2
--source include/rpl_restart_server.inc
---echo # On slave
# Replicate_Do_Domain_Ids/Replicate_Ignore_Domain_Ids should reinitialize
# properly on restart.
connection slave;
@@ -69,11 +65,9 @@ let $ignore_domain_ids_after= query_get_value(SHOW SLAVE STATUS, Replicate_Ignor
SELECT * FROM t1;
SELECT * FROM t2;
---echo # On master
connection master;
SET @@session.gtid_domain_id= 0;
DROP TABLE t1, t2;
sync_slave_with_master;
--source include/rpl_end.inc
-
diff --git a/mysql-test/suite/rpl/t/rpl_drop_temp.test b/mysql-test/suite/rpl/t/rpl_drop_temp.test
index d77632d2ed1..7158e2a8596 100644
--- a/mysql-test/suite/rpl/t/rpl_drop_temp.test
+++ b/mysql-test/suite/rpl/t/rpl_drop_temp.test
@@ -52,7 +52,6 @@ connection slave;
stop slave;
wait_for_slave_to_stop;
---echo **** On Master ****
connection master;
CREATE TEMPORARY TABLE tmp3 (a int);
DROP TEMPORARY TABLE tmp3;
diff --git a/mysql-test/suite/rpl/t/rpl_events.test b/mysql-test/suite/rpl/t/rpl_events.test
index 1de5006f647..5bdf8ad2412 100644
--- a/mysql-test/suite/rpl/t/rpl_events.test
+++ b/mysql-test/suite/rpl/t/rpl_events.test
@@ -70,7 +70,6 @@ CREATE /*!50000 DEFINER='user44331' */ EVENT event44331_4
SELECT '123'|
DELIMITER ;|
---echo #on master
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
where EVENT_NAME='event44331_1';
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
@@ -82,7 +81,6 @@ select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
sync_slave_with_master;
connection slave;
---echo #on slave
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
where EVENT_NAME='event44331_1';
select EVENT_SCHEMA, EVENT_NAME, DEFINER from information_schema.events
diff --git a/mysql-test/suite/rpl/t/rpl_filter_dbs_dynamic.test b/mysql-test/suite/rpl/t/rpl_filter_dbs_dynamic.test
index 9439ee32a42..05590a0a9aa 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_dbs_dynamic.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_dbs_dynamic.test
@@ -50,11 +50,9 @@ SHOW DATABASES LIKE 'db%';
SHOW TABLES IN db1 LIKE 't%';
connection master;
-echo [on master];
# Clean up
connection master;
-echo [on master];
DROP DATABASE IF EXISTS db1;
DROP DATABASE IF EXISTS db2;
DROP DATABASE IF EXISTS db3;
diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test b/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test
index 97ecc167356..d4a4faf8d67 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_tables_dynamic.test
@@ -85,11 +85,9 @@ INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3);
# Only t1, t2, t3 should be replicated to slave
sync_slave_with_master;
-echo [on slave];
SHOW TABLES LIKE 't%';
connection master;
-echo [on master];
#
# Do tables are not referenced, these statements should be ignored by
@@ -209,7 +207,6 @@ SELECT * FROM t3;
# Clean up
connection master;
-echo [on master];
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
index 4c54a05ff84..ee6daac71ea 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_tables_not_exist.test
@@ -80,11 +80,9 @@ INSERT INTO t9 VALUES (1, 1), (2, 2), (3, 3);
# Only t1, t2, t3 should be replicated to slave
sync_slave_with_master;
-echo [on slave];
SHOW TABLES LIKE 't%';
connection master;
-echo [on master];
#
# Do tables are not referenced, these statements should be ignored by
@@ -204,7 +202,6 @@ SELECT * FROM t3;
# Clean up
connection master;
-echo [on master];
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test b/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test
index c822c81f270..6db61927eec 100644
--- a/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test
+++ b/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test
@@ -33,15 +33,12 @@ INSERT INTO c1 VALUES (3);
# Only a1 should be replicated to slave
sync_slave_with_master;
-echo [on slave];
SHOW TABLES LIKE '%1';
connection master;
-echo [on master];
# Clean up
connection master;
-echo [on master];
DROP TABLE IF EXISTS a1,b1,c1;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_function_defaults.test b/mysql-test/suite/rpl/t/rpl_function_defaults.test
index 24bec10d305..f24132994cc 100644
--- a/mysql-test/suite/rpl/t/rpl_function_defaults.test
+++ b/mysql-test/suite/rpl/t/rpl_function_defaults.test
@@ -4,19 +4,16 @@
source include/master-slave.inc;
---echo connection master
connection master;
SET TIME_ZONE="+10:30";
SET TIMESTAMP=123456.789123;
SELECT CURRENT_TIMESTAMP;
---echo connection slave
connection slave;
SET TIME_ZONE="+00:00";
SET TIMESTAMP=987654321.123456;
SELECT CURRENT_TIMESTAMP;
---echo connection master
connection master;
CREATE TABLE t1 (
a TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -61,13 +58,11 @@ INSERT INTO t2 ( o ) VALUES ( 1 );
--echo sync_slave_with_master
sync_slave_with_master;
---echo connection slave
connection slave;
query_vertical SELECT * FROM t1;
query_vertical SELECT * FROM t2;
---echo connection master
connection master;
SET TIMESTAMP=1234567890.123456;
@@ -79,13 +74,11 @@ UPDATE t2 SET o = 2;
--echo sync_slave_with_master
sync_slave_with_master;
---echo connection slave
connection slave;
query_vertical SELECT * FROM t1;
query_vertical SELECT * FROM t2;
---echo connection master
connection master;
DROP TABLE t1, t2;
diff --git a/mysql-test/suite/rpl/t/rpl_grant.test b/mysql-test/suite/rpl/t/rpl_grant.test
index 1091e5aab0d..a1afa28847e 100644
--- a/mysql-test/suite/rpl/t/rpl_grant.test
+++ b/mysql-test/suite/rpl/t/rpl_grant.test
@@ -3,7 +3,6 @@
source include/master-slave.inc;
source include/not_embedded.inc;
---echo **** On Master ****
connection master;
CREATE USER dummy@localhost;
@@ -16,7 +15,6 @@ sync_slave_with_master;
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
---echo **** On Master ****
connection master;
# No user exists
@@ -33,7 +31,6 @@ DROP USER dummy1@localhost, dummy2@localhost;
SELECT user, host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
sync_slave_with_master;
---echo **** On Slave ****
SELECT user,host FROM mysql.user WHERE user like 'dummy%';
SELECT COUNT(*) FROM mysql.user WHERE user like 'dummy%';
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test b/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test
index e6016b17717..064f7b8ab78 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_mdev4474.test
@@ -23,8 +23,6 @@ change master to master_use_gtid=slave_pos;
--echo #
--echo # Create some 0-1-* and 0-2-* events in binlog of server 2
---enable_connect_log
-
--connection server_1
create table t1 (i int) engine=InnoDB;
insert into t1 values (1);
@@ -44,8 +42,6 @@ insert into t1 values (2);
insert into t2 values (1);
--save_master_pos
---disable_connect_log
-
--echo #
--echo # All events are present in the binlog of server 2
diff --git a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
index 6bdd2bbee63..e0fdf668dc6 100644
--- a/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
+++ b/mysql-test/suite/rpl/t/rpl_heartbeat_2slaves.test
@@ -74,19 +74,15 @@ let $status_var_comparsion= >;
--source include/wait_for_status_var.inc
--echo slave_1 has received heartbeat event
--connection master
---echo [on master]
CREATE TABLE t1 (a INT PRIMARY KEY, b VARCHAR(10), c LONGTEXT);
INSERT INTO t1 VALUES (1, 'on master', '');
SHOW TABLES;
---echo [on slave_2]
--sync_slave_with_master slave_2
SHOW TABLES;
let $slave_2_pos_before= query_get_value(SHOW SLAVE STATUS, Read_Master_Log_Pos, 1);
---echo [on slave_1]
--sync_slave_with_master slave_1
SHOW TABLES;
--connection master
---echo [on master]
--echo creating updates on master and send to slave_2 during 5 second
# Generate events on master and send to slave_2 during 5 second
let $i= 1;
@@ -113,7 +109,6 @@ while ($i) {
}
--enable_query_log
--connection slave_1
---echo [on slave_1]
--let $assert_cond= [SHOW STATUS LIKE "slave_received_heartbeats", Value, 1] > $slave_1_rcvd_heartbeats_before
--let $assert_text= slave_1 should have received heartbeats
--source include/assert.inc
diff --git a/mysql-test/suite/rpl/t/rpl_ignore_table.test b/mysql-test/suite/rpl/t/rpl_ignore_table.test
index f9b01c83917..a5f7b608174 100644
--- a/mysql-test/suite/rpl/t/rpl_ignore_table.test
+++ b/mysql-test/suite/rpl/t/rpl_ignore_table.test
@@ -17,7 +17,6 @@ call mtr.add_suppression("Can't find record in 'tables_priv'");
#
--echo **** Test case for BUG#16487 ****
---echo **** Master ****
connection master;
CREATE TABLE test.t4 (a int);
CREATE TABLE test.t1 (a int);
@@ -25,7 +24,6 @@ CREATE TABLE test.t1 (a int);
# Expect: The row must *not* by updated on slave, since t1 is ignored
UPDATE test.t4 NATURAL JOIN test.t1 SET t1.a=5;
---echo **** Slave ****
sync_slave_with_master;
SELECT * FROM t4;
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix.test b/mysql-test/suite/rpl/t/rpl_ip_mix.test
index 2122b831eea..3ddbd598334 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix.test
@@ -23,15 +23,11 @@ let $IPv6= 0:0:0:0:0:0:0:1;
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
---echo connect (master,$IPv6,root,,test,MASTER_MYPORT);
connect (master,$IPv6,root,,test,$MASTER_MYPORT);
---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_ip_mix2.test b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
index 594900fe7a1..feaf4af44cf 100644
--- a/mysql-test/suite/rpl/t/rpl_ip_mix2.test
+++ b/mysql-test/suite/rpl/t/rpl_ip_mix2.test
@@ -23,16 +23,12 @@ let $IPv6= 0:0:0:0:0:0:0:1;
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
---echo connect (slave,$IPv6,root,,test,SLAVE_MYPORT);
connect (slave,$IPv6,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
index 08d94ab85f5..d17b32c321f 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv4_as_ipv6.test
@@ -39,16 +39,12 @@ let $IPv6= ::FFFF:127.0.0.1;
let $IPv6= ::FFFF:127.0.0.1;
--echo #################### IP: $IPv6 ###########################
---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_ipv6.test b/mysql-test/suite/rpl/t/rpl_ipv6.test
index 3ff58714407..f379583212e 100644
--- a/mysql-test/suite/rpl/t/rpl_ipv6.test
+++ b/mysql-test/suite/rpl/t/rpl_ipv6.test
@@ -25,16 +25,12 @@ let $IPv6= 0:0:0:0:0:0:0:1;
let $IPv6= ::1;
--echo #################### IP: $IPv6 mix #######################
---echo connect (master,127.0.0.1,root,,test,MASTER_MYPORT);
connect (master,127.0.0.1,root,,test,$MASTER_MYPORT);
---echo connect (slave,127.0.0.1,root,,test,SLAVE_MYPORT);
connect (slave,127.0.0.1,root,,test,$SLAVE_MYPORT);
---echo connection master;
connection master;
reset master;
source include/show_master_status.inc;
save_master_pos;
---echo connection slave;
connection slave;
reset slave;
let $master_host= query_get_value(SHOW SLAVE STATUS, Master_Host, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_killed_ddl.test b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
index eff0392d5de..dcd3ec3625b 100644
--- a/mysql-test/suite/rpl/t/rpl_killed_ddl.test
+++ b/mysql-test/suite/rpl/t/rpl_killed_ddl.test
@@ -118,7 +118,6 @@ let $connection_name= master1;
let $connection_id= `SELECT CONNECTION_ID()`;
connection master;
-echo [on master];
# This will block the execution of a statement at the DBUG_SYNC_POINT
# with given lock name
@@ -136,7 +135,6 @@ if ($debug_lock)
######## START TEST ########
connection master1;
-echo [on master1];
disable_warnings;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddata_map.test b/mysql-test/suite/rpl/t/rpl_loaddata_map.test
index 24c8221c20f..655bcc39cb9 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddata_map.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddata_map.test
@@ -59,14 +59,12 @@ source include/show_binlog_events.inc;
--echo ==== Verify results on slave ====
---echo [on slave]
sync_slave_with_master;
select count(*) from t2 /* 5 000 */;
--echo ==== Clean up ====
---echo [on master]
connection master;
drop table t2;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
index 30c9ff1e9e2..d3a5c9f7cc6 100644
--- a/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
+++ b/mysql-test/suite/rpl/t/rpl_loaddatalocal.test
@@ -67,7 +67,6 @@ sync_with_master;
#
--echo ==== Bug22504 Initialize ====
---echo [on master]
--connection master
SET sql_mode='ignore_space';
@@ -81,17 +80,14 @@ eval load data local infile '$MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile' i
--remove_file $MYSQLD_DATADIR/rpl_loaddatalocal.select_outfile
SELECT * FROM t1 ORDER BY a;
---echo [on slave]
sync_slave_with_master;
SELECT * FROM t1 ORDER BY a;
--echo ==== Clean up ====
---echo [on master]
connection master;
DROP TABLE t1;
---echo [on slave]
sync_slave_with_master;
--echo
@@ -99,7 +95,6 @@ sync_slave_with_master;
--echo "return wrong query string when parse 'load data infile' sql statement"
--echo
---echo [master]
connection master;
let $MYSQLD_DATADIR= `select @@datadir`;
SELECT @@SESSION.sql_mode INTO @old_mode;
@@ -148,7 +143,6 @@ SET sql_mode='PIPES_AS_CONCAT,ANSI_QUOTES,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIE
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug43746.sql' INTO TABLE t1;
---echo [slave]
sync_slave_with_master;
--echo
@@ -156,7 +150,6 @@ sync_slave_with_master;
--echo "LOAD DATA LOCAL INFILE not executed on slave with SBR"
--echo
---echo [master]
connection master;
--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
@@ -168,12 +161,10 @@ eval LOAD DATA LOCAL INFILE '$MYSQLD_DATADIR/bug59267.sql' INTO TABLE t1;
SELECT 'Master', COUNT(*) FROM t1;
---echo [slave]
--sync_slave_with_master
SELECT 'Slave', COUNT(*) FROM t1;
# cleanup
---echo [master]
connection master;
--remove_file $MYSQLD_DATADIR/bug43746.sql
@@ -182,7 +173,6 @@ connection master;
DROP TABLE t1;
SET SESSION sql_mode=@old_mode;
---echo [slave]
sync_slave_with_master;
connection master;
@@ -192,7 +182,6 @@ connection master;
--echo "statement improperly replicated crashes slave sql thread"
--echo
---echo [master]
connection master;
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -218,20 +207,17 @@ SELECT * FROM t1;
sleep 1;
---echo [slave]
sync_slave_with_master;
SELECT * FROM t1;
--remove_file $MYSQLD_DATADIR/bug60580.csv
---echo [master]
connection master;
DROP VIEW v1;
DROP TABLE t1, t2, t3;
---echo [slave]
sync_slave_with_master;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
index 433280326c7..c8b2eaef53b 100644
--- a/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
+++ b/mysql-test/suite/rpl/t/rpl_mix_found_rows.test
@@ -11,7 +11,6 @@ source include/master-slave.inc;
--echo ==== Initialize ====
---echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT);
CREATE TABLE logtbl (sect INT, test INT, count INT);
@@ -26,7 +25,6 @@ INSERT INTO t1 SELECT 2*a+3 FROM t1;
--echo ==== Checking a procedure ====
---echo **** On Master ****
connection master;
# We will now check some stuff that will not work in statement-based
@@ -40,24 +38,19 @@ END $$
--delimiter ;
sync_slave_with_master;
---echo **** On Master 1 ****
connection master1;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
CALL just_log(1,1);
---echo **** On Master ****
connection master;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
CALL just_log(1,2);
---echo **** On Master 1 ****
-
connection master1;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a < 5 ORDER BY a LIMIT 1;
CALL just_log(1,3);
sync_slave_with_master;
---echo **** On Master ****
connection master;
SELECT SQL_CALC_FOUND_ROWS * FROM t1 WHERE a > 5 ORDER BY a LIMIT 1;
CALL just_log(1,4);
@@ -65,12 +58,10 @@ sync_slave_with_master;
connection master;
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
--echo ==== Checking a stored function ====
---echo **** On Master ****
connection master;
--delimiter $$
CREATE FUNCTION log_rows(sect INT, test INT)
diff --git a/mysql-test/suite/rpl/t/rpl_name_const.test b/mysql-test/suite/rpl/t/rpl_name_const.test
index 4cacafa0523..074bc148be8 100644
--- a/mysql-test/suite/rpl/t/rpl_name_const.test
+++ b/mysql-test/suite/rpl/t/rpl_name_const.test
@@ -12,7 +12,6 @@ source include/master-slave.inc;
--echo ==== Initialize ====
---echo [on master]
--connection master
create table t1 (id int);
@@ -35,13 +34,11 @@ delimiter ;$$
call test_procedure(1234);
---echo [on slave]
sync_slave_with_master;
select * from t1 order by id;
--echo ==== Clean up ====
---echo [on master]
connection master;
drop table t1;
drop procedure test_procedure;
diff --git a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
index 83d847318d8..a540aedc70c 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel_show_binlog_events_purge_logs.test
@@ -12,18 +12,15 @@
--source include/have_debug_sync.inc
--source include/master-slave.inc
---echo [connection slave]
--connection slave
SET DEBUG_SYNC= 'after_show_binlog_events SIGNAL on_show_binlog_events WAIT_FOR end';
--send SHOW BINLOG EVENTS
--connection slave1
---echo [connection slave1]
SET DEBUG_SYNC= 'now WAIT_FOR on_show_binlog_events';
FLUSH LOGS;
SET DEBUG_SYNC= 'now SIGNAL end';
---echo [connection slave]
--connection slave
--disable_result_log
--reap
diff --git a/mysql-test/suite/rpl/t/rpl_password_boundaries.test b/mysql-test/suite/rpl/t/rpl_password_boundaries.test
index d812ab5efc8..9e9685943f7 100644
--- a/mysql-test/suite/rpl/t/rpl_password_boundaries.test
+++ b/mysql-test/suite/rpl/t/rpl_password_boundaries.test
@@ -11,7 +11,6 @@ call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received w
enable_query_log;
connection master;
-echo [ on master ];
# wait for dying connections (if any) to disappear
let $wait_condition= select count(*) = 0 from information_schema.processlist where command='killed';
@@ -24,21 +23,18 @@ grant replication slave on *.* to rpl32@127.0.0.1 identified by '0123456789abcde
set sql_log_bin=1;
connection slave;
-echo [ on slave ];
source include/stop_slave.inc;
change master to master_user='rpl32',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef';
source include/start_slave.inc;
connection master;
-echo [ on master ];
drop table if exists t1;
create table t1 (i int);
insert into t1 values (1);
sync_slave_with_master;
-echo [ on slave: synchronized ];
+echo [ synchronized ];
connection master;
-echo [ on master ];
# 32*3+1 -character ASCII password expected to fail
set sql_log_bin=0;
@@ -46,7 +42,6 @@ grant replication slave on *.* to rpl33@127.0.0.1 identified by '0123456789abcde
set sql_log_bin=1;
connection slave;
-echo [ on slave ];
source include/stop_slave.inc;
--error ER_WRONG_STRING_LENGTH
change master to master_user='rpl33',master_password='0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef!';
@@ -59,35 +54,30 @@ change master to master_host='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
# 48-character cyrillic password should work all right
connection master;
-echo [ on master ];
set sql_log_bin=0;
grant replication slave on *.* to rpl16cyr@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль';
set sql_log_bin=1;
connection slave;
-echo [ on slave ];
SET NAMES utf8;
change master to master_user='rpl16cyr',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль';
source include/start_slave.inc;
connection master;
-echo [ on master ];
drop table if exists t1;
create table t1 (i int);
insert into t1 values (1);
sync_slave_with_master;
-echo [ on slave: synchronized ];
+echo [ synchronized ];
# 48+1-character cyrillic password should fail
connection master;
-echo [ on master ];
set sql_log_bin=0;
grant replication slave on *.* to rpl17mix@127.0.0.1 identified by 'воттакойужпарольвоттакойужпарольвоттакойужпароль!';
set sql_log_bin=1;
connection slave;
-echo [ on slave ];
source include/stop_slave.inc;
--error ER_WRONG_STRING_LENGTH
change master to master_user='rpl17mix',master_password='воттакойужпарольвоттакойужпарольвоттакойужпароль!';
@@ -95,7 +85,6 @@ change master to master_user='rpl17mix',master_password='воттакойужпÐ
# Cleanup
connection master;
-echo [ on master ];
set sql_log_bin=0;
drop user rpl32@127.0.0.1, rpl33@127.0.0.1, rpl16cyr@127.0.0.1, rpl17mix@127.0.0.1;
set sql_log_bin=1;
diff --git a/mysql-test/suite/rpl/t/rpl_plugin_load.test b/mysql-test/suite/rpl/t/rpl_plugin_load.test
index def10f50a64..c319479af50 100644
--- a/mysql-test/suite/rpl/t/rpl_plugin_load.test
+++ b/mysql-test/suite/rpl/t/rpl_plugin_load.test
@@ -33,11 +33,11 @@ SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
# Wait for slave to catch up with master.
sync_slave_with_master;
#
- --echo connection slave: Verify that example engine is not installed.
+ --echo Verify that example engine is not installed.
connection slave;
SELECT * FROM INFORMATION_SCHEMA.ENGINES WHERE ENGINE='EXAMPLE';
#
---echo connection master: Uninstall example engine.
+--echo Uninstall example engine.
connection master;
--echo Get binlog position before uninstall plugin.
let $before_pos = query_get_value("SHOW MASTER STATUS", Position, 1);
diff --git a/mysql-test/suite/rpl/t/rpl_ps.test b/mysql-test/suite/rpl/t/rpl_ps.test
index b4ea3a385b1..45ab55bff8c 100644
--- a/mysql-test/suite/rpl/t/rpl_ps.test
+++ b/mysql-test/suite/rpl/t/rpl_ps.test
@@ -63,12 +63,10 @@ source include/wait_for_slave_to_stop.inc;
###############################################################################
---echo # Connection: slave
--connection slave
START SLAVE;
---echo # Connection: master
--connection master
CREATE DATABASE mysqltest1;
@@ -82,12 +80,10 @@ use mysqltest1;
EXECUTE stmt_d_1;
---echo # Connection: slave
--sync_slave_with_master
SELECT * FROM t1;
---echo # Connection: master
--connection master
DROP DATABASE mysqltest1;
diff --git a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
index d7c82266ebf..1bc20c1e2a3 100644
--- a/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
+++ b/mysql-test/suite/rpl/t/rpl_rbr_to_sbr.test
@@ -4,13 +4,11 @@
# Test that the slave temporarily switches to ROW when seeing row
# events when it is in MIXED mode
---echo **** On Master ****
CREATE TABLE t1 (a INT, b LONG);
INSERT INTO t1 VALUES (1,1), (2,2);
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
source include/show_binlog_events.inc;
sync_slave_with_master;
---echo **** On Slave ****
source include/show_binlog_events.inc;
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
diff --git a/mysql-test/suite/rpl/t/rpl_replicate_do.test b/mysql-test/suite/rpl/t/rpl_replicate_do.test
index 605a00ce3d2..e2b488394d1 100644
--- a/mysql-test/suite/rpl/t/rpl_replicate_do.test
+++ b/mysql-test/suite/rpl/t/rpl_replicate_do.test
@@ -35,7 +35,6 @@ source include/show_slave_status.inc;
#
# Bug#24478 DROP TRIGGER is not caught by replicate-*-table filters
#
---echo *** master ***
connection master;
create table t1 (a int, b int);
create trigger trg1 before insert on t1 for each row set new.b=2;
@@ -44,21 +43,17 @@ create trigger trg2 before insert on t2 for each row set new.b=2;
show tables;
show triggers;
sync_slave_with_master;
---echo *** slave ***
connection slave;
show tables;
show triggers;
---echo *** master ***
connection master;
drop trigger trg1;
drop trigger trg2;
show triggers;
sync_slave_with_master;
---echo *** slave ***
connection slave;
show tables;
show triggers;
---echo *** master ***
connection master;
drop table t1;
drop table t2;
diff --git a/mysql-test/suite/rpl/t/rpl_rewrt_db.test b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
index 996ad0a10c7..aa488258c3b 100644
--- a/mysql-test/suite/rpl/t/rpl_rewrt_db.test
+++ b/mysql-test/suite/rpl/t/rpl_rewrt_db.test
@@ -133,17 +133,11 @@ SET sql_log_bin= 1;
--echo **** t_03_01_temp, t_03_02_temp, t_03_03_temp on database_master_temp_03
--echo ****
---echo
---echo con_temp_01
---echo
connection con_temp_01;
USE database_master_temp_01;
CREATE TEMPORARY TABLE t_01_01_temp(a int);
INSERT INTO t_01_01_temp VALUES(1);
---echo
---echo con_temp_02
---echo
connection con_temp_02;
USE database_master_temp_01;
CREATE TEMPORARY TABLE t_01_01_temp(a int);
@@ -154,9 +148,6 @@ INSERT INTO t_02_01_temp VALUES(1);
CREATE TEMPORARY TABLE t_02_02_temp(a int);
INSERT INTO t_02_02_temp VALUES(1);
---echo
---echo con_temp_03
---echo
connection con_temp_03;
USE database_master_temp_01;
CREATE TEMPORARY TABLE t_01_01_temp(a int);
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
index 82929d57db5..b875b97d0ce 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test
@@ -14,7 +14,6 @@ call mtr.add_suppression("Can't find record in 't.'");
CREATE DATABASE test_ignore; # --binlog_ignore_db=mysqltest_ignore
---echo **** On Master ****
SHOW DATABASES;
USE test;
CREATE TABLE t1 (a INT, b INT);
@@ -26,7 +25,6 @@ SHOW TABLES;
INSERT INTO t2 VALUES (3,3), (4,4);
source include/show_binlog_events.inc;
sync_slave_with_master;
---echo **** On Slave ****
SHOW DATABASES;
USE test;
SHOW TABLES;
@@ -61,33 +59,26 @@ DROP TABLE t1;
--echo ================ Test for BUG#17620 ================
--source include/rpl_reset.inc
---echo **** On Slave ****
connection slave;
SET GLOBAL QUERY_CACHE_SIZE=0;
call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1.* error.* 1032");
---echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
---echo **** On Slave ****
sync_slave_with_master;
SET GLOBAL QUERY_CACHE_SIZE=16*1024*1024;
---echo **** On Master ****
connection master;
INSERT INTO t1 VALUES (4),(5),(6);
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1;
---echo **** On Master ****
connection master;
INSERT INTO t1 VALUES (7),(8),(9);
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM t1;
@@ -128,13 +119,11 @@ sync_slave_with_master;
# disabling warnings temporarily for ENGINE=INNODB to work without InnoDB
--disable_warnings
---echo **** On Master ****
connection master;
CREATE TABLE t1_myisam (k INT, a BIT(1), b BIT(9)) ENGINE=MYISAM;
CREATE TABLE t1_innodb (k INT, a BIT(1), b BIT(9)) ENGINE=INNODB;
CREATE TABLE t2_myisam (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=MYISAM;
CREATE TABLE t2_innodb (k INT, a BIT(1) NOT NULL, b BIT(4) NOT NULL) ENGINE=INNODB;
---echo **** On Slave ****
sync_slave_with_master;
ALTER TABLE t1_myisam ENGINE=INNODB;
ALTER TABLE t1_innodb ENGINE=MYISAM;
@@ -142,7 +131,6 @@ ALTER TABLE t2_myisam ENGINE=INNODB;
ALTER TABLE t2_innodb ENGINE=MYISAM;
--enable_warnings
---echo **** On Master ****
connection master;
INSERT INTO t1_myisam VALUES(1, b'0', 257);
INSERT INTO t1_myisam VALUES(2, b'1', 256);
@@ -156,14 +144,12 @@ INSERT INTO t2_innodb VALUES(1, b'0', 9);
INSERT INTO t2_innodb VALUES(2, b'1', 8);
SELECT k, HEX(a),HEX(b) FROM t2_myisam;
SELECT k, HEX(a),HEX(b) FROM t2_innodb;
---echo **** On Slave ****
sync_slave_with_master;
SELECT k, HEX(a),HEX(b) FROM t1_myisam;
SELECT k, HEX(a),HEX(b) FROM t1_innodb;
SELECT k, HEX(a),HEX(b) FROM t2_myisam;
SELECT k, HEX(a),HEX(b) FROM t2_innodb;
---echo **** On Master ****
connection master;
UPDATE t1_myisam SET a=0 WHERE k=2;
SELECT k, HEX(a),HEX(b) FROM t1_myisam;
@@ -173,14 +159,12 @@ UPDATE t2_myisam SET a=0 WHERE k=2;
SELECT k, HEX(a),HEX(b) FROM t2_myisam;
UPDATE t2_innodb SET a=0 WHERE k=2;
SELECT k, HEX(a),HEX(b) FROM t2_innodb;
---echo **** On Slave ****
sync_slave_with_master;
SELECT k, HEX(a),HEX(b) FROM t1_myisam;
SELECT k, HEX(a),HEX(b) FROM t1_innodb;
SELECT k, HEX(a),HEX(b) FROM t2_myisam;
SELECT k, HEX(a),HEX(b) FROM t2_innodb;
---echo **** On Master ****
connection master;
DROP TABLE IF EXISTS t1_myisam, t1_innodb, t2_myisam, t2_innodb;
sync_slave_with_master;
@@ -231,11 +215,9 @@ sync_slave_with_master;
--source include/rpl_reset.inc
---echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b SET('master','slave'));
INSERT INTO t1 VALUES (1,'master,slave'), (2,'master,slave');
---echo **** On Slave ****
sync_slave_with_master;
UPDATE t1 SET a = 5, b = 'slave' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
@@ -243,11 +225,9 @@ SELECT * FROM t1 ORDER BY a;
# order for the preceding test UPDATE t1 to pass, the mode is switched
# temprorarily
set @@global.slave_exec_mode= 'IDEMPOTENT';
---echo **** On Master ****
connection master;
UPDATE t1 SET a = 5, b = 'master' WHERE a = 1;
SELECT * FROM t1 ORDER BY a;
---echo **** On Slave ****
sync_slave_with_master;
set @@global.slave_exec_mode= default;
let $last_error = query_get_value("SHOW SLAVE STATUS", Last_SQL_Error, 1);
@@ -257,7 +237,6 @@ enable_query_log;
SELECT * FROM t1 ORDER BY a;
---echo **** On Master ****
connection master;
DROP TABLE t1;
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
index 4262d765148..7a4770569cd 100644
--- a/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
+++ b/mysql-test/suite/rpl/t/rpl_row_basic_8partition.test
@@ -37,10 +37,8 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
PARTITION p4 VALUES LESS THAN (2005),
PARTITION p5 VALUES LESS THAN MAXVALUE);
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave --
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -50,10 +48,8 @@ connection master;
# Check that simple Alter statements are replicated correctly
ALTER TABLE t1 MODIFY vc TEXT;
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -83,10 +79,8 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
PARTITION p1 VALUES IN (42, 142),
PARTITION p2 VALUES IN (412));
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -97,10 +91,8 @@ connection master;
# Check that simple Alter statements are replicated correctly ---
ALTER TABLE t1 MODIFY vc TEXT;
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -126,10 +118,8 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
PARTITION BY HASH( YEAR(t) )
PARTITIONS 4;
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -138,10 +128,8 @@ SHOW CREATE TABLE t1;
# Check that simple Alter statements are replicated correctly
ALTER TABLE t1 MODIFY vc TEXT;
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -167,10 +155,8 @@ CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255),
PARTITION BY KEY()
PARTITIONS 4;
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -180,10 +166,8 @@ connection master;
# Check that simple Alter statements are replicated correctly
ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
@@ -193,10 +177,8 @@ connection master;
# Check that simple Alter statements are replicated correctly
ALTER TABLE t1 MODIFY vc TEXT;
---echo --- On master ---
SHOW CREATE TABLE t1;
---echo --- On slave ---
sync_slave_with_master;
SHOW CREATE TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_conflicts.test b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
index 24d14f90bad..9ad33a4b819 100644
--- a/mysql-test/suite/rpl/t/rpl_row_conflicts.test
+++ b/mysql-test/suite/rpl/t/rpl_row_conflicts.test
@@ -11,7 +11,6 @@ connection slave;
call mtr.add_suppression("Slave: Can\'t find record in \'t1\' error.* .*");
call mtr.add_suppression("Can't find record in 't.'");
---echo [on slave]
connection slave;
SET @old_slave_exec_mode= @@global.slave_exec_mode;
diff --git a/mysql-test/suite/rpl/t/rpl_row_create_table.test b/mysql-test/suite/rpl/t/rpl_row_create_table.test
index da73d753dcd..38e4c5a5e63 100644
--- a/mysql-test/suite/rpl/t/rpl_row_create_table.test
+++ b/mysql-test/suite/rpl/t/rpl_row_create_table.test
@@ -34,12 +34,10 @@ 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;
--source include/show_binlog_events.inc
---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
@@ -50,13 +48,11 @@ 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
@@ -102,12 +98,10 @@ CREATE TABLE t9 LIKE tt4;
CREATE TEMPORARY TABLE tt5 LIKE t4;
CREATE TEMPORARY TABLE tt6 LIKE tt4;
CREATE TEMPORARY TABLE tt7 SELECT 1;
---echo **** On Master ****
--query_vertical SHOW CREATE TABLE t8
--query_vertical SHOW CREATE TABLE t9
--source include/show_binlog_events.inc
sync_slave_with_master;
---echo **** On Slave ****
--query_vertical SHOW CREATE TABLE t8
--query_vertical SHOW CREATE TABLE t9
diff --git a/mysql-test/suite/rpl/t/rpl_row_drop.test b/mysql-test/suite/rpl/t/rpl_row_drop.test
index eca2ae0f643..4df6e2ad574 100644
--- a/mysql-test/suite/rpl/t/rpl_row_drop.test
+++ b/mysql-test/suite/rpl/t/rpl_row_drop.test
@@ -3,37 +3,29 @@
# 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;
source include/show_binlog_events.inc;
SHOW TABLES;
sync_slave_with_master;
---echo **** On Slave ****
SHOW TABLES;
--disable_query_log
diff --git a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
index 86cf7a245b2..907e309a555 100644
--- a/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
+++ b/mysql-test/suite/rpl/t/rpl_row_inexist_tbl.test
@@ -13,20 +13,16 @@
source include/master-slave.inc;
--echo ==== Setup table on master but not on slave ====
---echo [on master]
CREATE TABLE t1 (a INT);
---echo [on slave]
sync_slave_with_master;
DROP TABLE t1;
--echo ==== Modify table on master ====
---echo [on master]
connection master;
INSERT INTO t1 VALUES (1);
--echo ==== Verify error on slave ====
---echo [on slave]
connection slave;
# slave should have stopped because can't find table t1
# 1146 = ER_NO_SUCH_TABLE
@@ -38,7 +34,6 @@ call mtr.add_suppression("Slave SQL.*Error executing row event: .Table .test.t1.
source include/stop_slave_io.inc;
RESET SLAVE;
---echo [on master]
connection master;
DROP TABLE t1;
--let $rpl_only_running_threads= 1
diff --git a/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test b/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test
index 7ad756ea545..9bc812bb0be 100644
--- a/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test
+++ b/mysql-test/suite/rpl/t/rpl_row_rollback_to_savepoint.test
@@ -78,7 +78,7 @@ INSERT INTO t1 VALUES (1);
--sync_slave_with_master
---source include/rpl_connection_master.inc
+connection master;
DROP TRIGGER tr1;
DELETE FROM t1;
@@ -112,7 +112,7 @@ INSERT INTO t1 VALUES (1);
--sync_slave_with_master
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t1;
DROP TABLE t2;
@@ -122,7 +122,7 @@ DROP PROCEDURE p1;
--echo # Test case 3:
--source include/rpl_reset.inc
---source include/rpl_connection_master.inc
+connection master;
CREATE TABLE t (f1 int(10) unsigned NOT NULL, PRIMARY KEY (f1)) ENGINE=InnoDB;
@@ -145,12 +145,12 @@ SELECT * FROM t;
SELECT * FROM t;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t;
--echo # Test case 4:
--source include/rpl_reset.inc
---source include/rpl_connection_master.inc
+connection master;
CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
@@ -173,13 +173,13 @@ SELECT * FROM t1;
SELECT * FROM t;
SELECT * FROM t1;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t;
DROP TABLE t1;
--echo # Test case 5:
--source include/rpl_reset.inc
---source include/rpl_connection_master.inc
+connection master;
CREATE TABLE t (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
CREATE TABLE t1 (f1 int(10) unsigned NOT NULL) ENGINE=InnoDB;
@@ -204,13 +204,13 @@ SELECT * FROM t1;
SELECT * FROM t;
SELECT * FROM t1;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t;
DROP TABLE t1;
--echo # Test case 6:
--source include/rpl_reset.inc
---source include/rpl_connection_master.inc
+connection master;
CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
@@ -232,21 +232,21 @@ COMMIT;
INSERT INTO t2 VALUES (10);
--source include/show_binlog_events.inc
---source include/rpl_connection_master.inc
+connection master;
SELECT * FROM t2;
SELECT * FROM t1;
--source include/sync_slave_sql_with_master.inc
SELECT * FROM t2;
SELECT * FROM t1;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP FUNCTION f1;
--echo # Test case 7:
--source include/rpl_reset.inc
---source include/rpl_connection_master.inc
+connection master;
CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
CREATE TABLE t2 (f1 INTEGER ) ENGINE=INNODB;
@@ -267,21 +267,21 @@ COMMIT;
INSERT INTO t2 VALUES (10);
--source include/show_binlog_events.inc
---source include/rpl_connection_master.inc
+connection master;
SELECT * FROM t2;
SELECT * FROM t1;
--source include/sync_slave_sql_with_master.inc
SELECT * FROM t2;
SELECT * FROM t1;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP FUNCTION f1;
--echo # Test case 8:
--source include/rpl_reset.inc
---source include/rpl_connection_master.inc
+connection master;
CREATE TABLE t1 (f1 INTEGER ) ENGINE=INNODB;
--delimiter |
@@ -300,12 +300,12 @@ COMMIT;
INSERT INTO t1 VALUES (10);
--source include/show_binlog_events.inc
---source include/rpl_connection_master.inc
+connection master;
SELECT * FROM t1;
--source include/sync_slave_sql_with_master.inc
SELECT * FROM t1;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t1;
DROP FUNCTION f1;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp005.test b/mysql-test/suite/rpl/t/rpl_row_sp005.test
index 89bc0ca4df0..865f2e94cb8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp005.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp005.test
@@ -64,20 +64,14 @@ BEGIN
END|
delimiter ;|
-let $message=< ---- Master selects-- >;
---source include/show_msg.inc
CALL test.p2();
SELECT * FROM test.t1 ORDER BY id;
SELECT * FROM test.t2 ORDER BY id2;
-let $message=< ---- Slave selects-- >;
---source include/show_msg.inc
sync_slave_with_master;
SELECT * FROM test.t1 ORDER BY id;
SELECT * FROM test.t2 ORDER BY id2;
-let $message=< ---- Master selects-- >;
---source include/show_msg.inc
connection master;
CALL test.p1();
@@ -86,8 +80,6 @@ let $wait_condition= SELECT COUNT(*) = 4 FROM t3;
save_master_pos;
SELECT * FROM test.t3 ORDER BY id3;
-let $message=< ---- Slave selects-- >;
---source include/show_msg.inc
sync_slave_with_master;
SELECT * FROM test.t3 ORDER BY id3;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp008.test b/mysql-test/suite/rpl/t/rpl_row_sp008.test
index 8af3c88ae11..74a988eeff2 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp008.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp008.test
@@ -34,13 +34,9 @@ BEGIN
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
sync_slave_with_master;
SELECT * FROM test.t2;
diff --git a/mysql-test/suite/rpl/t/rpl_row_sp012.test b/mysql-test/suite/rpl/t/rpl_row_sp012.test
index 80d312f1878..2b8549bf2ae 100644
--- a/mysql-test/suite/rpl/t/rpl_row_sp012.test
+++ b/mysql-test/suite/rpl/t/rpl_row_sp012.test
@@ -40,8 +40,6 @@ set sql_mode=default;
# 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();
@@ -49,8 +47,6 @@ 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;
diff --git a/mysql-test/suite/rpl/t/rpl_row_triggers.test b/mysql-test/suite/rpl/t/rpl_row_triggers.test
index 173ddebba12..00f9197ace8 100644
--- a/mysql-test/suite/rpl/t/rpl_row_triggers.test
+++ b/mysql-test/suite/rpl/t/rpl_row_triggers.test
@@ -282,7 +282,6 @@ sync_slave_with_master;
--echo # bitmap_is_set(table->vcol_set, field_index))'
--echo # failed in Field_timestamp::store_TIME_with_warning
--echo #
---enable_connect_log
--echo #
--echo # Create table on master, replicate it on slave.
--echo #
@@ -324,6 +323,5 @@ set binlog_row_image = @binlog_row_image.saved;
drop table t1;
--sync_slave_with_master
---disable_connect_log
--source include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_row_utf16.test b/mysql-test/suite/rpl/t/rpl_row_utf16.test
index e3e7a51c002..a48a36189ae 100644
--- a/mysql-test/suite/rpl/t/rpl_row_utf16.test
+++ b/mysql-test/suite/rpl/t/rpl_row_utf16.test
@@ -10,12 +10,10 @@ CREATE TABLE t1(c1 CHAR(10) CHARACTER SET utf16 DEFAULT 'ola');
INSERT INTO t1 VALUES ('abc'); # explicit value is inserted and encoded correctly
INSERT INTO t1 VALUES (); # default value is inserted and encoded correctly
--- echo #### ON MASTER
--query_vertical SELECT c1, hex(c1) from t1
-- sync_slave_with_master
--- echo #### ON SLAVE
--query_vertical SELECT c1, hex(c1) FROM t1
# assertion: tables don't differ
diff --git a/mysql-test/suite/rpl/t/rpl_savepoint.test b/mysql-test/suite/rpl/t/rpl_savepoint.test
index 2aacd1fa81e..6cd7a7a2d39 100644
--- a/mysql-test/suite/rpl/t/rpl_savepoint.test
+++ b/mysql-test/suite/rpl/t/rpl_savepoint.test
@@ -6,7 +6,6 @@
--echo # DML flow and SAVEPOINT
--echo #
---echo # Connection master
connection master;
--disable_warnings
@@ -21,12 +20,10 @@ INSERT INTO nt VALUES (1);
SAVEPOINT insert_statement;
INSERT INTO tt VALUES (1);
---echo # Connection master1
connection master1;
--echo # Sending:
--send DROP TABLE tt
---echo # Connection master
connection master;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -35,13 +32,11 @@ let $wait_condition=
ROLLBACK TO SAVEPOINT insert_statement;
COMMIT;
---echo # Connection master1
connection master1;
--echo # Reaping: DROP TABLE tt
--reap
FLUSH LOGS;
---echo # Connection master
connection master;
DROP TABLE nt;
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync.test b/mysql-test/suite/rpl/t/rpl_semi_sync.test
index a9ea4985039..117ee567869 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -45,7 +45,6 @@ set global rpl_semi_sync_slave_enabled= 0;
--echo #
connection master;
-echo [ on master ];
set global rpl_semi_sync_master_timeout= 60000; # 60s
@@ -96,7 +95,6 @@ show status like 'Rpl_semi_sync_master_yes_tx';
reset master;
connection slave;
-echo [ on slave ];
echo [ default state of semi-sync on slave should be OFF ];
show variables like 'rpl_semi_sync_slave_enabled';
@@ -107,7 +105,6 @@ show variables like 'rpl_semi_sync_slave_enabled';
source include/start_slave.inc;
connection master;
-echo [ on master ];
# NOTE: Rpl_semi_sync_master_client will only be updated when
# semi-sync slave has started binlog dump request
@@ -153,7 +150,6 @@ show status like 'Rpl_semi_sync_master_no_tx';
show status like 'Rpl_semi_sync_master_yes_tx';
sync_slave_with_master;
-echo [ on slave ];
echo [ slave status after replicated inserts ];
show status like 'Rpl_semi_sync_slave_status';
@@ -168,7 +164,6 @@ select max(a) from t1;
--echo # include 'CREATE TEMPORARY TABLE `MyISAM_t` SELECT * FROM `Innodb_t` ;
connection master;
-echo [ on master ];
SET SESSION AUTOCOMMIT= 0;
CREATE TABLE t2(c1 INT) ENGINE=innodb;
sync_slave_with_master;
@@ -200,7 +195,6 @@ connection slave;
source include/stop_slave.inc;
connection master;
-echo [ on master ];
set global rpl_semi_sync_master_timeout= 5000;
# The first semi-sync check should be on because after slave stop,
@@ -257,7 +251,6 @@ show status like 'Rpl_semi_sync_master_yes_tx';
save_master_pos;
connection slave;
-echo [ on slave ];
echo [ slave status should be OFF ];
show status like 'Rpl_semi_sync_slave_status';
@@ -272,7 +265,6 @@ select min(a) from t1;
select max(a) from t1;
connection master;
-echo [ on master ];
# The master semi-sync status should be on again after slave catches up.
echo [ master status should be ON again after slave catches up ];
@@ -288,7 +280,6 @@ show status like 'Rpl_semi_sync_master_clients';
drop table t1;
sync_slave_with_master;
-echo [ on slave ];
source include/stop_slave.inc;
@@ -307,7 +298,6 @@ SHOW STATUS LIKE 'Rpl_semi_sync_master_no_tx';
SHOW STATUS LIKE 'Rpl_semi_sync_master_yes_tx';
connection master;
-echo [ on master ];
source include/show_master_logs.inc;
show variables like 'rpl_semi_sync_master_enabled';
@@ -327,12 +317,10 @@ show status like 'Rpl_semi_sync_master_status';
--echo #
connection slave;
-echo [ on slave ];
source include/start_slave.inc;
connection master;
-echo [ on master ];
replace_result $engine_type ENGINE_TYPE;
eval create table t1 (a int) engine = $engine_type;
@@ -346,7 +334,6 @@ show status like 'Rpl_relay%';
echo [ test reset master ];
connection master;
-echo [ on master];
reset master;
@@ -355,7 +342,6 @@ show status like 'Rpl_semi_sync_master_no_tx';
show status like 'Rpl_semi_sync_master_yes_tx';
connection slave;
-echo [ on slave ];
source include/stop_slave.inc;
reset slave;
@@ -379,7 +365,6 @@ connection slave;
source include/start_slave.inc;
connection master;
-echo [ on master ];
# Wait for dump thread to start, Rpl_semi_sync_master_clients will be
# 1 after dump thread started.
@@ -393,12 +378,10 @@ insert into t1 values (1);
insert into t1 values (2), (3);
sync_slave_with_master;
-echo [ on slave ];
select * from t1;
connection master;
-echo [ on master ];
echo [ master semi-sync status should be ON ];
show status like 'Rpl_semi_sync_master_status';
@@ -412,7 +395,6 @@ connection slave;
source include/stop_slave.inc;
reset slave;
connection master;
-echo [ on master ];
reset master;
# Kill the dump thread on master for previous slave connection and wait for it to exit
@@ -435,14 +417,12 @@ grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
set sql_log_bin=1;
connection slave;
-echo [ on slave ];
grant replication slave on *.* to rpl@127.0.0.1 identified by 'rpl_password';
flush privileges;
change master to master_user='rpl',master_password='rpl_password';
source include/start_slave.inc;
show status like 'Rpl_semi_sync_slave_status';
connection master;
-echo [ on master ];
# Wait for the semi-sync binlog dump thread to start
let $status_var= Rpl_semi_sync_master_clients;
@@ -467,12 +447,10 @@ show status like 'Rpl_semi_sync_master_yes_tx';
# Disable semi-sync on master
connection slave;
-echo [ on slave ];
source include/stop_slave.inc;
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
connection master;
-echo [ on master ];
# Kill the dump thread on master for previous slave connection and wait for it to exit
let $_tid= `select id from information_schema.processlist where command = 'Binlog Dump' limit 1`;
@@ -493,11 +471,9 @@ show status like 'Rpl_semi_sync_master_status';
set global rpl_semi_sync_master_enabled= 0;
connection slave;
-echo [ on slave ];
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
source include/start_slave.inc;
connection master;
-echo [ on master ];
insert into t1 values (8);
let $status_var= Rpl_semi_sync_master_clients;
let $status_var_value= 1;
@@ -506,23 +482,19 @@ echo [ master semi-sync clients should be 1, status should be OFF ];
show status like 'Rpl_semi_sync_master_clients';
show status like 'Rpl_semi_sync_master_status';
sync_slave_with_master;
-echo [ on slave ];
show status like 'Rpl_semi_sync_slave_status';
# Uninstall semi-sync plugin on master
connection slave;
source include/stop_slave.inc;
connection master;
-echo [ on master ];
set global rpl_semi_sync_master_enabled= 0;
connection slave;
-echo [ on slave ];
SHOW VARIABLES LIKE 'rpl_semi_sync_slave_enabled';
source include/start_slave.inc;
connection master;
-echo [ on master ];
insert into t1 values (10);
sync_slave_with_master;
@@ -535,7 +507,6 @@ set global rpl_semi_sync_master_timeout= 5000; # 5s
set global rpl_semi_sync_master_enabled= 1;
connection slave;
-echo [ on slave ];
source include/stop_slave.inc;
SHOW STATUS LIKE 'Rpl_semi_sync_slave_status';
diff --git a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test
index 0f86789cced..360706922ea 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync_uninstall_plugin.test
@@ -28,7 +28,6 @@ INSTALL PLUGIN rpl_semi_sync_master SONAME 'semisync_master';
# Step 1.2: Install semi sync slave plugin on slave
--connection slave
---echo [connection slave]
INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave';
# Step 1.3: Uninstallation of semisync plugin on master and slave should be
@@ -36,7 +35,6 @@ INSTALL PLUGIN rpl_semi_sync_slave SONAME 'semisync_slave';
# master and slave.
UNINSTALL PLUGIN rpl_semi_sync_slave;
--connection master
---echo [connection master]
UNINSTALL PLUGIN rpl_semi_sync_master;
# Step 1.4: Check that replication is working fine at the end of the test case.
@@ -44,7 +42,6 @@ CREATE TABLE t1(i int);
INSERT INTO t1 values (1);
DROP TABLE t1;
--sync_slave_with_master
---echo [connection slave]
###############################################################################
# Case 2: Uninstallation of semi sync plugins should be disallowed
@@ -56,7 +53,6 @@ DROP TABLE t1;
# Step 2.2: Check that rpl_semi_sync_slave uninstallation on Slave is not
# possible at this state
--connection slave
---echo [connection slave]
show global status like "Slave%_running";
UNINSTALL PLUGIN rpl_semi_sync_slave;
@@ -65,7 +61,6 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na
# Step 2.3: Check that rpl_semi_sync_master uninstallation on Master is not
# possible at this state
--connection master
---echo [connection master]
# The following is to catch errors if the next uninstall plugin would succeed
show global status like "Slave%_connect%";
@@ -78,7 +73,6 @@ CREATE TABLE t1(i int);
INSERT INTO t1 values (2);
DROP TABLE t1;
--sync_slave_with_master
---echo [connection slave]
# Step 2.5: Make sure rpl_semi_sync_master_status on Master and
# rpl_semi_sync_slave_staus on Slave are ON
@@ -90,7 +84,6 @@ show status like "Rpl_semi_sync_slave_status";
###############################################################################
# Step 3.1: Disable semi sync on master
--connection master
---echo [connection master]
show status like "Rpl_semi_sync_master_status";
# Step 3.2: Check that still Rpl_semi_sync_master_clients is 1
@@ -108,14 +101,12 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na
# Step 4.1: Stop IO thread on slave.
--connection slave
---echo [connection slave]
--source include/stop_slave.inc
# Step 4.2: Disable semi sync on slave.
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'rpl_%';
--connection master
---echo [connection master]
# Send something to the slave so that the master would notice that nobody's listening.
create table t2 (a int); drop table t2;
# and wait for plugin to be unloaded automatically
@@ -123,7 +114,6 @@ let $wait_condition=select count(*) = 0 from information_schema.plugins where pl
--source include/wait_condition.inc
--connection slave
---echo [connection slave]
# Step 4.3: Start IO thread on slave.
--source include/start_slave.inc
@@ -133,12 +123,10 @@ select plugin_name,plugin_status from information_schema.plugins where plugin_na
# Step 4.7: Check that replication is working fine at the end of the test case
--connection master
---echo [connection master]
CREATE TABLE t1(i int);
INSERT INTO t1 values (3);
DROP TABLE t1;
--sync_slave_with_master
---echo [connection slave]
# Cleanup
source include/rpl_end.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_set_charset.test b/mysql-test/suite/rpl/t/rpl_set_charset.test
index 296e5dfb079..72b89a13b80 100644
--- a/mysql-test/suite/rpl/t/rpl_set_charset.test
+++ b/mysql-test/suite/rpl/t/rpl_set_charset.test
@@ -18,11 +18,9 @@ INSERT INTO t1 VALUES ('ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ','C0');
INSERT INTO t1 VALUES ('ÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞß','D0');
INSERT INTO t1 VALUES ('àáâãäåæçèéêëìíîï','E0');
INSERT INTO t1 VALUES ('ðñòóôõö÷øùúûüýþÿ','F0');
-select "--- on master ---";
select hex(a),b from t1 order by b;
sync_slave_with_master;
use mysqltest1;
-select "--- on slave ---";
select hex(a),b from t1 order by b;
connection master;
drop database mysqltest1;
diff --git a/mysql-test/suite/rpl/t/rpl_skip_error.test b/mysql-test/suite/rpl/t/rpl_skip_error.test
index 4348675884b..1144d6a1a7c 100644
--- a/mysql-test/suite/rpl/t/rpl_skip_error.test
+++ b/mysql-test/suite/rpl/t/rpl_skip_error.test
@@ -28,14 +28,11 @@ source include/have_innodb.inc;
--echo ==== Test Without sql_mode=strict_trans_tables ====
---echo [on master]
create table t1 (n int not null primary key);
---echo [on slave]
sync_slave_with_master;
insert into t1 values (1);
---echo [on master]
connection master;
# Here we expect (ignored) error, since 1 is already in slave table
insert into t1 values (1);
@@ -43,16 +40,13 @@ insert into t1 values (1);
insert into t1 values (2),(3);
sync_slave_with_master;
---echo [on slave]
select * from t1 order by n;
--echo ==== Test With sql_mode=strict_trans_tables ====
insert into t1 values (7),(8);
---echo [on master]
connection master;
set sql_mode=strict_trans_tables;
insert into t1 values (7), (8), (9);
---echo [on slave]
sync_slave_with_master;
select * from t1 order by n;
source include/check_slave_is_running.inc;
@@ -75,7 +69,6 @@ SET SQL_LOG_BIN=1;
set sql_mode=strict_trans_tables;
insert into t1 values (1), (2), (3);
---echo [on slave]
sync_slave_with_master;
select * from t1;
source include/check_slave_is_running.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_skip.test b/mysql-test/suite/rpl/t/rpl_slave_skip.test
index f2129bd7f18..8248f749c04 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_skip.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_skip.test
@@ -7,13 +7,11 @@ source include/have_binlog_format_mixed.inc;
source include/master-slave.inc;
source include/have_innodb.inc;
---echo **** On Slave ****
connection slave;
source include/have_innodb.inc;
STOP SLAVE;
--source include/wait_for_slave_to_stop.inc
---echo **** On Master ****
connection master;
SET SESSION BINLOG_FORMAT=ROW;
@@ -29,7 +27,6 @@ source include/show_binlog_events.inc;
SELECT * FROM t1;
SELECT * FROM t2;
save_master_pos;
---echo **** On Slave ****
connection slave;
# Stop when reaching the the first table map event.
@@ -78,7 +75,6 @@ START SLAVE;
--source include/wait_for_slave_to_start.inc
sync_with_master;
---echo **** On Master ****
connection master;
DROP TABLE t1, t2;
sync_slave_with_master;
@@ -119,11 +115,9 @@ END|
DELIMITER ;|
---echo **** On Slave ****
sync_slave_with_master;
source include/stop_slave.inc;
---echo **** On Master ****
connection master;
UPDATE t1 SET a = 2, b = 'master only' WHERE a = 1;
DROP TRIGGER tr1;
@@ -139,7 +133,6 @@ SELECT * FROM t3 ORDER BY a;
save_master_pos;
---echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
source include/start_slave.inc;
@@ -158,17 +151,14 @@ sync_slave_with_master;
# Create the transaction and try to skip some
# queries from one.
---echo *** On Master ***
connection master;
CREATE TABLE t4 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t5 (a INT, b VARCHAR(20)) ENGINE=innodb;
CREATE TABLE t6 (a INT, b VARCHAR(20)) ENGINE=innodb;
---echo **** On Slave ****
sync_slave_with_master;
source include/stop_slave.inc;
---echo *** On Master ***
connection master;
BEGIN;
INSERT INTO t4 VALUES (2, 'master only');
@@ -188,7 +178,6 @@ SELECT * FROM t6 ORDER BY a;
save_master_pos;
---echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
source include/start_slave.inc;
@@ -200,11 +189,9 @@ SELECT * FROM t6 ORDER BY a;
# Test skipping two groups
---echo **** On Slave ****
connection slave;
source include/stop_slave.inc;
---echo *** On Master ***
connection master;
BEGIN;
INSERT INTO t4 VALUES (6, 'master only');
@@ -224,7 +211,6 @@ SELECT * FROM t6 ORDER BY a;
save_master_pos;
---echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=10;
source include/start_slave.inc;
@@ -259,7 +245,6 @@ SELECT * FROM t6 ORDER BY a;
save_master_pos;
---echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
source include/start_slave.inc;
@@ -278,15 +263,12 @@ sync_slave_with_master;
# LOAD DATA creates two events in binary log for statement binlog format.
# Try to skip the first.
---echo *** On Master ***
connection master;
CREATE TABLE t10 (a INT, b VARCHAR(20)) ENGINE=myisam;
---echo *** On Slave ***
sync_slave_with_master;
source include/stop_slave.inc;
---echo *** On Master ***
connection master;
SET SESSION BINLOG_FORMAT=STATEMENT;
@@ -297,7 +279,6 @@ SELECT * FROM t10 ORDER BY a;
save_master_pos;
---echo *** On Slave ***
connection slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
source include/start_slave.inc;
diff --git a/mysql-test/suite/rpl/t/rpl_slave_status.test b/mysql-test/suite/rpl/t/rpl_slave_status.test
index fc82b3f8df6..63e37216926 100644
--- a/mysql-test/suite/rpl/t/rpl_slave_status.test
+++ b/mysql-test/suite/rpl/t/rpl_slave_status.test
@@ -21,11 +21,9 @@
--source include/master-slave.inc
--echo ==== Create new replication user ====
---echo [on master]
connection master;
GRANT REPLICATION SLAVE ON *.* TO rpl@127.0.0.1 IDENTIFIED BY 'rpl';
---echo [on slave]
sync_slave_with_master;
source include/stop_slave.inc;
@@ -43,21 +41,17 @@ CHANGE MASTER TO master_user='rpl', master_password='rpl';
source include/start_slave.inc;
--echo ==== Do replication as new user ====
---echo [on master]
connection master;
CREATE TABLE t1 (n INT);
INSERT INTO t1 VALUES (1);
---echo [on slave]
sync_slave_with_master;
SELECT * FROM t1;
--echo ==== Delete new replication user ====
---echo [on master]
connection master;
DROP USER rpl@127.0.0.1;
FLUSH PRIVILEGES;
---echo [on slave]
sync_slave_with_master;
--echo ==== Restart slave without privileges =====
@@ -81,7 +75,6 @@ CHANGE MASTER TO MASTER_USER = 'root', MASTER_PASSWORD = '';
--let $rpl_only_running_threads= 1
--source include/rpl_reset.inc
---echo [on master]
connection master;
DROP TABLE t1;
diff --git a/mysql-test/suite/rpl/t/rpl_sp.test b/mysql-test/suite/rpl/t/rpl_sp.test
index 124d98cd29b..fb30c5708bc 100644
--- a/mysql-test/suite/rpl/t/rpl_sp.test
+++ b/mysql-test/suite/rpl/t/rpl_sp.test
@@ -447,7 +447,6 @@ DROP PROCEDURE p1;
--echo
--echo ---> Preparing environment...
---echo ---> connection: master
--connection master
--disable_warnings
@@ -460,8 +459,6 @@ DROP FUNCTION IF EXISTS f1;
--sync_slave_with_master
---echo
---echo ---> connection: master
--connection master
# Test.
@@ -484,8 +481,6 @@ SHOW CREATE FUNCTION f1;
--sync_slave_with_master
---echo ---> connection: master
-
--echo
--echo ---> Checking on slave...
@@ -494,8 +489,6 @@ SHOW CREATE FUNCTION f1;
# Cleanup.
---echo
---echo ---> connection: master
--connection master
--echo
@@ -640,7 +633,6 @@ drop function mysqltestbug36570_f1;
--echo # identical data. Statements in the binrary log must be
--echo # consistent with data in the table.
--echo #
---echo # --> connection default
connection default;
--disable_warnings
drop table if exists t1, t2;
@@ -650,7 +642,6 @@ create table t1 (a int);
create table t2 (a int) as select 1 as a;
create function f1() returns int deterministic return (select max(a) from t2);
lock table t2 write;
---echo # --> connection master
connection master;
--echo # Sending 'insert into t1 (a) values (f1())'...
--send insert into t1 (a) values (f1())
@@ -662,7 +653,6 @@ where state='Waiting for table metadata lock' and
--source include/wait_condition.inc
--echo # Sending 'drop function f1'. It will wait till insert finishes.
--send drop function f1;
---echo # --> connection default
connection default;
--echo # Check that 'drop function f1' gets blocked.
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -670,15 +660,12 @@ where state='Waiting for stored function metadata lock' and info='drop function
--source include/wait_condition.inc
--echo # Now let's let 'insert' go through...
unlock tables;
---echo # --> connection master
connection master;
--echo # Reaping 'insert into t1 (a) values (f1())'...
--reap
---echo # --> connection master1
connection master1;
--echo # Reaping 'drop function f1'
--reap
---echo # --> connection master
connection master;
select * from t1;
sync_slave_with_master;
diff --git a/mysql-test/suite/rpl/t/rpl_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 9e42764715b..ca9f61ec5de 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -83,11 +83,9 @@ if ($slave_count != $master_count)
echo slave: $slave_count;
connection master;
- echo === master ===;
select count(*) t1;
select * from t1;
connection slave;
- echo === slave ===;
select count(*) t1;
select * from t1;
query_vertical show slave status;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test b/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
index e8e20438d1d..280cfcc58c9 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_auto_increment_bug33029.test
@@ -71,7 +71,6 @@ SELECT * FROM t2;
sync_slave_with_master;
-echo # Result on slave;
SELECT * FROM t1;
SELECT * FROM t2;
@@ -91,7 +90,6 @@ SELECT * FROM t2;
sync_slave_with_master;
-echo # Result on slave;
SELECT * FROM t1;
SELECT * FROM t2;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
index 1ec8f8a0424..9d76879a4ac 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_found_rows.test
@@ -15,7 +15,6 @@ enable_query_log;
--echo ==== Initialize ====
---echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT);
CREATE TABLE logtbl (sect INT, test INT, count INT);
@@ -47,7 +46,6 @@ SELECT FOUND_ROWS() INTO @a;
INSERT INTO logtbl VALUES(1,2,@a);
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
@@ -58,7 +56,6 @@ SELECT * FROM logtbl WHERE sect = 1 ORDER BY sect,test;
# to make sure that there are no limitations on how many times it can
# be used.
---echo **** On Master ****
connection master;
--delimiter $$
CREATE PROCEDURE calc_and_log(sect INT, test INT) BEGIN
@@ -85,13 +82,11 @@ SELECT FOUND_ROWS() INTO @found_rows;
CALL just_log(2,3,@found_rows);
SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test;
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM logtbl WHERE sect = 2 ORDER BY sect,test;
--echo ==== Stored functions ====
---echo **** On Master ****
connection master;
--delimiter $$
CREATE FUNCTION log_rows(sect INT, test INT, found_rows INT)
@@ -107,13 +102,11 @@ SELECT FOUND_ROWS() INTO @found_rows;
SELECT log_rows(3,1,@found_rows), log_rows(3,2,@found_rows);
SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test;
---echo **** On Slave ****
sync_slave_with_master;
SELECT * FROM logtbl WHERE sect = 3 ORDER BY sect,test;
--echo ==== Cleanup ====
---echo **** On Master ****
connection master;
DROP TABLE t1, logtbl;
DROP PROCEDURE just_log;
diff --git a/mysql-test/suite/rpl/t/rpl_stm_until.test b/mysql-test/suite/rpl/t/rpl_stm_until.test
index 9194a1fda63..c9a922e44fa 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_until.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_until.test
@@ -29,13 +29,11 @@ let $VERSION=`select version()`;
# Stop slave before it starts replication. Also sync with master
# to avoid nondeterministic behaviour.
---echo [on slave]
sync_slave_with_master;
--source include/stop_slave.inc
--echo ==== Create some events on master ====
---echo [on master]
connection master;
create table t1(n int not null auto_increment primary key);
insert into t1 values (1),(2),(3),(4);
@@ -51,7 +49,6 @@ drop table t2;
--echo ==== Replicate one event at a time on slave ====
# try to replicate all queries until drop of t1
---echo [on slave]
connection slave;
--replace_result $master_log_file MASTER_LOG_FILE $master_log_pos_1 MASTER_LOG_POS
eval start slave until master_log_file='$master_log_file', master_log_pos=$master_log_pos_1;
@@ -88,9 +85,7 @@ select * from t2;
# clean up
start slave;
---echo [on master]
connection master;
---echo [on slave]
sync_slave_with_master;
--source include/stop_slave.inc
diff --git a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
index 64691a1b634..74e54f9624d 100644
--- a/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_stm_user_variables.test
@@ -35,10 +35,8 @@ CREATE TABLE t1 (`tinyint` TINYINT,
-- eval INSERT INTO t1 VALUES ($max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long,$max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long, $max_unsigned_long);
-- echo #########################################
--- echo #### [ on master ]
-- query_vertical SELECT * FROM t1
-- sync_slave_with_master
--- echo #### [ on slave ]
-- query_vertical SELECT * FROM t1
-- echo #########################################
-- connection master
@@ -65,10 +63,8 @@ INSERT INTO t1 VALUES (@positive,
@positive);
-- echo #########################################
--- echo #### [ on master ]
-- query_vertical SELECT * FROM t1
-- sync_slave_with_master
--- echo #### [ on slave ]
-- query_vertical SELECT * FROM t1
-- echo #########################################
-- connection master
@@ -84,10 +80,8 @@ TRUNCATE t1;
-- eval INSERT INTO t1 VALUES ($min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long,$min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long, $min_signed_long);
-- echo #########################################
--- echo #### [ on master ]
-- query_vertical SELECT * FROM t1
-- sync_slave_with_master
--- echo #### [ on slave ]
-- query_vertical SELECT * FROM t1
-- echo #########################################
-- connection master
@@ -114,10 +108,8 @@ INSERT INTO t1 VALUES (@negative,
@negative);
-- echo #########################################
--- echo #### [ on master ]
-- query_vertical SELECT * FROM t1
-- sync_slave_with_master
--- echo #### [ on slave ]
-- query_vertical SELECT * FROM t1
-- echo #########################################
-- connection master
@@ -195,7 +187,7 @@ CALL p1();
-- sync_slave_with_master
connection slave;
---echo # On slave, check if the statement was replicated.
+--echo # check if the statement was replicated.
SELECT * FROM t1 ORDER BY a;
connection master;
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
index 340738f8cb2..5071fd348fb 100644
--- a/mysql-test/suite/rpl/t/rpl_stop_slave.test
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -53,7 +53,6 @@ connection slave;
call mtr.add_suppression("Slave SQL.*Request to stop slave SQL Thread received while applying a group that has non-transactional changes; waiting for completion of the group");
connection master;
---source include/rpl_connection_master.inc
DROP TABLE t1, t2;
--echo
@@ -76,20 +75,20 @@ INSERT INTO t1 VALUES(1, 1);
sync_slave_with_master;
--source include/stop_slave.inc
---source include/rpl_connection_master.inc
+connection master;
# make sure that there are no zombie threads
--source include/stop_dump_threads.inc
let $debug_save= `SELECT @@GLOBAL.debug`;
SET GLOBAL debug_dbug= '+d,dump_thread_wait_before_send_xid,*';
---source include/rpl_connection_slave.inc
+connection slave;
--source include/start_slave.inc
BEGIN;
UPDATE t1 SET c2 = 2 WHERE c1 = 1;
---source include/rpl_connection_master.inc
+connection master;
BEGIN;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t2 VALUES(1);
@@ -100,7 +99,7 @@ COMMIT;
--let $wait_condition= select count(*)=1 from information_schema.processlist where state LIKE '%debug sync point%' and command='Binlog Dump'
--source include/wait_condition.inc
---source include/rpl_connection_slave1.inc
+connection slave1;
let $show_statement= SHOW PROCESSLIST;
let $field= Info;
let $condition= = 'UPDATE t1 SET c2 = 3 WHERE c1 = 1';
@@ -108,38 +107,38 @@ source include/wait_show_condition.inc;
send STOP SLAVE;
---source include/rpl_connection_slave.inc
+connection slave;
ROLLBACK;
---source include/rpl_connection_master.inc
+connection master;
SET DEBUG_SYNC= 'now SIGNAL signal.continue';
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued';
---source include/rpl_connection_slave.inc
+connection slave;
source include/wait_for_slave_to_stop.inc;
---source include/rpl_connection_slave1.inc
+connection slave1;
reap;
# Slave has stopped, thence lets make sure that
# we kill the zombie dump threads. Also, make
# sure that we disable the DBUG_EXECUTE_IF
# that would set the dump thread to wait
---source include/rpl_connection_master.inc
+connection master;
--disable_query_log
eval SET GLOBAL debug_dbug= '$debug_save';
--enable_query_log
# make sure that there are no zombie threads
--source include/stop_dump_threads.inc
---source include/rpl_connection_slave1.inc
+connection slave1;
# now the dump thread on the master will start
# from a clean slate, i.e. without the
# DBUG_EXECUTE_IF set
source include/start_slave.inc;
---source include/rpl_connection_master.inc
+connection master;
DROP TABLE t1, t2;
--source include/rpl_end.inc
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
index 57954698a2c..b221abf8a4a 100644
--- a/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
+++ b/mysql-test/suite/rpl/t/rpl_temp_table_mix_row.test
@@ -15,31 +15,26 @@ source include/have_innodb.inc;
--echo ==== Initialize ====
---echo [on master]
--connection master
CREATE TABLE t1 (a CHAR(48));
CREATE TEMPORARY TABLE t1_tmp1(a INT);
INSERT INTO t1 VALUES (UUID());
---echo [on slave]
sync_slave_with_master;
--echo ==== Verify results on slave ====
SHOW STATUS LIKE "Slave_open_temp_tables";
---echo [on master]
--connection master
disconnect master;
---echo [on master1]
--connection master1
# waiting DROP TEMPORARY TABLE event to be written into binlog
let $wait_binlog_event= DROP;
source include/wait_for_binlog_event.inc;
---echo [on slave]
sync_slave_with_master;
--echo ==== Verify results on slave ====
@@ -47,14 +42,12 @@ SHOW STATUS LIKE "Slave_open_temp_tables";
--echo ==== Clean up ====
---echo [on master]
--let $rpl_connection_name= master
--let $rpl_server_number= 1
--source include/rpl_connect.inc
--connection master
DROP TABLE t1;
---echo [on slave]
sync_slave_with_master;
#
diff --git a/mysql-test/suite/rpl/t/rpl_temporary_errors.test b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
index 250ccf4c1cd..ab050cdc076 100644
--- a/mysql-test/suite/rpl/t/rpl_temporary_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_temporary_errors.test
@@ -5,11 +5,9 @@ source include/have_innodb.inc;
call mtr.add_suppression("Deadlock found");
call mtr.add_suppression("Can't find record in 't.'");
---echo **** On Master ****
connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
INSERT INTO t1 VALUES (1,1), (2,2), (3,3), (4,4);
---echo **** On Slave ****
sync_slave_with_master;
SHOW STATUS LIKE 'Slave_retried_transactions';
# since bug#31552/31609 idempotency is not default any longer. In order
@@ -17,12 +15,10 @@ SHOW STATUS LIKE 'Slave_retried_transactions';
set @@global.slave_exec_mode= 'IDEMPOTENT';
UPDATE t1 SET a = 5, b = 47 WHERE a = 1;
SELECT * FROM t1;
---echo **** On Master ****
connection master;
UPDATE t1 SET a = 5, b = 5 WHERE a = 1;
SELECT * FROM t1;
#SHOW BINLOG EVENTS;
---echo **** On Slave ****
sync_slave_with_master;
set @@global.slave_exec_mode= default;
SHOW STATUS LIKE 'Slave_retried_transactions';
@@ -32,7 +28,6 @@ source include/check_slave_is_running.inc;
connection slave;
call mtr.add_suppression("Slave SQL.*Could not execute Update_rows event on table test.t1");
---echo **** On Master ****
connection master;
DROP TABLE t1;
--sync_slave_with_master
diff --git a/mysql-test/suite/rpl/t/rpl_trigger.test b/mysql-test/suite/rpl/t/rpl_trigger.test
index e062e821a25..83097e7bd0a 100644
--- a/mysql-test/suite/rpl/t/rpl_trigger.test
+++ b/mysql-test/suite/rpl/t/rpl_trigger.test
@@ -55,9 +55,6 @@ select a,b, truncate(rand_value,4) from t1;
select * from t2;
select a,name, old_a, old_b, truncate(rand_value,4) from t3;
sync_slave_with_master;
---disable_query_log
-select "--- On slave --" as "";
---enable_query_log
select a,b, truncate(rand_value,4) from t1;
select * from t2;
select a,name, old_a, old_b, truncate(rand_value,4) from t3;
@@ -119,9 +116,6 @@ FROM information_schema.triggers
WHERE trigger_name = 't1_first';
sync_slave_with_master;
---disable_query_log
-select "--- On slave --" as "";
---enable_query_log
# XXX: Definers of stored procedures and functions are not replicated. WL#2897
# (Complete definer support in the stored routines) addresses this issue. So,
@@ -395,7 +389,6 @@ START SLAVE;
--echo
--echo ---> Preparing environment...
---echo ---> connection: master
--connection master
--disable_warnings
@@ -409,7 +402,6 @@ DROP TABLE IF EXISTS t2;
--sync_slave_with_master
--echo
---echo ---> connection: master
--connection master
# Test.
@@ -440,8 +432,6 @@ SELECT * FROM t2;
--sync_slave_with_master
---echo ---> connection: master
-
--echo
--echo ---> Checking on slave...
@@ -451,7 +441,6 @@ SELECT * FROM t2;
# Cleanup.
--echo
---echo ---> connection: master
--connection master
--echo
diff --git a/mysql-test/suite/rpl/t/rpl_user_variables.test b/mysql-test/suite/rpl/t/rpl_user_variables.test
index dd6ddf39580..3edd9b0a5bf 100644
--- a/mysql-test/suite/rpl/t/rpl_user_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_user_variables.test
@@ -120,14 +120,14 @@ CALL test.insert();
SET @VAR=1;
CALL test.insert();
---echo On master: Check the tables for correct data
+--echo Check the tables for correct data
SELECT * FROM t20;
SELECT * FROM t21;
sync_slave_with_master;
---echo On slave: Check the tables for correct data and it matches master
+--echo Check the tables for correct data and it matches master
SELECT * FROM t20;
SELECT * FROM t21;
@@ -167,13 +167,13 @@ INSERT INTO t1 VALUES (square());
SET @var = 5;
INSERT INTO t1 VALUES (square());
---echo On master: Retrieve the values from the table
+--echo Retrieve the values from the table
SELECT * FROM t1;
sync_slave_with_master;
---echo On slave: Retrieve the values from the table and verify they are the same as on master
+--echo Retrieve the values from the table and verify they are the same as on master
SELECT * FROM t1;
@@ -227,7 +227,7 @@ SET @b = 125;
SET @c = 1;
INSERT INTO t1 values(f2());
---echo On master: Retrieve the values from the table
+--echo Retrieve the values from the table
sync_slave_with_master;
connection master;
@@ -236,7 +236,7 @@ SELECT * from t1;
connection slave;
---echo On slave: Check the tables for correct data and it matches master
+--echo Check the tables for correct data and it matches master
SELECT * from t1;
@@ -280,14 +280,14 @@ connection master;
SET @a:=100;
INSERT INTO t1 values (5);
---echo On master: Check to see that data was inserted correctly in both tables
+--echo Check to see that data was inserted correctly in both tables
SELECT * from t1;
SELECT * from t2;
sync_slave_with_master;
---echo On slave: Check the tables for correct data and it matches master
+--echo Check the tables for correct data and it matches master
SELECT * from t1;
SELECT * from t2;
@@ -361,14 +361,14 @@ connection master;
SET @a:=123;
SELECT f1(), f2();
---echo On master: Check to see that data was inserted correctly
+--echo Check to see that data was inserted correctly
INSERT INTO t1 VALUES(f1());
SELECT * FROM t1;
sync_slave_with_master;
---echo On slave: Check the table for correct data and it matches master
+--echo Check the table for correct data and it matches master
SELECT * FROM t1;
diff --git a/mysql-test/suite/rpl/t/rpl_variables.test b/mysql-test/suite/rpl/t/rpl_variables.test
index 246e595d265..1b83d5d57d7 100644
--- a/mysql-test/suite/rpl/t/rpl_variables.test
+++ b/mysql-test/suite/rpl/t/rpl_variables.test
@@ -68,7 +68,6 @@ source include/master-slave.inc;
# Backup the values of global variables so that they can be restored
# later.
---echo [on master]
connection master;
SET @m_default_week_format= @@global.default_week_format;
SET @m_init_slave= @@global.init_slave;
@@ -79,7 +78,6 @@ SET @m_slave_exec_mode= @@global.slave_exec_mode;
SET @m_sql_mode= @@global.sql_mode;
SET @m_sync_binlog= @@global.sync_binlog;
---echo [on slave]
connection slave;
SET @s_default_week_format= @@global.default_week_format;
SET @s_init_slave= @@global.init_slave;
@@ -117,7 +115,6 @@ SET @user_text = 'Alunda';
SET @@global.init_slave = 'SELECT 1';
---echo [on master]
connection master;
# checking values of read-only variables
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -129,7 +126,6 @@ query_vertical SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
query_vertical SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
---echo [on slave]
connection slave;
# checking values of read-only variables
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
@@ -141,7 +137,6 @@ query_vertical SELECT @@relay_log, @@relay_log_index, @@relay_log_basename;
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
query_vertical SELECT @@log_bin, @@log_bin_index, @@log_bin_basename;
---echo [on master]
connection master;
# Tables where everything happens.
@@ -713,7 +708,6 @@ source include/diff_tables.inc;
--echo ==== Clean up ====
---echo [on master]
connection master;
DROP PROCEDURE proc;
DROP FUNCTION func;
@@ -729,7 +723,6 @@ SET @@global.slave_exec_mode= @m_slave_exec_mode;
SET @@global.sql_mode= @m_sql_mode;
SET @@global.sync_binlog= @m_sync_binlog;
---echo [on slave]
connection slave;
SET @@global.default_week_format= @s_default_week_format;
SET @@global.init_slave= @s_init_slave;
diff --git a/mysql-test/suite/rpl/t/rpl_variables_stm.test b/mysql-test/suite/rpl/t/rpl_variables_stm.test
index 29362bab2c1..1cc3cde3280 100644
--- a/mysql-test/suite/rpl/t/rpl_variables_stm.test
+++ b/mysql-test/suite/rpl/t/rpl_variables_stm.test
@@ -62,7 +62,6 @@ call mtr.add_suppression("Unsafe statement written to the binary log using state
# Backup the values of global variables so that they can be restored
# later.
---echo [on master]
connection master;
SET @m_auto_increment_increment= @@global.auto_increment_increment;
SET @m_auto_increment_offset= @@global.auto_increment_offset;
@@ -73,7 +72,6 @@ SET @m_time_zone= @@global.time_zone;
SET @m_lc_time_names= @@global.lc_time_names;
SET @m_collation_database= @@global.collation_database;
---echo [on slave]
connection slave;
SET @s_auto_increment_increment= @@global.auto_increment_increment;
SET @s_auto_increment_offset= @@global.auto_increment_offset;
@@ -93,7 +91,6 @@ SET @@global.time_zone='Japan';
SET @@global.lc_time_names='sv_SE';
SET @@global.collation_database='geostd8_bin';
---echo [on master]
connection master;
# Tables where everything happens.
@@ -589,7 +586,6 @@ source include/diff_tables.inc;
--echo ==== Clean up ====
---echo [on master]
connection master;
DROP PROCEDURE proc;
DROP FUNCTION func;
@@ -605,7 +601,6 @@ SET @@global.time_zone= @m_time_zone;
SET @@global.lc_time_names= @m_lc_time_names;
SET @@global.collation_database= @m_collation_database;
---echo [on slave]
connection slave;
SET @@global.auto_increment_increment= @s_auto_increment_increment;
SET @@global.auto_increment_offset= @s_auto_increment_offset;
diff --git a/mysql-test/suite/rpl/t/rpl_view.test b/mysql-test/suite/rpl/t/rpl_view.test
index 3f0052cd544..987b93a178a 100644
--- a/mysql-test/suite/rpl/t/rpl_view.test
+++ b/mysql-test/suite/rpl/t/rpl_view.test
@@ -63,7 +63,6 @@ sync_slave_with_master;
--echo
--echo ---> Preparing environment...
---echo ---> connection: master
--connection master
--disable_warnings
@@ -77,7 +76,6 @@ DROP VIEW IF EXISTS v1;
--sync_slave_with_master
--echo
---echo ---> connection: master
--connection master
# Test.
@@ -104,17 +102,10 @@ SELECT * FROM t1;
--sync_slave_with_master
---echo ---> connection: master
-
---echo
---echo ---> Checking on slave...
-
SELECT * FROM t1;
# Cleanup.
---echo
---echo ---> connection: master
--connection master
--echo
diff --git a/mysql-test/suite/rpl/t/rpl_view_multi.test b/mysql-test/suite/rpl/t/rpl_view_multi.test
index 22509f8e4fc..c8af44bfc6e 100644
--- a/mysql-test/suite/rpl/t/rpl_view_multi.test
+++ b/mysql-test/suite/rpl/t/rpl_view_multi.test
@@ -24,12 +24,11 @@ enable_query_log;
drop tables if exists t1, t2;
drop view if exists v1;
--enable_warnings
---echo # Syncing slave with master and switching to connection 'slave'
+--echo # Syncing slave with master
--sync_slave_with_master
connect (master2,127.0.0.1,root,,test,$MASTER_MYPORT,);
---echo # Switching to connection 'master'
connection master;
create table t1 (i int);
create table t2 (i int);
@@ -40,11 +39,9 @@ create view v1 as select * from t1;
--echo # suspend execution of first statement once it opens our view.
select get_lock("lock_bg25144", 1);
---echo # Switching to connection 'master1'
connection master1;
--send insert into v1 values (get_lock("lock_bg25144", 100))
---echo # Switching to connection 'master2'
connection master2;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -52,7 +49,6 @@ let $wait_condition=
--source include/wait_condition.inc
--send drop view v1
---echo # Switching to connection 'master'
connection master;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -61,28 +57,24 @@ let $wait_condition=
select release_lock("lock_bg25144");
---echo # Switching to connection 'master1'
connection master1;
--disable_warnings
--reap
--enable_warnings
select release_lock("lock_bg25144");
---echo # Switching to connection 'master2'
connection master2;
--reap
---echo # Switching to connection 'master'
connection master;
--echo # Check that insertion through view did happen.
select * from t1;
---echo # Syncing slave with master and switching to connection 'slave'
+--echo # Syncing slave with master
--sync_slave_with_master
--echo # Check that slave was able to replicate this sequence
--echo # which means that we got correct binlog order.
select * from t1;
---echo # Switching to connection 'master'
connection master;
--echo # Now we will repeat the test by trying concurrently execute
--echo # statement that uses a view and statement that alters it.
@@ -90,11 +82,9 @@ create view v1 as select * from t1;
select get_lock("lock_bg25144", 1);
---echo # Switching to connection 'master1'
connection master1;
--send insert into v1 values (get_lock("lock_bg25144", 100))
---echo # Switching to connection 'master2'
connection master2;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -102,7 +92,6 @@ let $wait_condition=
--source include/wait_condition.inc
--send alter view v1 as select * from t2
---echo # Switching to connection 'master'
connection master;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -112,35 +101,31 @@ let $wait_condition=
select release_lock("lock_bg25144");
---echo # Switching to connection 'master1'
connection master1;
--disable_warnings
--reap
--enable_warnings
select release_lock("lock_bg25144");
---echo # Switching to connection 'master2'
connection master2;
--reap
---echo # Switching to connection 'master'
connection master;
--echo # Second insertion should go to t1 as well.
select * from t1;
select * from t2;
---echo # Syncing slave with master and switching to connection 'slave'
+--echo # Syncing slave with master
--sync_slave_with_master
--echo # Now let us check that statements were logged in proper order
--echo # So we have same result on slave.
select * from t1;
select * from t2;
---echo # Switching to connection 'master'
connection master;
drop table t1, t2;
drop view v1;
---echo # Syncing slave with master and switching to connection 'slave'
+--echo # Syncing slave with master
--sync_slave_with_master
--source include/rpl_end.inc
diff --git a/mysql-test/suite/storage_engine/delete_low_prio.test b/mysql-test/suite/storage_engine/delete_low_prio.test
index f79a055dabe..da106791284 100644
--- a/mysql-test/suite/storage_engine/delete_low_prio.test
+++ b/mysql-test/suite/storage_engine/delete_low_prio.test
@@ -5,8 +5,6 @@
--source include/count_sessions.inc
---enable_connect_log
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/suite/storage_engine/insert_delayed.test b/mysql-test/suite/storage_engine/insert_delayed.test
index ca8bf7eddbb..3ded1686714 100644
--- a/mysql-test/suite/storage_engine/insert_delayed.test
+++ b/mysql-test/suite/storage_engine/insert_delayed.test
@@ -12,8 +12,6 @@ if (`SELECT @@log_bin AND @@binlog_format IN ('statement','mixed')`)
--source include/count_sessions.inc
---enable_connect_log
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/suite/storage_engine/insert_high_prio.test b/mysql-test/suite/storage_engine/insert_high_prio.test
index 558e95a6cdf..7b67a90bc45 100644
--- a/mysql-test/suite/storage_engine/insert_high_prio.test
+++ b/mysql-test/suite/storage_engine/insert_high_prio.test
@@ -5,8 +5,6 @@
--source include/count_sessions.inc
---enable_connect_log
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/suite/storage_engine/insert_low_prio.test b/mysql-test/suite/storage_engine/insert_low_prio.test
index ed30d106016..257b54a35f6 100644
--- a/mysql-test/suite/storage_engine/insert_low_prio.test
+++ b/mysql-test/suite/storage_engine/insert_low_prio.test
@@ -5,8 +5,6 @@
--source include/count_sessions.inc
---enable_connect_log
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/suite/storage_engine/lock.test b/mysql-test/suite/storage_engine/lock.test
index 7335f8d1d39..2ee77ad93f3 100644
--- a/mysql-test/suite/storage_engine/lock.test
+++ b/mysql-test/suite/storage_engine/lock.test
@@ -9,8 +9,6 @@
#
--source have_engine.inc
---enable_connect_log
-
# Save the initial number of concurrent sessions.
--source include/count_sessions.inc
diff --git a/mysql-test/suite/storage_engine/lock_concurrent.result b/mysql-test/suite/storage_engine/lock_concurrent.result
index 65ab3e86fde..9b1a1a2d7e4 100644
--- a/mysql-test/suite/storage_engine/lock_concurrent.result
+++ b/mysql-test/suite/storage_engine/lock_concurrent.result
@@ -1,12 +1,19 @@
SET lock_wait_timeout = 1;
CREATE TABLE t1 (a <INT_COLUMN>) ENGINE=<STORAGE_ENGINE> <CUSTOM_TABLE_OPTIONS>;
LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ;
+connect con1,localhost,root,,;
SET lock_wait_timeout = 1;
LOCK TABLES t1 READ LOCAL;
UNLOCK TABLES;
+connection default;
UNLOCK TABLES;
+connection con1;
LOCK TABLES t1 READ LOCAL;
+connection default;
LOCK TABLES t1 WRITE CONCURRENT, t1 AS t2 READ;
UNLOCK TABLES;
+connection con1;
UNLOCK TABLES;
+disconnect con1;
+connection default;
DROP TABLE t1;
diff --git a/mysql-test/suite/storage_engine/select_high_prio.test b/mysql-test/suite/storage_engine/select_high_prio.test
index 49cd91ebbfd..4f1d1b39b99 100644
--- a/mysql-test/suite/storage_engine/select_high_prio.test
+++ b/mysql-test/suite/storage_engine/select_high_prio.test
@@ -5,8 +5,6 @@
--source include/count_sessions.inc
---enable_connect_log
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc
index 7f0dfe04214..cbc1f06347f 100644
--- a/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc
+++ b/mysql-test/suite/storage_engine/trx/consistent_snapshot.inc
@@ -4,8 +4,6 @@
--source ../have_engine.inc
---enable_connect_log
-
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/suite/storage_engine/trx/select_for_update.test b/mysql-test/suite/storage_engine/trx/select_for_update.test
index 2a7dee2d3f4..0e5a3eeeab4 100644
--- a/mysql-test/suite/storage_engine/trx/select_for_update.test
+++ b/mysql-test/suite/storage_engine/trx/select_for_update.test
@@ -12,8 +12,6 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
---enable_connect_log
-
--source include/count_sessions.inc
--source ../create_table.inc
diff --git a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test
index 4c03b44640b..92061036864 100644
--- a/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test
+++ b/mysql-test/suite/storage_engine/trx/select_lock_in_share_mode.test
@@ -12,8 +12,6 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
---enable_connect_log
-
--source include/count_sessions.inc
--source ../create_table.inc
diff --git a/mysql-test/suite/storage_engine/trx/transaction_isolation.inc b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc
index 9e07ff1b857..3ff214bd30f 100644
--- a/mysql-test/suite/storage_engine/trx/transaction_isolation.inc
+++ b/mysql-test/suite/storage_engine/trx/transaction_isolation.inc
@@ -10,8 +10,6 @@
--source ../have_engine.inc
---enable_connect_log
-
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/suite/storage_engine/trx/xa.test b/mysql-test/suite/storage_engine/trx/xa.test
index 17cae7eae76..8dafa802125 100644
--- a/mysql-test/suite/storage_engine/trx/xa.test
+++ b/mysql-test/suite/storage_engine/trx/xa.test
@@ -5,8 +5,6 @@
--source ../have_engine.inc
--source support_xa.inc
---enable_connect_log
-
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
diff --git a/mysql-test/suite/storage_engine/trx/xa_recovery.test b/mysql-test/suite/storage_engine/trx/xa_recovery.test
index 8256d068ade..e17bb9d2ea4 100644
--- a/mysql-test/suite/storage_engine/trx/xa_recovery.test
+++ b/mysql-test/suite/storage_engine/trx/xa_recovery.test
@@ -25,8 +25,6 @@ if (!$support_xa)
--enable_query_log
}
---enable_connect_log
-
# Close all unused tables to prevent unrelated corruption
FLUSH TABLES;
diff --git a/mysql-test/suite/storage_engine/update_low_prio.test b/mysql-test/suite/storage_engine/update_low_prio.test
index 8cc1ad07d5c..d6398b7dfec 100644
--- a/mysql-test/suite/storage_engine/update_low_prio.test
+++ b/mysql-test/suite/storage_engine/update_low_prio.test
@@ -5,8 +5,6 @@
--source include/count_sessions.inc
---enable_connect_log
-
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
diff --git a/mysql-test/suite/stress/r/ddl_archive.result b/mysql-test/suite/stress/r/ddl_archive.result
index 457fc30b9f9..f11610b6436 100644
--- a/mysql-test/suite/stress/r/ddl_archive.result
+++ b/mysql-test/suite/stress/r/ddl_archive.result
@@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
SET @runtime = <intended_runtime>;
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect con2,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
# Subtest 2A (one connection, no PREPARE/EXECUTE)
# connection action
@@ -75,5 +77,6 @@ DROP TABLE IF EXISTS t1;
# con2: INSERT INTO t1 SET f2 = 9
# default: SELECT f1 <> 1 OR f1 IS NULL FROM t1 WHERE f2 = 9
# con2: DROP TABLE t1
+disconnect con2;
DEALLOCATE PREPARE stmt_start;
DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_csv.result b/mysql-test/suite/stress/r/ddl_csv.result
index 2346638360b..ed6fafe3cc5 100644
--- a/mysql-test/suite/stress/r/ddl_csv.result
+++ b/mysql-test/suite/stress/r/ddl_csv.result
@@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
SET @runtime = <intended_runtime>;
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect con2,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
# Subtest 2A (one connection, no PREPARE/EXECUTE)
# connection action
@@ -51,5 +53,6 @@ DROP TABLE IF EXISTS t1;
# con2: CREATE TABLE t1 (f1 BIGINT NOT NULL) ENGINE=CSV (expect to get ER_TABLE_EXISTS_ERROR)
# default: DROP TABLE t1
# con2: DROP TABLE t1 (expect to get ER_BAD_TABLE_ERROR)
+disconnect con2;
DEALLOCATE PREPARE stmt_start;
DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_innodb.result b/mysql-test/suite/stress/r/ddl_innodb.result
index 911aed2622a..479f11ebbd9 100644
--- a/mysql-test/suite/stress/r/ddl_innodb.result
+++ b/mysql-test/suite/stress/r/ddl_innodb.result
@@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
SET @runtime = <intended_runtime>;
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect con2,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
# Subtest 1A (one connection, no PREPARE/EXECUTE)
# connection action
@@ -247,5 +249,6 @@ DROP INDEX IDX ON t1;
# con2: SHOW CREATE TABLE t1
# default: DROP INDEX IDX ON t1
DROP TABLE t1;
+disconnect con2;
DEALLOCATE PREPARE stmt_start;
DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_memory.result b/mysql-test/suite/stress/r/ddl_memory.result
index 7ad9f9a61c5..8f20636906a 100644
--- a/mysql-test/suite/stress/r/ddl_memory.result
+++ b/mysql-test/suite/stress/r/ddl_memory.result
@@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
SET @runtime = <intended_runtime>;
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect con2,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
# Subtest 1A (one connection, no PREPARE/EXECUTE)
# connection action
@@ -247,5 +249,6 @@ DROP INDEX IDX ON t1;
# con2: SHOW CREATE TABLE t1
# default: DROP INDEX IDX ON t1
DROP TABLE t1;
+disconnect con2;
DEALLOCATE PREPARE stmt_start;
DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/stress/r/ddl_myisam.result b/mysql-test/suite/stress/r/ddl_myisam.result
index 808b22dc859..c441d0ddc05 100644
--- a/mysql-test/suite/stress/r/ddl_myisam.result
+++ b/mysql-test/suite/stress/r/ddl_myisam.result
@@ -2,6 +2,8 @@ SET @@session.sql_mode = 'NO_ENGINE_SUBSTITUTION';
PREPARE stmt_start FROM "SELECT UNIX_TIMESTAMP() INTO @start";
SET @runtime = <intended_runtime>;
PREPARE stmt_break FROM "SELECT UNIX_TIMESTAMP() - @start > @runtime - 1";
+connect con2,localhost,root,,;
+connection default;
DROP TABLE IF EXISTS t1;
# Subtest 1A (one connection, no PREPARE/EXECUTE)
# connection action
@@ -247,5 +249,6 @@ DROP INDEX IDX ON t1;
# con2: SHOW CREATE TABLE t1
# default: DROP INDEX IDX ON t1
DROP TABLE t1;
+disconnect con2;
DEALLOCATE PREPARE stmt_start;
DEALLOCATE PREPARE stmt_break;
diff --git a/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
index df3ca1ab093..918ea3a01ec 100644
--- a/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_increment_func.result
@@ -38,7 +38,8 @@ id name
6 Record_2
101 Record_5
'#--------------------FN_DYNVARS_001_03-------------------------#'
-## Creating new connection test_con1 ##
+CONNECT test_con1,localhost,root,,;
+connection test_con1;
## Value of session & global vairable here should be 10 ##
SELECT @@global.auto_increment_increment = 10;
@@global.auto_increment_increment = 10
@@ -74,7 +75,8 @@ id name
113 Record_8
115 Record_9
'#--------------------FN_DYNVARS_001_04-------------------------#'
-## Creating another new connection test_con2 ##
+CONNECT test_con2,localhost,root,,;
+connection test_con2;
## Verifying initial values of variable in global & session scope ##
## global & session initial value should be 20 ##
SELECT @@global.auto_increment_increment = 20;
@@ -103,7 +105,7 @@ SELECT @@global.auto_increment_increment;
@@global.auto_increment_increment
20
'#--------------------FN_DYNVARS_001_05-------------------------#'
-## Switching to test_con1 ##
+connection test_con1;
## Verifying values of global & session value of variable ##
## global value should be 20 ##
SELECT @@global.auto_increment_increment = 20;
@@ -187,11 +189,11 @@ id name
127 Record_16
128 Record_17
129 Record_18
-## Disconnecting test_con2 ##
+disconnect test_con2;
## Dropping table t1 ##
DROP table if exists t1;
-## Disconnecting test_con1 ##
-## switching to default connection ##
+disconnect test_con1;
+connection default;
SET @@global.auto_increment_increment = @global_auto_increment_increment;
SET @@session.auto_increment_increment = @session_auto_increment_increment;
SET @@global.auto_increment_offset = @global_auto_increment_offset;
diff --git a/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
index d2b5b828c04..5c6e6ef132f 100644
--- a/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
+++ b/mysql-test/suite/sys_vars/r/auto_increment_offset_func.result
@@ -47,7 +47,8 @@ id name
## Changing value of global scope before opening new connection ##
SET @@global.auto_increment_increment = 15;
SET @@global.auto_increment_offset = 36;
-## New connection test_con1 ##
+CONNECT test_con1,localhost,root,,;
+connection test_con1;
## Value of session & global vairable here should be 10 ##
SELECT @@global.auto_increment_offset = 36;
@@global.auto_increment_offset = 36
@@ -243,8 +244,8 @@ id name
## than auto_increment_increment ##
## Dropping table ##
DROP table if exists t1;
-## Disconnecting connection ##
-## switching to default connection ##
+disconnect test_con1;
+connection default;
SET @@global.auto_increment_increment = @global_auto_increment_increment;
SET @@session.auto_increment_increment = @session_auto_increment_increment;
SET @@global.auto_increment_offset = @global_auto_increment_offset;
diff --git a/mysql-test/suite/sys_vars/r/autocommit_func.result b/mysql-test/suite/sys_vars/r/autocommit_func.result
index 13115ca81ef..1e7636e831e 100644
--- a/mysql-test/suite/sys_vars/r/autocommit_func.result
+++ b/mysql-test/suite/sys_vars/r/autocommit_func.result
@@ -10,7 +10,8 @@ name varchar(30)
## Setting variable's value to 0 i.e false ##
SET @@autocommit = 0;
'#--------------------FN_DYNVARS_003_02-------------------------#'
-## Creating new connection ##
+CONNECT test_con1,localhost,root,,;
+connection test_con1;
## Checking value of variable after opening new connection ##
SELECT @@autocommit;
@@autocommit
@@ -24,25 +25,26 @@ id name
1 Record_1
2 Record_2
## Creating another connection and verifying records in table ##
-## New Connection test_con2 ##
+CONNECT test_con2,localhost,root,,;
+connection test_con2;
SELECT * from t1;
id name
'#--------------------FN_DYNVARS_003_03-------------------------#'
## Verifying behavior of variable by commiting rows in test_con1 ##
-## Connecting with connection # 01 ##
+connection test_con1;
SELECT * from t1;
id name
1 Record_1
2 Record_2
COMMIT;
-## New Connection test_con2 ##
## Now verifying records in table from connection # 02 ##
+connection test_con2;
SELECT * from t1;
id name
1 Record_1
2 Record_2
'#--------------------FN_DYNVARS_003_04-------------------------#'
-## Connecting to connection # 01 ##
+connection test_con1;
SELECT * from t1;
id name
1 Record_1
@@ -54,22 +56,24 @@ id name
1 Record_12
2 Record_2
## Connecting to connecting # 02 and verifying effect of update query ##
+connection test_con2;
SELECT * from t1;
id name
1 Record_1
2 Record_2
## Now connecting with connection # 01 and using ROLLBACK after it ##
+connection test_con1;
ROLLBACK;
SELECT * from t1;
id name
1 Record_1
2 Record_2
'#--------------------FN_DYNVARS_003_05-------------------------#'
-## Connecting with connection # 01 ##
+connection test_con1;
INSERT into t1(name) values('Record_3');
-## Connection test_con2 ##
## Now verifying records in table from connection # 02 and changing value ##
## of autocommit to true ##
+connection test_con2;
SELECT * from t1;
id name
1 Record_1
@@ -84,6 +88,7 @@ id name
4 Record_4
5 Record_5
## Connecting with connection # 01 and inserting few records ##
+connection test_con1;
SELECT * from t1;
id name
1 Record_1
@@ -97,6 +102,7 @@ id name
3 Record_3
6 Record_6
## Now verifying the effect of these new records in second connection ##
+connection test_con2;
SELECT * from t1;
id name
1 Record_1
@@ -104,7 +110,9 @@ id name
4 Record_4
5 Record_5
## Commit changes
+connection test_con1;
COMMIT;
## Dropping table t1 ##
DROP table t1;
-## Disconnecting both connections ##
+disconnect test_con1;
+disconnect test_con2;
diff --git a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result
index dac956fb091..d4d582b92d5 100644
--- a/mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result
+++ b/mysql-test/suite/sys_vars/r/automatic_sp_privileges_func.result
@@ -4,10 +4,10 @@ CREATE TABLE t1 (a varchar(200));
INSERT INTO t1 VALUES('Procedure Executed.');
CREATE USER 'userTest'@'localhost';
CREATE USER 'userTest1'@'localhost';
-** Connection default **
+connection default;
SET GLOBAL automatic_sp_privileges = TRUE;
-** Connecting using userTest **
-** Connection conUser **
+connect conUser,localhost,userTest,,;
+connection conUser;
CREATE PROCEDURE testProc ()
BEGIN
SELECT * FROM t1;
@@ -16,10 +16,10 @@ CALL testProc();
a
Procedure Executed.
Expecting SELECT executed
-** Connection default**
+connection default;
SET GLOBAL automatic_sp_privileges = FALSE;
-** Connecting using userTest1 **
-** Connection conUser1 **
+connect conUser1,localhost,userTest1,,;
+connection conUser1;
CREATE PROCEDURE testProc1 ()
BEGIN
SELECT * FROM t1;
@@ -36,9 +36,9 @@ ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for ro
Expected error access denied
DROP PROCEDURE testProc1;
ERROR 42000: alter routine command denied to user 'userTest1'@'localhost' for routine 'test.testProc1'
-** Connection default **
+connection default;
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE testProc1 TO 'userTest1'@'localhost';
-** Connection conUser1 **
+connection conUser1;
CALL testProc1();
a
Procedure Executed.
@@ -46,8 +46,9 @@ Expecting seelect executed
ALTER PROCEDURE testProc1 COMMENT 'My Comment';
** Cleanup **
-** Connection default **
-disconnecting connections
+connection default;
+disconnect conUser;
+disconnect conUser1;
SET GLOBAL automatic_sp_privileges = @global_automatic_sp_privileges;
REVOKE EXECUTE, ALTER ROUTINE ON PROCEDURE testProc FROM 'userTest'@'localhost';
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'userTest'@'localhost';
diff --git a/mysql-test/suite/sys_vars/r/character_set_client_func.result b/mysql-test/suite/sys_vars/r/character_set_client_func.result
index 3e39b24c8db..333cdfa58b2 100644
--- a/mysql-test/suite/sys_vars/r/character_set_client_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_client_func.result
@@ -2,16 +2,17 @@
SET @global_character_set_client = @@global.character_set_client;
SET @session_character_set_client = @@session.character_set_client;
SET @@global.character_set_client = utf8;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.character_set_client;
@@global.character_set_client
utf8
SELECT @@session.character_set_client;
@@session.character_set_client
latin1
+disconnect con1;
'#--------------------FN_DYNVARS_010_02-------------------------#'
-'connection default'
+connection default;
SHOW VARIABLES like 'character_set_client';
Variable_name Value
character_set_client latin1
diff --git a/mysql-test/suite/sys_vars/r/character_set_connection_func.result b/mysql-test/suite/sys_vars/r/character_set_connection_func.result
index 7f3c4e42ce6..2f964f73c7a 100644
--- a/mysql-test/suite/sys_vars/r/character_set_connection_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_connection_func.result
@@ -4,16 +4,17 @@ SET @session_character_set_connection = @@session.character_set_connection;
SET @session_character_set_client = @@session.character_set_client;
SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_connection = utf8;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.character_set_connection;
@@global.character_set_connection
utf8
SELECT @@session.character_set_connection;
@@session.character_set_connection
latin1
+disconnect con1;
'#--------------------FN_DYNVARS_011_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) CHARACTER SET utf8);
'--verify that character_set_connection converts character_set_client--'
diff --git a/mysql-test/suite/sys_vars/r/character_set_database_func.result b/mysql-test/suite/sys_vars/r/character_set_database_func.result
index 3cadadd0f3f..f51a025610b 100644
--- a/mysql-test/suite/sys_vars/r/character_set_database_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_database_func.result
@@ -4,16 +4,17 @@ SET @session_character_set_database = @@session.character_set_database;
SET @session_character_set_server = @@session.character_set_server;
SET @global_character_set_server = @@global.character_set_server;
SET @@global.character_set_database = utf8;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.character_set_database;
@@global.character_set_database
utf8
SELECT @@session.character_set_database;
@@session.character_set_database
latin1
+disconnect con1;
'#--------------------FN_DYNVARS_008_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1;
'--check if setting session character_set_database effects new databases'
SET @@session.character_set_server = utf8;
@@ -71,12 +72,16 @@ count(*)
1
DROP TABLE IF EXISTS t1;
SET GLOBAL character_set_server=latin5;
+connect con2, localhost, root,,;
+connection con2;
CREATE DATABASE csdb CHARACTER SET = utf8;
USE csdb;
DROP DATABASE csdb;
SELECT @@character_set_database;
@@character_set_database
latin5
+connection default;
+disconnect con2;
SET @@global.character_set_database = @global_character_set_database;
SET @@session.character_set_database = @session_character_set_database;
SET @@session.character_set_server = @session_character_set_server;
diff --git a/mysql-test/suite/sys_vars/r/character_set_results_func.result b/mysql-test/suite/sys_vars/r/character_set_results_func.result
index 14bad0f4eb4..893e4784d39 100644
--- a/mysql-test/suite/sys_vars/r/character_set_results_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_results_func.result
@@ -2,16 +2,17 @@
SET @global_character_set_results = @@global.character_set_results;
SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_results = utf8;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.character_set_results;
@@global.character_set_results
utf8
SELECT @@session.character_set_results;
@@session.character_set_results
latin1
+disconnect con1;
'#--------------------FN_DYNVARS_012_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1(b CHAR(40) character set utf8);
SET NAMES utf8;
@@ -59,6 +60,6 @@ b CHAR_LENGTH(b)
???? 4
????? 5
DROP TABLE t1;
-'connection default;'
+connection default;
SET @@global.character_set_results = @global_character_set_results;
SET @@session.character_set_results = @session_character_set_results;
diff --git a/mysql-test/suite/sys_vars/r/character_set_server_func.result b/mysql-test/suite/sys_vars/r/character_set_server_func.result
index 3731f27adae..f7267985aa2 100644
--- a/mysql-test/suite/sys_vars/r/character_set_server_func.result
+++ b/mysql-test/suite/sys_vars/r/character_set_server_func.result
@@ -2,16 +2,17 @@
SET @global_character_set_server = @@global.character_set_server;
SET @session_character_set_server = @@session.character_set_server;
SET @@global.character_set_server = utf8;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.character_set_server;
@@global.character_set_server
utf8
SELECT @@session.character_set_server;
@@session.character_set_server
utf8
+disconnect con1;
'#--------------------FN_DYNVARS_009_02-------------------------#'
-'connection default'
+connection default;
'---global character_set_server should not effects current connection---'
SET @@global.character_set_server = utf8;
CREATE DATABASE db1;
@@ -35,8 +36,8 @@ select @@character_set_database;
@@character_set_database
utf8
'----test with new connection----'
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@session.character_set_server;
@@session.character_set_server
utf8
@@ -60,6 +61,7 @@ DROP DATABASE db1;
select @@character_set_database;
@@character_set_database
utf8
-'connection default;'
+disconnect con1;
+connection default;
SET @@global.character_set_server = @global_character_set_server;
SET @@session.character_set_server = @session_character_set_server;
diff --git a/mysql-test/suite/sys_vars/r/collation_connection_func.result b/mysql-test/suite/sys_vars/r/collation_connection_func.result
index b40efda517f..3fbf252eff0 100644
--- a/mysql-test/suite/sys_vars/r/collation_connection_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_connection_func.result
@@ -2,16 +2,17 @@
SET @global_collation_connection = @@global.collation_connection;
SET @session_collation_connection = @@session.collation_connection;
SET @@global.collation_connection = latin1_danish_ci;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.collation_connection;
@@global.collation_connection
latin1_danish_ci
SELECT @@session.collation_connection;
@@session.collation_connection
latin1_swedish_ci
+disconnect con1;
'#--------------------FN_DYNVARS_015_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1;
'----check if collation_connection update character_set_connection---'
SET @@session.collation_connection = utf8_spanish_ci;
diff --git a/mysql-test/suite/sys_vars/r/collation_database_func.result b/mysql-test/suite/sys_vars/r/collation_database_func.result
index 38b1c7e22ba..99f0e253005 100644
--- a/mysql-test/suite/sys_vars/r/collation_database_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_database_func.result
@@ -3,16 +3,17 @@ SET @global_collation_database = @@global.collation_database;
SET @session_collation_database = @@session.collation_database;
SET @session_collation_server = @@session.collation_server;
SET @@global.collation_database = latin1_danish_ci;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.collation_database;
@@global.collation_database
latin1_danish_ci
SELECT @@session.collation_database;
@@session.collation_database
latin1_swedish_ci
+disconnect con1;
'#--------------------FN_DYNVARS_011_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1,t2;
SELECT @@character_set_server,@@collation_server;
@@character_set_server @@collation_server
diff --git a/mysql-test/suite/sys_vars/r/collation_server_func.result b/mysql-test/suite/sys_vars/r/collation_server_func.result
index 98672bc452b..138904b4714 100644
--- a/mysql-test/suite/sys_vars/r/collation_server_func.result
+++ b/mysql-test/suite/sys_vars/r/collation_server_func.result
@@ -2,16 +2,17 @@
SET @global_collation_server = @@global.collation_server;
SET @session_collation_server = @@session.collation_server;
SET @@global.collation_server = latin1_danish_ci;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.collation_server;
@@global.collation_server
latin1_danish_ci
SELECT @@session.collation_server;
@@session.collation_server
latin1_danish_ci
+disconnect con1;
'#--------------------FN_DYNVARS_014_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1,t2;
'---check if setting collation_server update character_set_server---'
SET @@session.collation_server = utf8_spanish_ci;
diff --git a/mysql-test/suite/sys_vars/r/completion_type_func.result b/mysql-test/suite/sys_vars/r/completion_type_func.result
index f3ddcd287b6..5996670c281 100644
--- a/mysql-test/suite/sys_vars/r/completion_type_func.result
+++ b/mysql-test/suite/sys_vars/r/completion_type_func.result
@@ -6,7 +6,9 @@ id INT NOT NULL,
PRIMARY KEY (id),
name VARCHAR(30)
) ENGINE = INNODB;
-## Creating new connections test_con1, test_con2 ##
+connect test_con1,localhost,root,,;
+connect test_con2,localhost,root,,;
+connection default;
#########################################################
# Setting initial value of completion_type to zero #
#########################################################
@@ -26,12 +28,12 @@ id name
1 Record_1
2 Record_2
3 Record_3
-Switching to connection test_con1
+connection test_con1;
## Don't expect to see id's 2 and 3 in the table w/o COMMIT ##
SELECT * FROM t1;
id name
1 Record_1
-Switching to default connection
+connection default;
COMMIT;
## test rollback ##
START TRANSACTION;
@@ -44,7 +46,7 @@ id name
3 Record_3
4 Record_4
5 Record_5
-Switching to connection test_con1
+connection test_con1;
## Don't expect to see id's 4 and 5 here ##
## Expect to see 3, Record_3 ##
SELECT * FROM t1;
@@ -52,7 +54,7 @@ id name
1 Record_1
2 Record_2
3 Record_3
-Switching to connection default;
+connection default;
ROLLBACK;
## Don't expect to see id's 4 and 5 now ##
SELECT * FROM t1;
@@ -64,7 +66,7 @@ id name
#########################################################
# Setting initial value of completion_type to one #
#########################################################
-Switching to connection test_con1;
+connection test_con1;
SET @@session.completion_type = 1;
START TRANSACTION;
SELECT * FROM t1;
@@ -85,7 +87,7 @@ id name
6 Record_6
7 Record_7
8 Record_8
-switching to test_con2
+connection test_con2;
## Do not expect to see 8, Record_8 as no COMMIT has occurred ##
SELECT * FROM t1;
id name
@@ -94,7 +96,7 @@ id name
3 Record_3
6 Record_6
7 Record_7
-switch to connection test_con1
+connection test_con1;
## Testing ROLLBACK behavior
START TRANSACTION;
INSERT INTO t1 VALUES(9, 'Record_9');
@@ -123,7 +125,7 @@ id name
8 Record_8
## Expect a new transaction ##
INSERT INTO t1 VALUES(9, 'Record_9');
-Switching to connection test_con2
+connection test_con2;
## Don't expect to see 9, Record_9 due to no COMMIT yet ##
SELECT * FROM t1;
id name
@@ -133,7 +135,7 @@ id name
6 Record_6
7 Record_7
8 Record_8
-Switching to connection test_con1
+connection test_con1;
ROLLBACK;
## Don't expect to see 9, Record_9
SELECT * FROM t1;
@@ -165,7 +167,7 @@ COMMIT;
## disconnect after using COMMIT ##
INSERT INTO t1 VALUES(4,'Record_4');
Got one of the listed errors
-switch to connection test_con2
+connection test_con2;
SET @@session.completion_type = 2;
## Inserting rows and using Rollback which should Rollback & release ##
START TRANSACTION;
@@ -185,4 +187,7 @@ ROLLBACK;
## Expect a failure due to COMMIT/ROLLBACK AND RELEASE behavior ##
INSERT INTO t1 VALUES(4,'Record_4');
Got one of the listed errors
+connection default;
+disconnect test_con1;
+disconnect test_con2;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
index 56e83d98872..edd8420a13e 100644
--- a/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
+++ b/mysql-test/suite/sys_vars/r/concurrent_insert_func.result
@@ -14,6 +14,7 @@ INSERT INTO t1(name) VALUES('Record_3');
## locking table ##
LOCK TABLE t1 READ LOCAL;
## Creating new connection to insert some rows in table ##
+connect test_con1,localhost,root,,;
connection test_con1;
## New records should come at the end of all rows ##
INSERT INTO t1(name) VALUES('Record_4');
@@ -117,5 +118,5 @@ Record_5
Record_6
## Dropping table ##
DROP TABLE t1;
-## Disconnecting connection ##
+disconnect test_con1;
SET @@global.concurrent_insert= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/debug_dbug_func.result b/mysql-test/suite/sys_vars/r/debug_dbug_func.result
index a622a4d024c..1c7ae4e2832 100644
--- a/mysql-test/suite/sys_vars/r/debug_dbug_func.result
+++ b/mysql-test/suite/sys_vars/r/debug_dbug_func.result
@@ -56,18 +56,19 @@ SET SESSION debug_dbug= '-d:-t:-i';
SET GLOBAL debug_dbug= '';
SET SESSION debug_dbug= '';
# Test 2 - Bug test case, two connections
-# Connection default
+connection default;
SET GLOBAL debug_dbug= '+O,MYSQL_TMP_DIR/bug46165.2.trace';
SET SESSION debug_dbug= '-d:-t:-i';
-# Connection con1
+connect con1, localhost, root;
SET GLOBAL debug_dbug= '';
-# Connection default
+connection default;
SET SESSION debug_dbug= '';
-# Connection con1
-# Connection default
+connection con1;
+disconnect con1;
+connection default;
SET GLOBAL debug_dbug= '';
# Test 3 - Active session trace file on disconnect
-# Connection con1
+connect con1, localhost, root;
SET GLOBAL debug_dbug= '+O,MYSQL_TMP_DIR/bug46165.3.trace';
SELECT @@global.debug_dbug, @@session.debug_dbug;
@@global.debug_dbug @@session.debug_dbug
@@ -80,18 +81,20 @@ SET GLOBAL debug_dbug= '';
SELECT @@global.debug_dbug, @@session.debug_dbug;
@@global.debug_dbug @@session.debug_dbug
O,MYSQL_TMP_DIR/bug46165.3.trace:T
+disconnect con1;
# Test 4 - Active session trace file on two connections
-# Connection default
+connection default;
SET GLOBAL debug_dbug= '+O,MYSQL_TMP_DIR/bug46165.4.trace';
SET SESSION debug_dbug= '-d:-t:-i';
-# Connection con1
+connect con1, localhost, root;
SET SESSION debug_dbug= '-d:-t:-i';
SET GLOBAL debug_dbug= '';
SET SESSION debug_dbug= '';
-# Connection default
+connection default;
SET SESSION debug_dbug= '';
-# Connection con1
-# Connection default
+connection con1;
+disconnect con1;
+connection default;
# Test 5 - Different trace files
SET SESSION debug_dbug= '+O,MYSQL_TMP_DIR/bug46165.5.trace';
SET SESSION debug_dbug= '+O,MYSQL_TMP_DIR/bug46165.6.trace';
diff --git a/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result b/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result
index 81a251a85ab..45de298e25b 100644
--- a/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result
+++ b/mysql-test/suite/sys_vars/r/debug_dbug_func_notembedded.result
@@ -1,15 +1,24 @@
+connect con1,localhost,root,,test,,;
+connect con2,localhost,root,,test,,;
+connection con1;
set session debug_dbug="t";
show session variables like 'debug';
Variable_name Value
debug t
+connection con2;
set session debug_dbug="t";
show session variables like 'debug';
Variable_name Value
debug t
+connection con1;
set session debug_dbug="d:t";
show session variables like 'debug';
Variable_name Value
debug d:t
+connection con2;
show session variables like 'debug';
Variable_name Value
debug t
+disconnect con1;
+disconnect con2;
+connection default;
diff --git a/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result b/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result
index 84c55f3d2b6..d25f3ca1c88 100644
--- a/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result
+++ b/mysql-test/suite/sys_vars/r/default_regex_flags_basic.result
@@ -45,11 +45,13 @@ SET @@global.default_regex_flags='MULTILINE';
SELECT @@session.default_regex_flags;
@@session.default_regex_flags
-# connection con1
+connect con1,localhost,root,,;
+connection con1;
SELECT @@session.default_regex_flags;
@@session.default_regex_flags
MULTILINE
-# connection default
+connection default;
+disconnect con1;
SELECT @@session.default_regex_flags;
@@session.default_regex_flags
diff --git a/mysql-test/suite/sys_vars/r/delay_key_write_func.result b/mysql-test/suite/sys_vars/r/delay_key_write_func.result
index d55cca7ab8e..0fd1d492ef4 100644
--- a/mysql-test/suite/sys_vars/r/delay_key_write_func.result
+++ b/mysql-test/suite/sys_vars/r/delay_key_write_func.result
@@ -4,14 +4,15 @@ SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write;
@@global.delay_key_write
ON
-'connect (user1,localhost,root,,,,)'
-'connection user1'
+connect user1,localhost,root,,,,;
+connection user1;
SELECT @@global.delay_key_write AS res_is_ON;
res_is_ON
ON
SET @@global.delay_key_write = ALL;
-'connect (user1,localhost,root,,,,)'
-'connection user1'
+disconnect user1;
+connect user1,localhost,root,,,,;
+connection user1;
SELECT @@global.delay_key_write AS res_is_ALL;
res_is_ALL
ALL
@@ -66,4 +67,6 @@ COUNT(*)
9
DROP PROCEDURE sp_addRecords;
DROP TABLE t1;
+disconnect user1;
+connection default;
SET @@global.delay_key_write= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
index eeb7a28c816..0a7c9a8169d 100644
--- a/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/delayed_insert_limit_func.result
@@ -1,7 +1,8 @@
** Setup **
-Creating connection con0
-Creating connection con1
+connect con0,localhost,root,,;
+connect con1,localhost,root,,;
+connection default;
SET @global_delayed_insert_limit = @@GLOBAL.delayed_insert_limit;
CREATE TABLE t1 (a VARCHAR(100),b VARCHAR(100),c VARCHAR(100));
CREATE VIEW v1 as select * from t1;
@@ -14,7 +15,7 @@ INSERT INTO t1 VALUES('4','1','1');
INSERT INTO t1 VALUES('5','1','1');
INSERT INTO t1 VALUES('6','1','1');
LOCK TABLE v1 WRITE;
-** Connection con1 **
+connection con1;
INSERT DELAYED INTO t1 VALUES('7','1','1');
INSERT DELAYED INTO t1 VALUES('8','1','1');
INSERT DELAYED INTO t1 VALUES('9','1','1');
@@ -52,20 +53,20 @@ INSERT DELAYED INTO t1 VALUES('40','1','1');
INSERT DELAYED INTO t1 VALUES('41','1','1');
INSERT DELAYED INTO t1 VALUES('42','1','1');
INSERT DELAYED INTO t1 VALUES('43','1','1');|
-** Connection con0 **
+connection con0;
SELECT COUNT(*) FROM t1;
-** Connection default **
+connection default;
** Wait till con0 is blocked **
UNLOCK TABLES;
-** Connection con1 **
+connection con1;
Asynchronous "reap" result
-** Connection con0 **
+connection con0;
Asynchronous "reap" result
The next result suffers from
'# Bug#35386 insert delayed inserts 1 + limit rows instead of just limit rows'
COUNT(*)
21
-** Connection default **
+connection default;
Checking if the delayed insert continued afterwards
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -83,7 +84,7 @@ INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE;
-** Connection con1 **
+connection con1;
Asynchronous execute
INSERT DELAYED INTO t1 VALUES('7');
INSERT DELAYED INTO t1 VALUES('8');
@@ -101,24 +102,25 @@ INSERT DELAYED INTO t1 VALUES('19');
INSERT DELAYED INTO t1 VALUES('20');
INSERT DELAYED INTO t1 VALUES('21');
INSERT DELAYED INTO t1 VALUES('22');|
-** Connection con0 **
+connection con0;
Asynchronous execute
SELECT COUNT(*) BETWEEN 6 AND 22 FROM t1;
-** Connection default **
+connection default;
** Wait till con0 is blocked **
UNLOCK TABLES;
-** Connection con1 **
-** Connection con0 **
+connection con1;
+connection con0;
Asynchronous "reap" result
COUNT(*) BETWEEN 6 AND 22
1
-** Connection default**
+connection default;
Checking if the delayed insert gives the same result afterwards
SELECT COUNT(*) BETWEEN 6 AND 22 FROM t1;
COUNT(*) BETWEEN 6 AND 22
1
-** Connection default**
+connection default;
DROP TABLE t1;
DROP VIEW v1;
SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit;
-Disconnecting from con1, con0
+disconnect con0;
+disconnect con1;
diff --git a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
index ee8b7c5691d..c839dd6b289 100644
--- a/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
+++ b/mysql-test/suite/sys_vars/r/div_precision_increment_func.result
@@ -34,7 +34,8 @@ name VARCHAR(30),
salary INT,
income_tax FLOAT
);
-## Creating new connection test_con1 ##
+connect test_con1, localhost, root,,;
+connection test_con1;
## Setting global & session scope value of variable ##
SET @@global.div_precision_increment = 2;
SET @@session.div_precision_increment = 1;
@@ -53,7 +54,8 @@ id name salary income_tax
1 Record_1 100011 250.027
2 Record_2 501 1.2525
3 Record_3 210 0.525
-## Creating new connection ##
+connect test_con2, localhost, root,,;
+connection test_con2;
## Verifying session & global value of variable ##
SELECT @@global.div_precision_increment = 2;
@@global.div_precision_increment = 2
@@ -75,5 +77,7 @@ id name salary income_tax
6 Record_6 210 0.525
## Dropping table t1 ##
drop table t1;
-## Disconnection both the connections ##
+disconnect test_con1;
+disconnect test_con2;
+connection default;
SET @@global.div_precision_increment = 4;
diff --git a/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
index 398a2a76eb8..793222187f3 100644
--- a/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
+++ b/mysql-test/suite/sys_vars/r/foreign_key_checks_func.result
@@ -1,18 +1,19 @@
'#--------------------FN_DYNVARS_032_01-------------------------#'
SET @@session.foreign_key_checks = 0;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
1
SET @@session.foreign_key_checks = 1;
-'connect (con2,localhost,root,,,,)'
-'connection con2'
+connect con2,localhost,root,,,,;
+connection con2;
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
1
+disconnect con2;
'#--------------------FN_DYNVARS_032_02-------------------------#'
-'connection con1'
+connection con1;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1(a INT PRIMARY KEY)ENGINE = INNODB;
CREATE TABLE t2(a INT PRIMARY KEY,b INT)ENGINE = INNODB;
diff --git a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
index fa4899f4c39..0f5fe1238a4 100644
--- a/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
+++ b/mysql-test/suite/sys_vars/r/ft_boolean_syntax_func.result
@@ -1,18 +1,20 @@
'#--------------------FN_DYNVARS_033_01-------------------------#'
SET @@global.ft_boolean_syntax = ' -+()<>~*:``&|';
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.ft_boolean_syntax;
@@global.ft_boolean_syntax
-+()<>~*:``&|
SET @@global.ft_boolean_syntax = '+ -><()~*:""&|';
-'connect (con2,localhost,root,,,,)'
-'connection con2'
+connect con2,localhost,root,,,,;
+connection con2;
SELECT @@global.ft_boolean_syntax;
@@global.ft_boolean_syntax
+ -><()~*:""&|
+disconnect con2;
+disconnect con1;
'#--------------------FN_DYNVARS_033_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
diff --git a/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result b/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
index f04dfee583d..30e2639af37 100644
--- a/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
+++ b/mysql-test/suite/sys_vars/r/group_concat_max_len_func.result
@@ -30,9 +30,10 @@ id rollno name
6 3 Record_6
7 4 Record_7
8 4 Record_8
-## Creating two new connections ##
+connect test_con1,localhost,root,,;
+connect test_con2,localhost,root,,;
'#--------------------FN_DYNVARS_034_02-------------------------#'
-## Connecting with test_con1 ##
+connection test_con1;
## Accessing data and using group_concat on column whose value is greater than 4 ##
SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
id rollno GROUP_CONCAT(name)
@@ -59,7 +60,7 @@ Warning 1260 Row 2 was cut by GROUP_CONCAT()
Warning 1260 Row 5 was cut by GROUP_CONCAT()
Warning 1260 Row 7 was cut by GROUP_CONCAT()
'#--------------------FN_DYNVARS_034_03-------------------------#'
-## Connecting with new connection test_con2 ##
+connection test_con2;
## Verifying initial value of variable. It should be 4 ##
SELECT @@session.group_concat_max_len = 4;
@@session.group_concat_max_len = 4
@@ -90,5 +91,7 @@ id rollno GROUP_CONCAT(name)
7 4 Record_7,Record_8
## Dropping table t1 ##
DROP TABLE t1;
-## Disconnecting both the connection ##
+disconnect test_con2;
+disconnect test_con1;
+connection default;
SET @@global.group_concat_max_len = @save;
diff --git a/mysql-test/suite/sys_vars/r/identity_func.result b/mysql-test/suite/sys_vars/r/identity_func.result
index ba430e72a1f..47a6fa856c5 100644
--- a/mysql-test/suite/sys_vars/r/identity_func.result
+++ b/mysql-test/suite/sys_vars/r/identity_func.result
@@ -19,7 +19,8 @@ name VARCHAR(30)
SELECT @@identity = 0;
@@identity = 0
1
-## Creating and connecting with new connection test_con1 ##
+connect test_con1, localhost, root,,;
+connection test_con1;
SET @@autocommit = 0;
## Inserting rows in table t1 ##
INSERT into t1(name) values('Record_1');
@@ -38,7 +39,8 @@ SELECT @@identity from t2;
@@identity
1
'#--------------------FN_DYNVARS_035_02-------------------------#'
-## Creating and connecting with new connection test_con2 ##
+connect test_con2, localhost, root,,;
+connection test_con2;
SELECT * from t1;
id name
## Verifying total values in t1 ##
@@ -62,7 +64,7 @@ SELECT @@identity from t2;
@@identity
2
'#--------------------FN_DYNVARS_035_03-------------------------#'
-## Switching to connection test_con1 ##
+connection test_con1;
## Commiting rows added in test_con1 ##
COMMIT;
## Verifying records in both tables ##
@@ -102,4 +104,5 @@ SELECT @@identity from t1;
6
## Dropping tables t1 & t2 ##
drop table t1, t2;
-## Disconnecting both the connections ##
+disconnect test_con1;
+disconnect test_con2;
diff --git a/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result b/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result
index a6da229808e..b3ab6fbc1da 100644
--- a/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result
+++ b/mysql-test/suite/sys_vars/r/innodb_fatal_semaphore_wait_threshold.result
@@ -1,7 +1,7 @@
-# Establish connection con1 (user=root)
-# Establish connection con2 (user=root)
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
drop table if exists t1;
-# Switch to connection con1
+connection con1;
create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
set DEBUG_DBUG='+d,fatal-semaphore-timeout';
@@ -9,13 +9,13 @@ set autocommit=0;
# Sending query on con1,
# the session will hold lock table mutex and sleep
SELECT * from t1 where id = 0 FOR UPDATE;
-# Switch to connection con2
+connection con2;
set autocommit=0;
# Sending query on con2,
# the session will be blocked on the lock table mutex and
# thus be put into sync arry
SELECT * from t1 where id = 0 FOR UPDATE;
-# Switched to the default connection
+connection default;
# Waitting for mysqld to crash
# Mysqld crash was detected
# Waitting for reconnect after mysqld restarts
diff --git a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
index 05aa3e5fd89..eb0de047df1 100644
--- a/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_max_dirty_pages_pct_func.result
@@ -1,20 +1,20 @@
SET @innodb_max_dirty_pages_pct = @@global.innodb_max_dirty_pages_pct;
'#--------------------FN_DYNVARS_044_02-------------------------#'
SET @@global.innodb_max_dirty_pages_pct = 80;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
80.000000
SET @@global.innodb_max_dirty_pages_pct = 70;
-'connect (con2,localhost,root,,,,)'
-'connection con2'
+connect con2,localhost,root,,,,;
+connection con2;
SELECT @@global.innodb_max_dirty_pages_pct;
@@global.innodb_max_dirty_pages_pct
70.000000
-'connection default'
-'disconnect con2'
-'disconnect con1'
+connection default;
+disconnect con2;
+disconnect con1;
SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
'#--------------------FN_DYNVARS_044_02-------------------------#'
DROP PROCEDURE IF EXISTS add_records;
diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
index 9036794d636..7291b60ea62 100644
--- a/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_func.result
@@ -1,15 +1,16 @@
'#--------------------FN_DYNVARS_046_01-------------------------#'
SET @@global.innodb_support_xa = OFF;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.innodb_support_xa;
@@global.innodb_support_xa
0
SELECT @@session.innodb_support_xa;
@@session.innodb_support_xa
0
+disconnect con1;
'#--------------------FN_DYNVARS_046_01-------------------------#'
-'connection default'
+connection default;
SET @@global.innodb_support_xa = 1;
drop table if exists t1, t2;
create table t1 (a int) engine=innodb;
@@ -43,8 +44,8 @@ BEGIN;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
CREATE table t2 (a int);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+CONNECT con1,localhost,root,,,,;
+connection con1;
xa start 'testa','testb';
ERROR XAE08: XAER_DUPID: The XID already exists
xa start 'testa','testb', 123;
@@ -58,7 +59,7 @@ ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction
xa recover;
formatID gtrid_length bqual_length data
11 5 5 testb 0@P`
-'connection default'
+connection default;
xa prepare 'testa','testb';
xa recover;
formatID gtrid_length bqual_length data
@@ -67,7 +68,7 @@ formatID gtrid_length bqual_length data
xa commit 'testb',0x2030405060,11;
ERROR XAE04: XAER_NOTA: Unknown XID
xa commit 'testa','testb';
-'connection con1'
+connection con1;
xa rollback 'testb',0x2030405060,11;
SELECT * from t1;
a
diff --git a/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
index 824d196d295..8e7806ad7e0 100644
--- a/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
+++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_func.result
@@ -4,18 +4,19 @@ SELECT @start_value;
@start_value
1
SET @@global.innodb_table_locks = OFF;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.innodb_table_locks;
@@global.innodb_table_locks
0
SELECT @@session.innodb_table_locks;
@@session.innodb_table_locks
0
+disconnect con1;
'#--------------------FN_DYNVARS_048_02-------------------------#'
'----check when innodb_table_locks = ON and autocommit = OFF---'
-'connect (con2,localhost,root,,,,)'
-'connection default'
+connect con2,localhost,root,,,,;
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=INNODB;
SET @@autocommit = OFF;
@@ -25,15 +26,17 @@ INSERT INTO t1 VALUES(1);
SELECT * FROM t1 FOR UPDATE;
a
1
-'CONNECTION con2'
+connection con2;
SET @@innodb_table_locks = ON;
SET @@autocommit = OFF;
LOCK TABLES t1 WRITE;
-'CONNECTION default'
+connection default;
COMMIT;
-'CONNECTION con2'
+connection con2;
UNLOCK tables;
DROP TABLE t1;
+disconnect con2;
+connection default;
SET @@global.innodb_table_locks= @start_value;
SELECT @@global.innodb_table_locks;
@@global.innodb_table_locks
diff --git a/mysql-test/suite/sys_vars/r/insert_id_func.result b/mysql-test/suite/sys_vars/r/insert_id_func.result
index f03b3ea4851..6a5746e130d 100644
--- a/mysql-test/suite/sys_vars/r/insert_id_func.result
+++ b/mysql-test/suite/sys_vars/r/insert_id_func.result
@@ -25,7 +25,8 @@ SELECT @@session.insert_id;
0
INSERT into t1(name) values('Record_3');
'#--------------------FN_DYNVARS_051_02-------------------------#'
-## Creating & Connecting new connection test_con1 ##
+connect test_con1, localhost, root,,;
+connection test_con1;
## Setting value of insert_id to 50 ##
SET @@session.insert_id = 50;
SELECT @@session.insert_id;
@@ -46,7 +47,8 @@ id name
'Bug#35376 Value of insert_id automatically resets to 0 after inserting
' 1st row'
'#--------------------FN_DYNVARS_051_03-------------------------#'
-## Creating and switching to new connection test_con2 ##
+connect test_con2, localhost, root,,;
+connection test_con2;
## Setting session value of variable to 25 ##
SET @@session.insert_id = 25;
## Inserting some rows in table ##
@@ -65,4 +67,5 @@ id name
105 Record_8
## Dropping table t1 ##
drop table t1;
-## Disconnecting connections ##
+disconnect test_con1;
+disconnect test_con2;
diff --git a/mysql-test/suite/sys_vars/r/interactive_timeout_func.result b/mysql-test/suite/sys_vars/r/interactive_timeout_func.result
index 2ecd32f53bd..9c65f100cda 100644
--- a/mysql-test/suite/sys_vars/r/interactive_timeout_func.result
+++ b/mysql-test/suite/sys_vars/r/interactive_timeout_func.result
@@ -9,7 +9,8 @@ name VARCHAR(30)
'#--------------------FN_DYNVARS_052_01-------------------------#'
## Setting initial value of variable to 1 ##
SET @@global.interactive_timeout = 1;
-## Creating new connection test_con1 ##
+connect test_con1, localhost, root,,,,,;
+connection test_con1;
## Inserting record in table ##
INSERT into t1(name) values('Record_1');
## Setting session value of interactive_timeout ##
diff --git a/mysql-test/suite/sys_vars/r/key_buffer_size_func.result b/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
index a10be0ab832..8347f73d637 100644
--- a/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
+++ b/mysql-test/suite/sys_vars/r/key_buffer_size_func.result
@@ -12,9 +12,10 @@ FLUSH STATUS;
'#--------------------FN_DYNVARS_055_01-------------------------#'
## Setting initial value of variable to 131072 ##
SET @@global.key_buffer_size = 131072;
-## Creating two new connections ##
+CONNECT test_con1,localhost,root,,;
+CONNECT test_con2,localhost,root,,;
'#--------------------FN_DYNVARS_055_02-------------------------#'
-## Connecting with connection test_con1 ##
+connection test_con1;
SELECT @@global.key_buffer_size;
@@global.key_buffer_size
131072
@@ -33,12 +34,12 @@ INSERT INTO t1(rollno, name) VALUES(4, 'Record_10');
show status like 'Key_reads';
Variable_name Value
Key_reads 0
-## Switching to connection test_con2 ##
+connection test_con2;
## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
Variable_name Value
Key_reads 0
-## Connecting with connection test_con1 ##
+connection test_con1;
## Inserting some rows in table ##
INSERT INTO t1(rollno, name) VALUES(5, 'Record_11');
INSERT INTO t1(rollno, name) VALUES(6, 'Record_12');
@@ -56,5 +57,7 @@ Variable_name Value
Key_reads 0
## Dropping table ##
DROP TABLE IF EXISTS t1;
-## Disconnecting both the connections ##
+disconnect test_con2;
+disconnect test_con1;
+connection default;
SET @@global.key_buffer_size= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/last_insert_id_func.result b/mysql-test/suite/sys_vars/r/last_insert_id_func.result
index 2f07aeeec05..b6b1d9510a3 100644
--- a/mysql-test/suite/sys_vars/r/last_insert_id_func.result
+++ b/mysql-test/suite/sys_vars/r/last_insert_id_func.result
@@ -23,7 +23,8 @@ SELECT @@session.last_insert_id = 2;
@@session.last_insert_id = 2
1
'#--------------------FN_DYNVARS_059_02-------------------------#'
-## Creating & connecting to new connection test_con1 ##
+connect test_con1, localhost, root,,;
+connection test_con1;
SET @@autocommit = 0;
## Verifying initial value of variable in new connection ##
SELECT @@session.last_insert_id;
@@ -39,7 +40,8 @@ SELECT @@session.last_insert_id;
@@session.last_insert_id
5
'#--------------------FN_DYNVARS_059_03-------------------------#'
-## Creating & connecting to new connection test_con2 ##
+connect test_con2, localhost, root,,;
+connection test_con2;
## Inserting values through new connection ##
INSERT into t1(name) values('Record_6');
INSERT into t1(name) values('Record_7');
@@ -54,7 +56,7 @@ SELECT @@last_insert_id;
@@last_insert_id
7
'#--------------------FN_DYNVARS_059_04-------------------------#'
-## Switching to test_con1 ##
+connection test_con1;
## Verifying all records in table & value of variable ##
SELECT * from t1;
id name
@@ -74,6 +76,7 @@ SELECT @@session.last_insert_id;
@@session.last_insert_id
5
## Switching to test_con2 & verifying value of variable in it ##
+connection test_con2;
SELECT @@session.last_insert_id;
@@session.last_insert_id
7
@@ -90,4 +93,5 @@ SELECT @@session.last_insert_id;
8
## Dropping table t1 ##
drop table t1;
-## Disconnecting both the connections ##
+disconnect test_con1;
+disconnect test_con2;
diff --git a/mysql-test/suite/sys_vars/r/lc_time_names_func.result b/mysql-test/suite/sys_vars/r/lc_time_names_func.result
index 703aa65a6be..99e8de2aca3 100644
--- a/mysql-test/suite/sys_vars/r/lc_time_names_func.result
+++ b/mysql-test/suite/sys_vars/r/lc_time_names_func.result
@@ -1,7 +1,7 @@
'#--------------------FN_DYNVARS_060_01-------------------------#'
SET @@global.lc_time_names = "en_CA";
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.lc_time_names;
@@global.lc_time_names
en_CA
@@ -9,16 +9,18 @@ SELECT @@session.lc_time_names;
@@session.lc_time_names
en_CA
SET @@global.lc_time_names = "en_IN";
-'connect (con2,localhost,root,,,,)'
-'connection con2'
+connect con2,localhost,root,,,,;
+connection con2;
SELECT @@global.lc_time_names;
@@global.lc_time_names
en_IN
SELECT @@session.lc_time_names;
@@session.lc_time_names
en_IN
+disconnect con2;
+disconnect con1;
'#--------------------FN_DYNVARS_060_02-------------------------#'
-'connection default'
+connection default;
SET NAMES 'utf8';
SET @@session.lc_time_names = 'en_US';
SELECT DATE_FORMAT('2010-01-01','%W %a %M %b'), DAYNAME('2010-05-05'),MONTHNAME('2010-12-12');
diff --git a/mysql-test/suite/sys_vars/r/local_infile_func.result b/mysql-test/suite/sys_vars/r/local_infile_func.result
index 4a9d0e20b88..1c116090f88 100644
--- a/mysql-test/suite/sys_vars/r/local_infile_func.result
+++ b/mysql-test/suite/sys_vars/r/local_infile_func.result
@@ -1,18 +1,19 @@
'#--------------------FN_DYNVARS_037_01-------------------------#'
SET @@global.local_infile = 0;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.local_infile;
@@global.local_infile
0
SET @@global.local_infile = 1;
-'connect (con2,localhost,root,,,,)'
-'connection con2'
+connect con2,localhost,root,,,,;
+connection con2;
SELECT @@global.local_infile;
@@global.local_infile
1
+disconnect con2;
'#--------------------FN_DYNVARS_037_02-------------------------#'
-'connection con1'
+connection con1;
'-----Checking LOAD DATA when local_infile is 1-------'
SET @@global.local_infile = 1;
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result
index 33443df5ae4..0bec3eb2b29 100644
--- a/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result
+++ b/mysql-test/suite/sys_vars/r/log_bin_trust_function_creators_func.result
@@ -7,7 +7,8 @@ CREATE USER tt@localhost;
SET @@global.log_bin_trust_function_creators = 0;
## Creating new table t2 ##
CREATE TABLE t2 (a INT);
-## Creating & connecting with new connection test_con1 ##
+connect test_con1,localhost,tt,,;
+connection test_con1;
SELECT @@log_bin_trust_function_creators;
@@log_bin_trust_function_creators
0
@@ -29,6 +30,7 @@ END IF;
RETURN 1;
END|
ERROR HY000: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
+connection default;
## Creating new function f1 succeeds ##
CREATE FUNCTION f1(a INT) RETURNS INT DETERMINISTIC
BEGIN
@@ -50,10 +52,11 @@ f1(a)
DROP FUNCTION f1;
DROP TABLE t1;
'#--------------------FN_DYNVARS_063_02-------------------------#'
-## Switching to default connection ##
+connection default;
## Setting value of variable to 1 ##
SET @@global.log_bin_trust_function_creators = 1;
-## Creating and connecting to new connection test_con2 ##
+connect test_con2,localhost,tt,,;
+connection test_con2;
## Verifying value of variable ##
SELECT @@log_bin_trust_function_creators;
@@log_bin_trust_function_creators
@@ -82,6 +85,7 @@ f1(a)
DROP FUNCTION f1;
## Dropping table t1 & t2 ##
DROP TABLE t1,t2;
-## Disconnecting test_con2##
+disconnect test_con2;
+connection default;
DROP USER tt@localhost;
SET @@global.log_bin_trust_function_creators= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/log_output_func.result b/mysql-test/suite/sys_vars/r/log_output_func.result
index 24703f4317b..1f95657c744 100644
--- a/mysql-test/suite/sys_vars/r/log_output_func.result
+++ b/mysql-test/suite/sys_vars/r/log_output_func.result
@@ -2,14 +2,14 @@ SET @start_value= @@global.log_output;
SET @start_general_log= @@global.general_log;
'#--------------------FN_DYNVARS_065_01-------------------------#'
SET @@global.log_output = 'NONE';
-'connect (con1,localhost,root,,,,)'
+connect con1,localhost,root,,,,;
SET @@global.log_output = 'TABLE,FILE';
-'connect (con2,localhost,root,,,,)'
+connect con2,localhost,root,,,,;
SELECT @@global.log_output;
@@global.log_output
FILE,TABLE
'#--------------------FN_DYNVARS_065_02-------------------------#'
-'connection con1'
+connection con1;
'---Checking general_log when log_output is NONE---'
SET @@global.log_output = 'NONE';
TRUNCATE TABLE mysql.general_log;
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
index 79708c480a8..ec99256a862 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_basic.result
@@ -3,6 +3,7 @@ SELECT @start_global_value;
@start_global_value
4194304
SET @@global.max_allowed_packet = DEFAULT;
+connect conn1, localhost, root,,;
'#--------------------FN_DYNVARS_070_01-------------------------#'
SET @@global.max_allowed_packet = 1000;
Warnings:
@@ -194,6 +195,7 @@ SELECT session.max_allowed_packet;
ERROR 42S02: Unknown table 'session' in field list
SELECT max_allowed_packet = @@session.max_allowed_packet;
ERROR 42S22: Unknown column 'max_allowed_packet' in 'field list'
+connection default;
SET @@global.max_allowed_packet = @start_global_value;
SELECT @@global.max_allowed_packet;
@@global.max_allowed_packet
diff --git a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
index 1a848cbae4b..c31a64b3a94 100644
--- a/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
+++ b/mysql-test/suite/sys_vars/r/max_allowed_packet_func.result
@@ -32,9 +32,12 @@ SELECT @@global.max_allowed_packet;
SELECT @@global.net_buffer_length;
@@global.net_buffer_length
1024
-## Creating new connection test_con1 ##
+connect test_con1,localhost,root,,;
+connection test_con1;
## Inserting and fetching data of length greater than 1024 ##
INSERT into t1(name) values("aaassssssssddddddddffffffgggggggg, askdlfjalsdkjfalksdjflaksdjfalkjdflaksjdflakjdflajsflajflajdfalsjfdlajfladjslfajdflajdsflajsflakjsdfla;kjflsdjkf;aljfa;lkdsfjla;sjlkajffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllakjsdffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa;;;;;;;;;;;;;;;;;;;;;;;;;;;dsklfjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjkljffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdkskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk");
+disconnect test_con1;
+connection default;
drop table t1;
SET @@global.max_allowed_packet= @start_max_allowed_packet;
SET @@global.net_buffer_length= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/max_join_size_func.result b/mysql-test/suite/sys_vars/r/max_join_size_func.result
index 0bf4f507b0c..cacc918ea02 100644
--- a/mysql-test/suite/sys_vars/r/max_join_size_func.result
+++ b/mysql-test/suite/sys_vars/r/max_join_size_func.result
@@ -36,7 +36,8 @@ id name id name
4 Record_4 4 Record_4_1
5 Record_5 5 Record_5_1
'#--------------------FN_DYNVARS_079_02-------------------------#'
-## Creating new connection test_con1 ##
+connect test_con1, localhost, root,,;
+connection test_con1;
## Setting value of max_join_size ##
SET @@session.max_join_size=8;
## Since total joins are more than max_join_size value so error will occur ##
@@ -45,7 +46,8 @@ ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your W
'#--------------------FN_DYNVARS_079_03-------------------------#'
## Setting global value of variable ##
SET @@global.max_join_size=8;
-## Creating and switching to new connection test_con2 ##
+connect test_con2, localhost, root,,;
+connection test_con2;
## Verifying value of max_join_size ##
SELECT @@global.max_join_size;
@@global.max_join_size
@@ -58,4 +60,5 @@ Drop table t1, t2;
## Restoring values ##
SET @@global.max_join_size = DEFAULT;
SET @@session.max_join_size = DEFAULT;
-## Dropping connections ##
+disconnect test_con1;
+disconnect test_con2;
diff --git a/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result b/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
index 7b56de4857e..1798bd5d6e0 100644
--- a/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
+++ b/mysql-test/suite/sys_vars/r/max_seeks_for_key_func.result
@@ -5,6 +5,8 @@ b CHAR(20)
);
SET @start_value= @@global.max_seeks_for_key;
'#--------------------FN_DYNVARS_084_01-------------------------#'
+CONNECT test_con1,localhost,root,,;
+connection test_con1;
SELECT @@global.max_seeks_for_key = 10;
@@global.max_seeks_for_key = 10
0
@@ -31,6 +33,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
1 SIMPLE t2 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join)
'#--------------------FN_DYNVARS_084_02-------------------------#'
+CONNECT test_con2,localhost,root,,;
+connection test_con2;
SELECT @@global.max_seeks_for_key = 10;
@@global.max_seeks_for_key = 10
0
@@ -73,5 +77,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 17
1 SIMPLE t2 ALL NULL NULL NULL NULL 17 Using where; Using join buffer (flat, BNL join)
SET MAX_SEEKS_FOR_KEY=DEFAULT;
+connection default;
+disconnect test_con1;
+disconnect test_con2;
DROP TABLE t1;
SET @@global.max_seeks_for_key= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/max_sort_length_func.result b/mysql-test/suite/sys_vars/r/max_sort_length_func.result
index 9254f1fadd7..36f5518287a 100644
--- a/mysql-test/suite/sys_vars/r/max_sort_length_func.result
+++ b/mysql-test/suite/sys_vars/r/max_sort_length_func.result
@@ -18,8 +18,8 @@ id INT AUTO_INCREMENT PRIMARY KEY,
c TEXT(30)
);
'#--------------------FN_DYNVARS_098_01-------------------------#'
-** Connecting test_con1 using username 'root' **
-** Connection test_con1 **
+connect test_con1,localhost,root,,;
+connection test_con1;
SELECT @@global.max_sort_length = 10;
@@global.max_sort_length = 10
0
@@ -62,8 +62,8 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
** Results should be sorted **
'#--------------------FN_DYNVARS_098_02-------------------------#'
-** Connecting test_con2 using username 'root' **
-** Connection test_con2 **
+connect test_con2,localhost,root,,;
+connection test_con2;
SET @@global.max_sort_length = 30;
SELECT @@global.max_sort_length;
@@global.max_sort_length
@@ -291,8 +291,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxrx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxsy
xxxxxxxxxxxxxxxxxxxxxxxxxxxxgw
** Results should not be sorted **
-** Connection default **
-** Disconnecting test_con1, test_con2 **
+connection default;
+disconnect test_con1;
+disconnect test_con2;
SET @@SESSION.max_sort_length = @session_max_sort_length;
DROP TABLE IF EXISTS t;
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result
index 59d88440f53..a45f9118819 100644
--- a/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result
+++ b/mysql-test/suite/sys_vars/r/max_sp_recursion_depth_func.result
@@ -1,7 +1,7 @@
SET @session_max_recursion_depth = @@SESSION.max_sp_recursion_depth;
'#--------------------FN_DYNVARS_099_01-------------------------#'
-** Connecting test_con1 using username 'root' **
-** Connection test_con1 **
+CONNECT test_con1,localhost,root,,;
+connection test_con1;
SET @@session.max_sp_recursion_depth = 10;
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
@@ -51,8 +51,8 @@ var1 var2
var1 var2
0 8
'#--------------------FN_DYNVARS_099_02-------------------------#'
-** Connecting test_con2 using username 'root' **
-** Connection test_con2 **
+CONNECT test_con2,localhost,root,,;
+connection test_con2;
SET @@session.max_sp_recursion_depth = 4;
SELECT @@session.max_sp_recursion_depth;
@@session.max_sp_recursion_depth
@@ -155,8 +155,9 @@ var1 var2
var1 var2
4 8
ERROR HY000: Recursive limit 4 (as set by the max_sp_recursion_depth variable) was exceeded for routine sp_addRecords3
-** Connection default **
-** Disconnecting test_con1, test_con2 **
+connection default;
+disconnect test_con1;
+disconnect test_con2;
DROP PROCEDURE IF EXISTS sp_addRecords;
DROP PROCEDURE IF EXISTS sp_addRecords1;
DROP PROCEDURE IF EXISTS sp_addRecords2;
diff --git a/mysql-test/suite/sys_vars/r/max_user_connections_func.result b/mysql-test/suite/sys_vars/r/max_user_connections_func.result
index 4a71bf1b3f9..aec9d38f6f7 100644
--- a/mysql-test/suite/sys_vars/r/max_user_connections_func.result
+++ b/mysql-test/suite/sys_vars/r/max_user_connections_func.result
@@ -5,18 +5,20 @@ Set Global max_user_connections=2;
CREATE USER test@localhost;
GRANT USAGE on *.* TO test@localhost;
'#--------------------FN_DYNVARS_114_01-------------------------#'
-** Connecting conn1 using username 'test' **
-** Connecting conn2 using username 'test' **
-** Connecting conn3 using username 'test' **
+CONNECT conn1,localhost,test,,;
+CONNECT conn2,localhost,test,,;
ERROR 42000: User test already has more than 'max_user_connections' active connections
Expected error "too many connections"
-** Disconnecting conn1 **
+disconnect conn1;
** Poll till disconnected conn1 disappears from processlist
'#--------------------FN_DYNVARS_114_02-------------------------#'
+connection default;
Set Global max_user_connections=3;
-** Connecting conn5 using username 'test' **
-** Connecting conn6 using username 'test' **
-** Connection default **
-** Disconnecting conn5, conn6 **
+CONNECT conn5,localhost,test,,;
+CONNECT conn6,localhost,test,,;
+connection default;
+disconnect conn2;
+disconnect conn5;
+disconnect conn6;
drop user test@localhost;
SET @@global.max_user_connections = @default_max_user_connections;
diff --git a/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
index 58bb0d0b52b..d876fa8945c 100644
--- a/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
+++ b/mysql-test/suite/sys_vars/r/myisam_data_pointer_size_func.result
@@ -2,19 +2,20 @@ call mtr.add_suppression("The table 't1' is full");
'#--------------------FN_DYNVARS_093_01-------------------------#'
SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
2
SET @@global.myisam_data_pointer_size = 3;
-'connect (con2,localhost,root,,,,)'
-'connection con2'
+connect con2,localhost,root,,,,;
+connection con2;
SELECT @@global.myisam_data_pointer_size;
@@global.myisam_data_pointer_size
3
+disconnect con2;
'#--------------------FN_DYNVARS_093_02-------------------------#'
-'connection con1'
+connection con1;
DROP PROCEDURE IF EXISTS sp_addRec;
DROP TABLE IF EXISTS t1;
CREATE PROCEDURE sp_addRec(IN count INT)
@@ -42,4 +43,5 @@ count(*)
65536
DROP PROCEDURE sp_addRec;
DROP TABLE t1;
+connection default;
SET @@global.myisam_data_pointer_size= @start_value;
diff --git a/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result b/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
index 978c8c2d5b2..cae0e68765b 100644
--- a/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
+++ b/mysql-test/suite/sys_vars/r/myisam_stats_method_func.result
@@ -1,16 +1,17 @@
'#--------------------FN_DYNVARS_097_01-------------------------#'
SET @start_value = @@global.myisam_stats_method;
SET @@global.myisam_stats_method = nulls_equal;
-'connect (con1,localhost,root,,,,)'
-'connection con1'
+connect con1,localhost,root,,,,;
+connection con1;
SELECT @@global.myisam_stats_method;
@@global.myisam_stats_method
NULLS_EQUAL
SELECT @@session.myisam_stats_method;
@@session.myisam_stats_method
NULLS_EQUAL
+disconnect con1;
'#--------------------FN_DYNVARS_097_02-------------------------#'
-'connection default'
+connection default;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT, KEY (a));
INSERT INTO t1 VALUES (0),(1),(2),(3),(4);
diff --git a/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result b/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
index 178ada08d65..6315dce2cef 100644
--- a/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
+++ b/mysql-test/suite/sys_vars/r/net_buffer_length_basic.result
@@ -1,5 +1,7 @@
SET @start_global_value = @@global.net_buffer_length;
SET @@global.net_buffer_length = DEFAULT;
+connect con1,localhost,root,,;
+connection con1;
'#--------------------FN_DYNVARS_109_01-------------------------#'
SET @@global.net_buffer_length = 10000;
Warnings:
@@ -135,4 +137,5 @@ SELECT session.net_buffer_length;
ERROR 42S02: Unknown table 'session' in field list
SELECT net_buffer_length = @@session.net_buffer_length;
ERROR 42S22: Unknown column 'net_buffer_length' in 'field list'
+connection default;
SET @@global.net_buffer_length = @start_global_value;
diff --git a/mysql-test/suite/sys_vars/r/old_passwords_func.result b/mysql-test/suite/sys_vars/r/old_passwords_func.result
index eebee9f4852..6bd060932a8 100644
--- a/mysql-test/suite/sys_vars/r/old_passwords_func.result
+++ b/mysql-test/suite/sys_vars/r/old_passwords_func.result
@@ -2,51 +2,53 @@ SET @global_old_passwords = @@GLOBAL.old_passwords;
SET @session_old_passwords = @@SESSION.old_passwords;
SET @global_secure_auth = @@GLOBAL.secure_auth;
'#------------------------FN_DYNVARS_115_01---------------------------#'
-** Connection default **
+connection default;
CREATE USER 'userNewPass1'@'localhost' IDENTIFIED BY 'pass1';
CREATE USER 'userNewPass2'@'localhost' IDENTIFIED BY 'pass2';
SET GLOBAL old_passwords = TRUE;
SET SESSION old_passwords = TRUE;
CREATE USER 'userOldPass'@'localhost' IDENTIFIED BY 'pass3';
SET GLOBAL secure_auth = FALSE;
-** Connecting con1 using username 'userNewPass1' **
+connect con1,localhost,userNewPass1,pass1,;
SELECT CURRENT_USER();
CURRENT_USER()
userNewPass1@localhost
userNewPass1@localhost Expected
-** Connecting con2 using username 'userNewPass2' **
+connect con2,localhost,userNewPass2,pass2,;
SELECT CURRENT_USER();
CURRENT_USER()
userNewPass2@localhost
userNewPass2@localhost Expected
-** Connecting con3 using username 'userOldPass' **
+connect con3,localhost,userOldPass,pass3,;
SELECT CURRENT_USER();
CURRENT_USER()
userOldPass@localhost
userOldPass@localhost Expected
-** Connection default **
-** Disconnecting con1, con2, con3 **
+connection default;
+disconnect con1;
+disconnect con2;
+disconnect con3;
'#------------------------FN_DYNVARS_115_02---------------------------#'
SET GLOBAL secure_auth = TRUE;
-** Connecting con1 using username 'userNewPass1' **
+connect con1,localhost,userNewPass1,pass1,;
SELECT CURRENT_USER();
CURRENT_USER()
userNewPass1@localhost
userNewPass1@localhost Expected
-** Connecting con2 using username 'userNewPass2' **
+connect con2,localhost,userNewPass2,pass2,;
SELECT CURRENT_USER();
CURRENT_USER()
userNewPass2@localhost
userNewPass2@localhost Expected
-** Connecting con3 using username 'userOldPass' **
ERROR HY000: Server is running in --secure-auth mode, but 'userOldPass'@'localhost' has a password in the old format; please change the password to the new format
Expected Error 'Server is running in secure auth mode'
SELECT CURRENT_USER();
CURRENT_USER()
userNewPass2@localhost
userNewPass2@localhost Expected
-** Connection default **
-** Disconnecting con1, con2 **
+connection default;
+disconnect con1;
+disconnect con2;
DROP USER 'userNewPass1'@'localhost';
DROP USER 'userNewPass2'@'localhost';
DROP USER 'userOldPass'@'localhost';
diff --git a/mysql-test/suite/sys_vars/r/query_cache_type_func.result b/mysql-test/suite/sys_vars/r/query_cache_type_func.result
index c016f05e119..941e7d41886 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_type_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_type_func.result
@@ -1,7 +1,7 @@
** Setup **
-** Connecting to con0 using root **
-** Connection con0 **
+connect con0,localhost,root,,;
+connection con0;
SET @start_global_value = @@GLOBAL.query_cache_type;
SET @start_session_value = @@SESSION.query_cache_type;
SET @start_query_cache_size= @@global.query_cache_size;
@@ -191,24 +191,24 @@ Qcache_queries_in_cache 1
** TESTING GLOBAL SCOPE **
'#--------------------FN_DYNVARS_135_10-------------------------#'
SET @@GLOBAL.query_cache_type = OFF;
-** Connecting con1 using root **
-** Connection con1 **
+connect con1,localhost,root,,;
+connection con1;
SELECT @@query_cache_type;
@@query_cache_type
OFF
OFF Expected
'#--------------------FN_DYNVARS_135_11-------------------------#'
SET @@GLOBAL.query_cache_type = DEMAND;
-** Connecting con2 using root **
-** Connection con2 **
+connect con2,localhost,root,,;
+connection con2;
SELECT @@query_cache_type;
@@query_cache_type
DEMAND
DEMAND Expected
'#--------------------FN_DYNVARS_135_12-------------------------#'
SET @@GLOBAL.query_cache_type = ON;
-** Connecting con3 using root **
-** Connection con3 **
+connect con3,localhost,root,,;
+connection con3;
SELECT @@query_cache_type;
@@query_cache_type
ON
@@ -216,11 +216,13 @@ ON Expected
** Cleanup **
-Disconnecting con1,con2,con3
-** Connection con0 **
+disconnect con1;
+disconnect con2;
+disconnect con3;
+connection con0;
SET @@GLOBAL.query_cache_type = @start_global_value;
SET @@SESSION.query_cache_type = @start_session_value;
SET GLOBAL query_cache_size = @start_query_cache_size;
DROP TABLE t1;
DROP PROCEDURE testProcHit;
-Disconnecting con0
+disconnect con0;
diff --git a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
index 5868bd597eb..2c553fdc010 100644
--- a/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
+++ b/mysql-test/suite/sys_vars/r/query_cache_wlock_invalidate_func.result
@@ -1,15 +1,17 @@
** Setup **
-** Connecting con0 using root **
-** Connecting con1 using root **
-** Connection con0 **
+connect con0,localhost,root,,;
+connect con1, localhost, root,,;
+connection con0;
SET @start_global_value = @@GLOBAL.query_cache_wlock_invalidate;
SET @start_session_value = @@SESSION.query_cache_wlock_invalidate;
SET @old_cache_size = @@GLOBAL.query_cache_size;
SET @old_cache_type = @@GLOBAL.query_cache_type;
SET GLOBAL query_cache_type= ON;
SET LOCAL query_cache_type= ON;
+connection con1;
SET LOCAL query_cache_type= ON;
+connection con0;
CREATE TABLE t1(id int, value varchar(10));
INSERT INTO t1 VALUES(1, 'val1');
INSERT INTO t1 VALUES(2, 'val2');
@@ -20,9 +22,9 @@ SET GLOBAL query_cache_size = 0;
SET GLOBAL query_cache_size = 131072;
SET GLOBAL query_cache_type = ON;
Testing for value ON
-** Connection con0 **
+connection con0;
SET SESSION query_cache_wlock_invalidate = ON;
-** Connection con1 **
+connection con1;
SET SESSION query_cache_wlock_invalidate = ON;
'#----------------------------FN_DYNVARS_136_01--------------#'
Testing for cache invalidation
@@ -44,30 +46,30 @@ Qcache_queries_in_cache 0
'#----------------------------FN_DYNVARS_136_02-----------------------#'
SELECT * FROM t1;
SHOW STATUS LIKE 'Qcache_queries_in_cache';
-** Connection con1 **
+connection con1;
SELECT * FROM t1;
id value
1 val1
2 val2
3 val3
-** Connection con0 **
+connection con0;
LOCK TABLE t1 WRITE;
-** Connection con1 **
+connection con1;
** Asynchronous Execution **
SELECT * FROM t1;
-** Connection con0 **
+connection con0;
wait until table is locked
UNLOCK TABLES;
-** Connection con1 **
+connection con1;
** Asynchronous Result **
id value
1 val1
2 val2
3 val3
Testing for value OFF
-** Connection con0 **
+connection con0;
SET SESSION query_cache_wlock_invalidate = OFF;
-** Connection con1 **
+connection con1;
SET SESSION query_cache_wlock_invalidate = OFF;
'#----------------------------FN_DYNVARS_136_03------------------#'
Testing for cache invalidation
@@ -96,15 +98,15 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
1 Expected
-** Connection con1 **
+connection con1;
SELECT * FROM t1;
id value
1 val1
2 val2
3 val3
-** Connection con0 **
+connection con0;
LOCK TABLE t1 WRITE;
-** Connection con1 **
+connection con1;
** Should not be blocked **
SELECT * FROM t1;
id value
@@ -121,31 +123,31 @@ id value
1 val1
2 val2
3 val3
-** Connection con0 **
+connection con0;
UNLOCK TABLES;
-** Connection con1 **
+connection con1;
'#----------------------------FN_DYNVARS_136_05------------------------#'
SET GLOBAL query_cache_wlock_invalidate = OFF;
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.query_cache_wlock_invalidate;
@@SESSION.query_cache_wlock_invalidate
0
Expected Value : 0 / OFF;
SET SESSION query_cache_wlock_invalidate = ON;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.query_cache_wlock_invalidate;
@@SESSION.query_cache_wlock_invalidate
0
Expected Value : 0 / OFF;
SET SESSION query_cache_wlock_invalidate = OFF;
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.query_cache_wlock_invalidate;
@@SESSION.query_cache_wlock_invalidate
1
Expected Value : 1 / ON;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.query_cache_wlock_invalidate;
@@SESSION.query_cache_wlock_invalidate
0
@@ -154,15 +156,17 @@ SELECT @@GLOBAL.query_cache_wlock_invalidate;
@@GLOBAL.query_cache_wlock_invalidate
0
Expected Value : 0 / OFF;
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
CLEANUP
-** Connection con0 **
+connection con0;
SET @@GLOBAL.query_cache_wlock_invalidate = @start_global_value;
SET @@SESSION.query_cache_wlock_invalidate = @start_session_value ;
SET @@GLOBAL.query_cache_size = @old_cache_size;
SET @@GLOBAL.query_cache_type = @old_cache_type;
-** Connection default **
-Disconnecting Connections con0, con1
+connection default;
+disconnect con0;
+disconnect con1;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/query_prealloc_size_func.result b/mysql-test/suite/sys_vars/r/query_prealloc_size_func.result
index 4f7a8d18f32..d9156bad438 100644
--- a/mysql-test/suite/sys_vars/r/query_prealloc_size_func.result
+++ b/mysql-test/suite/sys_vars/r/query_prealloc_size_func.result
@@ -15,20 +15,26 @@ id val
SET SESSION query_prealloc_size = 8192;
'#----------------------------FN_DYNVARS_137_05-----------------#'
SET GLOBAL query_prealloc_size = 8192;
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.query_prealloc_size;
@@SESSION.query_prealloc_size
8192
Expected Value : 8192;
SET SESSION query_prealloc_size = 16384;
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.query_prealloc_size;
@@SESSION.query_prealloc_size
8192
Expected Value : 8192;
SET SESSION query_prealloc_size = 8192;
+connection con_int1;
SELECT @@SESSION.query_prealloc_size;
@@SESSION.query_prealloc_size
16384
Expected Value : 16384;
+connection con_int2;
SELECT @@SESSION.query_prealloc_size;
@@SESSION.query_prealloc_size
8192
@@ -37,5 +43,8 @@ SELECT @@GLOBAL.query_prealloc_size;
@@GLOBAL.query_prealloc_size
8192
Expected Value : 8192;
+connection default;
+disconnect con_int1;
+disconnect con_int2;
DROP TABLE t1;
SET @@global.query_prealloc_size = @start_value;
diff --git a/mysql-test/suite/sys_vars/r/read_only_func.result b/mysql-test/suite/sys_vars/r/read_only_func.result
index 540a2a13c50..ae63e39c153 100644
--- a/mysql-test/suite/sys_vars/r/read_only_func.result
+++ b/mysql-test/suite/sys_vars/r/read_only_func.result
@@ -18,7 +18,7 @@ id name
'#--------------------FN_DYNVARS_140_02-------------------------#'
** Creating new user with out super privilege**
CREATE user sameea;
-** Connecting connn using username 'sameea' **
+CONNECT connn,localhost,sameea,,;
SET Global read_ONLY=ON;
ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation
CREATE TABLE t2
@@ -36,9 +36,9 @@ Got one of the listed errors
'#--------------------FN_DYNVARS_140_03-------------------------#'
CREATE TEMPORARY TABLE t3(a int);
'#--------------------FN_DYNVARS_140_04-------------------------#'
-** Connection default **
+connection default;
SET Global read_only=OFF;
-** Connection connn **
+connection connn;
CREATE TABLE t2
(
id INT NOT NULL auto_increment,
@@ -48,8 +48,8 @@ name BLOB
updating values
INSERT into t2(name) values("aaassssssssdddddddd");
UPDATE t2 SET name="samia" where id=1;
-** Connection default **
-** Disconnecting connn **
+connection default;
+disconnect connn;
DROP USER sameea;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result b/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
index 10ad3711949..33ade60e5cb 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_basename_basic.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection slave;
select @@global.relay_log_basename;
@@global.relay_log_basename
REPLACED
diff --git a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
index 6d8eec9eb30..b56dd85e7fb 100644
--- a/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
+++ b/mysql-test/suite/sys_vars/r/relay_log_index_basic.result
@@ -21,6 +21,7 @@ set global relay_log_index=1;
ERROR HY000: Variable 'relay_log_index' is a read only variable
set session relay_log_index=1;
ERROR HY000: Variable 'relay_log_index' is a read only variable
+connection slave;
select @@global.relay_log_index;
@@global.relay_log_index
REPLACED
diff --git a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
index 691f6f10e02..ec3b39124fe 100644
--- a/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
+++ b/mysql-test/suite/sys_vars/r/rpl_init_slave_func.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-connection slave
+connection slave;
SET @start_max_connections= @@global.max_connections;
SET @start_init_slave= @@global.init_slave;
SET NAMES utf8;
diff --git a/mysql-test/suite/sys_vars/r/secure_auth_func.result b/mysql-test/suite/sys_vars/r/secure_auth_func.result
index f7e24e3f043..97d22facd9d 100644
--- a/mysql-test/suite/sys_vars/r/secure_auth_func.result
+++ b/mysql-test/suite/sys_vars/r/secure_auth_func.result
@@ -9,25 +9,27 @@ SELECT @@GLOBAL.secure_auth;
'#--------------------FN_DYNVARS_144_02-------------------------#'
SET GLOBAL secure_auth = OFF;
CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'newpass';
-** Connecting con_user1 using testUser **
-** Connection default**
+connect con_user1,localhost,testUser,newpass,;
+connection default;
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
-** Connecting con_user2 using testUser **
-** Connection default**
+connect con_user2,localhost,testUser,newpass,;
+connection default;
'#--------------------FN_DYNVARS_144_03-------------------------#'
SET GLOBAL secure_auth = ON;
SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass');
-** Connecting con_user3 using testUser **
-** Connection default **
+connect con_user3,localhost,testUser,newpass,;
+connection default;
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
-** Connecting con_user4 using testUser **
ERROR HY000: Server is running in --secure-auth mode, but 'testUser'@'localhost' has a password in the old format; please change the password to the new format
Expected error "Server is in secure auth mode"
-** Connection default**
+connection default;
SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass');
-** Connecting con_user4 using testUser **
-** Connection default **
+connect con_user4,localhost,testUser,newpass,;
+connection default;
SET GLOBAL secure_auth = @old_secure_auth;
-Disconnecting Connections con_user1, con_user2, con_user3, con_user4
+disconnect con_user1;
+disconnect con_user2;
+disconnect con_user3;
+disconnect con_user4;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM 'testUser'@'localhost';
DROP USER 'testUser'@'localhost';
diff --git a/mysql-test/suite/sys_vars/r/slow_launch_time_func.result b/mysql-test/suite/sys_vars/r/slow_launch_time_func.result
index 7665166ff29..0fe05d99dbd 100644
--- a/mysql-test/suite/sys_vars/r/slow_launch_time_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_launch_time_func.result
@@ -1,17 +1,19 @@
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
-** Connection default **
+connection default;
'#--------------------FN_DYNVARS_124_01-------------------------#'
SET @@GLOBAL.slow_launch_time=0;
SELECT @@GLOBAL.slow_launch_time;
@@GLOBAL.slow_launch_time
0
-** Connecting conn1 using username 'root' **
-** Switch to connection default and disconnect conn1 **
+CONNECT conn1,localhost,root,,;
+connection default;
+disconnect conn1;
'#--------------------FN_DYNVARS_124_02-------------------------#'
SET @@GLOBAL.slow_launch_time= 1000;
SELECT @@GLOBAL.slow_launch_time;
@@GLOBAL.slow_launch_time
1000
-** Connecting conn2 using username 'root' **
-** Switch to connection default and disconnect conn2 **
+CONNECT conn2,localhost,root,,;
+connection default;
+disconnect conn2;
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
diff --git a/mysql-test/suite/sys_vars/r/slow_query_log_func.result b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
index b431f963239..cccf10a15eb 100644
--- a/mysql-test/suite/sys_vars/r/slow_query_log_func.result
+++ b/mysql-test/suite/sys_vars/r/slow_query_log_func.result
@@ -48,6 +48,8 @@ count(*) > 0
DROP PROCEDURE p_test;
Bug53191 Lock_time in slow log is negative when logging stored routines
TRUNCATE mysql.slow_log;
+connect con2,localhost,root,,;
+connection default;
CREATE TABLE t1 (c0 INT PRIMARY KEY AUTO_INCREMENT, c1 TIMESTAMP, c2 TIMESTAMP);
CREATE FUNCTION f_slow_now() RETURNS TIMESTAMP
BEGIN
@@ -100,12 +102,14 @@ INSERT INTO t1 VALUES (1);
SELECT COUNT(*) FROM t1 WHERE c1= 1;
UPDATE t1 SET c1=c1*2;
END|
-Connection 2
+connection con2;
LOCK TABLE t1 WRITE;
-Back to default connection
+connection default;
CALL p1();
Wait three seconds and unlock the table
+connection con2;
UNLOCK TABLES;
+connection default;
COUNT(*)
1
Slow log:
@@ -117,6 +121,7 @@ count(*) > 0
SELECT count(*) FROM mysql.slow_log WHERE lock_time > 10;
count(*)
0
+disconnect con2;
DROP TABLE t1;
DROP PROCEDURE p1;
SET @@global.log_output = @global_log_output;
diff --git a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
index bd534140172..609401c771c 100644
--- a/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_big_selects_func.result
@@ -41,32 +41,33 @@ aa2 bb aa2 bb
aa3 bb aa3 bb
This should work
'#--------------------FN_DYNVARS_154_03-------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_big_selects;
@@SESSION.sql_big_selects
1
1 Expected
SET SESSION sql_big_selects = 0;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_big_selects;
@@SESSION.sql_big_selects
1
1 Expected
SET SESSION sql_big_selects = 1;
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_big_selects;
@@SESSION.sql_big_selects
0
0 Expected
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_big_selects;
@@SESSION.sql_big_selects
1
1 Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET @@SESSION.sql_big_selects = @session_sql_big_selects;
SET @@SESSION.max_join_size = @session_max_join_size;
SET @@GLOBAL.max_join_size = @global_max_join_size;
diff --git a/mysql-test/suite/sys_vars/r/sql_buffer_result_func.result b/mysql-test/suite/sys_vars/r/sql_buffer_result_func.result
index 38d7f7ecc0a..a3b6d62d069 100644
--- a/mysql-test/suite/sys_vars/r/sql_buffer_result_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_buffer_result_func.result
@@ -53,32 +53,33 @@ Variable_name Value
Created_tmp_tables 2
Expected value : 2.
'#--------------------FN_DYNVARS_156_03-------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_buffer_result;
@@SESSION.sql_buffer_result
0
0 / FALSE Expected
SET SESSION sql_buffer_result = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_buffer_result;
@@SESSION.sql_buffer_result
0
0 / FALSE Expected
SET SESSION sql_buffer_result = TRUE;
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_buffer_result;
@@SESSION.sql_buffer_result
0
0 / FALSE Expected
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_buffer_result;
@@SESSION.sql_buffer_result
1
1 / TRUE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
** Cleanup **
SET @@sql_buffer_result = @original_sql_buffer_result;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/sql_log_off_func.result b/mysql-test/suite/sys_vars/r/sql_log_off_func.result
index e51860534f1..c59032e21b2 100644
--- a/mysql-test/suite/sys_vars/r/sql_log_off_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_log_off_func.result
@@ -21,31 +21,32 @@ SELECT argument FROM mysql.general_log WHERE argument = 'UPDATE t1 SET a = \'aa1
argument
UPDATE t1 SET a = 'aa1' WHERE a = 'aa1-updated'
'#--------------------FN_DYNVARS_158_03--------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_log_off;
@@SESSION.sql_log_off
0
0 / FALSE Expected
SET SESSION sql_log_off = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_log_off;
@@SESSION.sql_log_off
0
0 / FALSE Expected
SET SESSION sql_log_off = TRUE;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_log_off;
@@SESSION.sql_log_off
1
1 / TRUE Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_log_off;
@@SESSION.sql_log_off
0
0 / FALSE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET SESSION sql_log_off = @default_sql_log_off;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
index fe76c2c4b96..04af87ae369 100644
--- a/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_low_priority_updates_func.result
@@ -1,18 +1,18 @@
** Setup **
-** Connecting con0 using root **
-** Connecting con1 using root **
-** Connection default **
+connect con0,localhost,root,,;
+connect con1,localhost,root,,;
+connection default;
SET @global_low_priority_updates = @@GLOBAL.low_priority_updates;
SET @session_low_priority_updates = @@SESSION.low_priority_updates;
CREATE TABLE t1 (a varchar(100));
create view v1 as select * from t1;
'#--------------------FN_DYNVARS_160_01-------------------------#'
-** Connection con0 **
+connection con0;
SET SESSION low_priority_updates = ON;
-** Connection con1 **
+connection con1;
SET SESSION low_priority_updates = ON;
-** Connection default **
+connection default;
SET SESSION low_priority_updates = ON;
INSERT INTO t1 VALUES('1');
INSERT INTO t1 VALUES('2');
@@ -21,17 +21,17 @@ INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE;
-** Connection con1 **
+connection con1;
** Asynchronous Execution **
UPDATE t1 SET a = CONCAT(a,"-updated");|
-** Connection con0 **
+connection con0;
** Asynchronous Execution **
LOCK TABLE t1 READ;
SELECT * FROM t1;
UNLOCK TABLES;|
-** Connection default **
+connection default;
UNLOCK TABLES;
-** Connection con0 **
+connection con0;
** Asynchronous Result **
a
1
@@ -41,14 +41,14 @@ a
5
6
Expected values of a without -updated;
-** Connection default **
+connection default;
DELETE FROM t1;
'#--------------------FN_DYNVARS_160_02-------------------------#'
-** Connection con0 **
+connection con0;
SET SESSION low_priority_updates = OFF;
-** Connection con1 **
+connection con1;
SET SESSION low_priority_updates = OFF;
-** Connection default**
+connection default;
SET SESSION low_priority_updates = OFF;
INSERT INTO t1 VALUES('1');
INSERT INTO t1 VALUES('2');
@@ -57,17 +57,17 @@ INSERT INTO t1 VALUES('4');
INSERT INTO t1 VALUES('5');
INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE;
-** Connection con1 **
+connection con1;
** Asynchronous Execution **
UPDATE t1 SET a = CONCAT(a,"-updated");|
-** Connection con0 **
+connection con0;
** Asynchronous Execution **
LOCK TABLE t1 READ;
SELECT * FROM t1;
UNLOCK TABLES;|
-** Connection default **
+connection default;
UNLOCK TABLES;
-** Connection con0 **
+connection con0;
** Asynchronous Result **
a
1-updated
@@ -77,37 +77,39 @@ a
5-updated
6-updated
Expected values of a with -updated;
-** Connection default**
+connection default;
DELETE FROM t1;
'#--------------------FN_DYNVARS_160_03-------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
0
1 / TRUE Expected
SET SESSION low_priority_updates = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
0
1 / TRUE Expected
SET SESSION low_priority_updates = TRUE;
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
0
0 / FALSE Expected
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.low_priority_updates;
@@SESSION.low_priority_updates
1
1 / TRUE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
-** Connection default **
-Disconnecting Connections con0, con1
+connection default;
+disconnect con_int1;
+disconnect con_int2;
+connection default;
+disconnect con0;
+disconnect con1;
drop view v1;
DROP TABLE t1;
SET @@GLOBAL.low_priority_updates = @global_low_priority_updates;
diff --git a/mysql-test/suite/sys_vars/r/sql_mode_func.result b/mysql-test/suite/sys_vars/r/sql_mode_func.result
index bb9ffc0717e..7a449950758 100644
--- a/mysql-test/suite/sys_vars/r/sql_mode_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_mode_func.result
@@ -69,26 +69,26 @@ a b
Should return no rows in columns a,b;
'#-------------------FN_DYNVARS_153_04-------------------------#'
SET GLOBAL sql_mode = '';
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_mode;
@@SESSION.sql_mode
'' Expected
SET SESSION sql_mode = 'TRADITIONAL';
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_mode;
@@SESSION.sql_mode
'' Expected
SET SESSION sql_mode = 'ANSI';
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_mode;
@@SESSION.sql_mode
REAL_AS_FLOAT,PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,ANSI
'REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ANSI' Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_mode;
@@SESSION.sql_mode
STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
@@ -97,8 +97,9 @@ SELECT @@GLOBAL.sql_mode;
@@GLOBAL.sql_mode
'' Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET SESSION sql_mode = @sql_mode_session;
SET GLOBAL sql_mode = @sql_mode_global;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/sql_notes_func.result b/mysql-test/suite/sys_vars/r/sql_notes_func.result
index 28510f027da..51da0ea59e4 100644
--- a/mysql-test/suite/sys_vars/r/sql_notes_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_notes_func.result
@@ -34,31 +34,32 @@ SELECT @@warning_count;
0
0 Expected
'#------------------FN_DYNVARS_162_03---------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_notes;
@@SESSION.sql_notes
1
1 / TRUE Expected
SET SESSION sql_notes = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_notes;
@@SESSION.sql_notes
1
1 / TRUE Expected
SET SESSION sql_notes = TRUE;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_notes;
@@SESSION.sql_notes
1
1 / TRUE Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_notes;
@@SESSION.sql_notes
0
0 / FALSE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET SESSION sql_notes = @default_sql_notes;
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result b/mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result
index 9c1e751eef2..00c1b8e4c04 100644
--- a/mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_quote_show_create_func.result
@@ -29,32 +29,33 @@ t1 CREATE TEMPORARY TABLE t1 (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
EXPECTING identifiers a, b, t1 NOT TO BE quoted like 'a','b','t1'
'#----------------------------FN_DYNVARS_163_03--------------------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_quote_show_create;
@@SESSION.sql_quote_show_create
1
1 / TRUE Expected
SET SESSION sql_quote_show_create = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_quote_show_create;
@@SESSION.sql_quote_show_create
1
1 / TRUE Expected
SET SESSION sql_quote_show_create = TRUE;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_quote_show_create;
@@SESSION.sql_quote_show_create
1
1 / TRUE Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_quote_show_create;
@@SESSION.sql_quote_show_create
0
0 / FALSE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
Cleanup
SET @@sql_quote_show_create = @default_sql_quote_show_create;
diff --git a/mysql-test/suite/sys_vars/r/sql_safe_updates_func.result b/mysql-test/suite/sys_vars/r/sql_safe_updates_func.result
index cf8d613b683..a11e7de2fbf 100644
--- a/mysql-test/suite/sys_vars/r/sql_safe_updates_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_safe_updates_func.result
@@ -139,31 +139,32 @@ Bug#35392 Unexpected error occurs in this statement Can't change size of the fil
statement is remarked because the error is uncatchable by testing framework
DEALLOCATE PREPARE stmt;
'#----------------------------FN_DYNVARS_164_10--------------------------------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_safe_updates;
@@SESSION.sql_safe_updates
0
0 / FALSE Expected
SET SESSION sql_safe_updates = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_safe_updates;
@@SESSION.sql_safe_updates
0
0 / FALSE Expected
SET SESSION sql_safe_updates = TRUE;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_safe_updates;
@@SESSION.sql_safe_updates
1
1 / TRUE Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_safe_updates;
@@SESSION.sql_safe_updates
0
0 / FALSE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET SESSION sql_safe_updates = @default_sql_safe_updates;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/sql_select_limit_func.result b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result
index 5d4daf8367b..ad7582a5985 100644
--- a/mysql-test/suite/sys_vars/r/sql_select_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_select_limit_func.result
@@ -144,26 +144,26 @@ info: Records: 9 Duplicates: 0 Warnings: 0
Expecting Records: 9
'#-----------------------------FN_DYNVARS_165_06---------------------#'
SET GLOBAL sql_select_limit = 2;
-** Connecting con_int2 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_select_limit;
@@SESSION.sql_select_limit
2
2 Expected
SET SESSION sql_select_limit = 10;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_select_limit;
@@SESSION.sql_select_limit
2
2 Expected
SET SESSION sql_select_limit = 12;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_select_limit;
@@SESSION.sql_select_limit
12
12 Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_select_limit;
@@SESSION.sql_select_limit
10
@@ -172,8 +172,9 @@ SELECT @@GLOBAL.sql_select_limit;
@@GLOBAL.sql_select_limit
2
2 Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET @@SESSION.sql_select_limit = @session_sql_select_limit;
SET @@GLOBAL.sql_select_limit = @global_sql_select_limit;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/sql_warnings_func.result b/mysql-test/suite/sys_vars/r/sql_warnings_func.result
index 8b723cf8be3..91a4e8b28c0 100644
--- a/mysql-test/suite/sys_vars/r/sql_warnings_func.result
+++ b/mysql-test/suite/sys_vars/r/sql_warnings_func.result
@@ -19,31 +19,32 @@ INSERT INTO t1 VALUES('abcdef', 'val1');
affected rows: 1
info: Records: 1 Duplicates: 0 Warnings: 1
'#----------------------------FN_DYNVARS_167_04---------------#'
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.sql_warnings;
@@SESSION.sql_warnings
0
0 / FALSE Expected
SET SESSION sql_warnings = FALSE;
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.sql_warnings;
@@SESSION.sql_warnings
0
0 / FALSE Expected
SET SESSION sql_warnings = TRUE;
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.sql_warnings;
@@SESSION.sql_warnings
1
1 / TRUE Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.sql_warnings;
@@SESSION.sql_warnings
0
0 / FALSE Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
DROP TABLE t1;
SET @@sql_warnings = @default_sql_warnings;
diff --git a/mysql-test/suite/sys_vars/r/thread_cache_size_func.result b/mysql-test/suite/sys_vars/r/thread_cache_size_func.result
index f808e28a512..fed087b573f 100644
--- a/mysql-test/suite/sys_vars/r/thread_cache_size_func.result
+++ b/mysql-test/suite/sys_vars/r/thread_cache_size_func.result
@@ -6,25 +6,29 @@ SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
-** Connecting conn1 using username 'root' **
-** Connecting conn2 using username 'root' **
-** Connecting conn3 using username 'root' **
-** Connecting conn4 using username 'root' **
-** Connection default **
+CONNECT conn1,localhost,root,,;
+CONNECT conn2,localhost,root,,;
+CONNECT conn3,localhost,root,,;
+CONNECT conn4,localhost,root,,;
+connection default;
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 0
0 Expected
-** Disconnecting conn1,conn2,conn3,conn4 **
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+disconnect conn4;
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 3
3 Expected
SET @@GLOBAL.thread_cache_size= 1;
-** Connecting conn1 using username 'root' **
-** Connecting conn2 using username 'root' **
+CONNECT conn1,localhost,root,,;
+CONNECT conn2,localhost,root,,;
connection default;
-** Disconnecting conn1,conn2 **
+disconnect conn1;
+disconnect conn2;
SHOW STATUS LIKE 'Threads_cached';
Variable_name Value
Threads_cached 1
diff --git a/mysql-test/suite/sys_vars/r/time_zone_func.result b/mysql-test/suite/sys_vars/r/time_zone_func.result
index 684c1ec80f4..7949b600808 100644
--- a/mysql-test/suite/sys_vars/r/time_zone_func.result
+++ b/mysql-test/suite/sys_vars/r/time_zone_func.result
@@ -149,26 +149,26 @@ SET @@time_zone = '6';
ERROR HY000: Unknown or incorrect time zone: '6'
'#-----------------------------FN_DYNVARS_177_05---------------#'
SET GLOBAL time_zone = 'SYSTEM';
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.time_zone;
@@SESSION.time_zone
SYSTEM
SYSTEM Expected
SET SESSION time_zone = '+05:00';
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.time_zone;
@@SESSION.time_zone
SYSTEM
SYSTEM Expected
SET SESSION time_zone = '-10:00';
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.time_zone;
@@SESSION.time_zone
-10:00
-10:00 Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.time_zone;
@@SESSION.time_zone
+05:00
@@ -177,8 +177,9 @@ SELECT @@GLOBAL.time_zone;
@@GLOBAL.time_zone
SYSTEM
SYSTEM Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET @@SESSION.time_zone = @session_time_zone;
SET @@GLOBAL.time_zone = @global_time_zone;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/timestamp_func.result b/mysql-test/suite/sys_vars/r/timestamp_func.result
index 1b49331c069..3394ce4602d 100644
--- a/mysql-test/suite/sys_vars/r/timestamp_func.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_func.result
@@ -1,4 +1,4 @@
-** Connecting con1 using root **
+connect con1,localhost,root,,;
SELECT date(now()) = date(sysdate());
date(now()) = date(sysdate())
1
@@ -6,7 +6,7 @@ SET @@session.timestamp = 1100000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
1
-** Connecting con0 using root **
+connect con0,localhost,root,,;
SELECT @@session.timestamp != 1100000000;
@@session.timestamp != 1100000000
1
@@ -14,12 +14,13 @@ SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
1
-** Connection con1 **
+connection con1;
SELECT @@session.timestamp != 1000000000;
@@session.timestamp != 1000000000
1
SELECT @@session.timestamp = 1100000000;
@@session.timestamp = 1100000000
1
-** Connection default **
-Disconnecting Connections con0, con1
+connection default;
+disconnect con0;
+disconnect con1;
diff --git a/mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result b/mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result
index e24ff2e962a..680461b972f 100644
--- a/mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result
+++ b/mysql-test/suite/sys_vars/r/timestamp_sysdate_is_now_func.result
@@ -1,4 +1,4 @@
-** Connecting con1 using root **
+connect con1,localhost,root,,;
SELECT date(now()) = date(sysdate());
date(now()) = date(sysdate())
1
@@ -6,7 +6,7 @@ SET @@session.timestamp = 1100000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
0
-** Connecting con0 using root **
+connect con0,localhost,root,,;
SELECT @@session.timestamp != 1100000000;
@@session.timestamp != 1100000000
1
@@ -14,12 +14,13 @@ SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());
date(now()) != date(sysdate())
0
-** Connection con1 **
+connection con1;
SELECT @@session.timestamp != 1000000000;
@@session.timestamp != 1000000000
1
SELECT @@session.timestamp = 1100000000;
@@session.timestamp = 1100000000
1
-** Connection default **
-Disconnecting Connections con0, con1
+connection default;
+disconnect con0;
+disconnect con1;
diff --git a/mysql-test/suite/sys_vars/r/tx_isolation_func.result b/mysql-test/suite/sys_vars/r/tx_isolation_func.result
index 6b4c990c71c..3f6bd0b485b 100644
--- a/mysql-test/suite/sys_vars/r/tx_isolation_func.result
+++ b/mysql-test/suite/sys_vars/r/tx_isolation_func.result
@@ -1,13 +1,13 @@
** Setup **
SET @session_tx_isolation = @@SESSION.tx_isolation;
SET @global_tx_isolation = @@GLOBAL.tx_isolation;
-** Connecting con0 using root **
-** Connection con0 **
+connect con0,localhost,root,,;
+connection con0;
SET SESSION AUTOCOMMIT = OFF;
-** Connecting con1 using root **
-** Connection con1 **
+connect con1, localhost, root,,;
+connection con1;
SET SESSION AUTOCOMMIT = OFF;
-** Connection default **
+connection default;
CREATE TABLE t1 (a int PRIMARY KEY, b int) ENGINE=INNODB;
INSERT INTO t1 VALUES(2, 2);
INSERT INTO t1 VALUES(4, 4);
@@ -19,13 +19,13 @@ INSERT INTO t1 VALUES(20, 20);
INSERT INTO t1 VALUES(22, 22);
INSERT INTO t1 VALUES(24, 24);
'#----------------------------FN_DYNVARS_184_01--------------------------------------#'
-** Connection con0 **
+connection con0;
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
-** Connection con1 **
+connection con1;
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8) FOR UPDATE;
a b
@@ -34,7 +34,7 @@ a b
6 6
8 8
UPDATE t1 SET b = 10 WHERE a IN (2,4,6,8);
-** Connection con1 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
a b
@@ -63,11 +63,11 @@ a b
22 22
24 24
COMMIT;
-** Connection con0 **
+connection con0;
DELETE FROM t1 WHERE a = 1 OR a = 3;
COMMIT;
'#----------------------------FN_DYNVARS_184_02--------------------------------------#'
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
a b
@@ -81,7 +81,7 @@ a b
22 22
24 24
UPDATE t1 SET b = 10 WHERE a % 2 = 0;
-** Connection con1 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
a b
@@ -110,14 +110,14 @@ a b
24 10
25 25
COMMIT;
-** Connection con0 **
+connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_03--------------------------------------#'
-** Connection con0 **
+connection con0;
SET SESSION tx_isolation = 'READ-COMMITTED';
-** Connection con1 **
+connection con1;
SET SESSION tx_isolation = 'READ-COMMITTED';
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
a b
@@ -131,7 +131,7 @@ a b
22 10
24 10
UPDATE t1 SET b = 11 WHERE a % 2 = 0;
-** Connection con1 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
a b
@@ -164,14 +164,14 @@ a b
24 10
25 25
COMMIT;
-** Connection con0 **
+connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_04--------------------------------------#'
-** Connection con0 **
+connection con0;
SET SESSION tx_isolation = 'REPEATABLE-READ';
-** Connection con1 **
+connection con1;
SET SESSION tx_isolation = 'REPEATABLE-READ';
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
a b
@@ -185,7 +185,7 @@ a b
22 11
24 11
UPDATE t1 SET b = 12 WHERE a % 2 = 0;
-** Connection con1 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
a b
@@ -223,10 +223,10 @@ a b
24 11
25 25
COMMIT;
-** Connection con0 **
+connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_05--------------------------------------#'
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0 FOR UPDATE;
a b
@@ -235,7 +235,7 @@ a b
23 23
25 25
UPDATE t1 SET b = 13 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0;
-** Connection con1 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
a b
@@ -273,10 +273,10 @@ a b
24 12
25 25
COMMIT;
-** Connection con0 **
+connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_06--------------------------------------#'
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8) = 0 FOR UPDATE;
a b
@@ -290,7 +290,7 @@ a b
24 12
25 13
UPDATE t1 SET b = 14 WHERE a IN (2,4,6,8) = 0;
-** Connection con1 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
a b
@@ -328,14 +328,14 @@ a b
24 12
25 13
COMMIT;
-** Connection con0 **
+connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_07--------------------------------------#'
-** Connection con0 **
+connection con0;
SET SESSION tx_isolation = 'SERIALIZABLE';
-** Connection con0 **
+connection con1;
SET SESSION tx_isolation = 'SERIALIZABLE';
-** Connection con0 **
+connection con0;
START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
a b
@@ -349,7 +349,7 @@ a b
22 14
24 14
UPDATE t1 SET b = 15 WHERE a % 2 = 0;
-** Connection con0 **
+connection con1;
START TRANSACTION;
SELECT * FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -360,30 +360,30 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SELECT * FROM t1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
COMMIT;
-** Connection con0 **
+connection con0;
COMMIT;
'#----------------------------FN_DYNVARS_184_08--------------------------------------#'
SET GLOBAL tx_isolation = 'READ-UNCOMMITTED';
-** Connecting con_int1 using root **
-** Connection con_int1 **
+connect con_int1,localhost,root,,;
+connection con_int1;
SELECT @@SESSION.tx_isolation;
@@SESSION.tx_isolation
READ-UNCOMMITTED
READ-UNCOMMITTED Expected
SET SESSION tx_isolation = 'SERIALIZABLE';
-** Connecting con_int2 using root **
-** Connection con_int2 **
+connect con_int2,localhost,root,,;
+connection con_int2;
SELECT @@SESSION.tx_isolation;
@@SESSION.tx_isolation
READ-UNCOMMITTED
READ-UNCOMMITTED Expected
SET SESSION tx_isolation = 'REPEATABLE-READ';
-** Connection con_int2 **
+connection con_int2;
SELECT @@SESSION.tx_isolation;
@@SESSION.tx_isolation
REPEATABLE-READ
REPEATABLE-READ Expected
-** Connection con_int1 **
+connection con_int1;
SELECT @@SESSION.tx_isolation;
@@SESSION.tx_isolation
SERIALIZABLE
@@ -392,10 +392,12 @@ SELECT @@GLOBAL.tx_isolation;
@@GLOBAL.tx_isolation
READ-UNCOMMITTED
READ-UNCOMMITTED Expected
-** Connection default **
-Disconnecting Connections con_int1, con_int2
+connection default;
+disconnect con_int1;
+disconnect con_int2;
SET @@SESSION.tx_isolation = @session_tx_isolation;
SET @@GLOBAL.tx_isolation = @global_tx_isolation;
-** Connection default **
-Disconnecting Connections con0, con1
+connection default;
+disconnect con0;
+disconnect con1;
DROP TABLE t1;
diff --git a/mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result
index 0fdd4cbbb1b..7d30297dc9f 100644
--- a/mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result
+++ b/mysql-test/suite/sys_vars/r/updatable_views_with_limit_func.result
@@ -4,8 +4,8 @@ CREATE TABLE t1 (a INT, b INT, c INT, PRIMARY KEY(a,b));
INSERT INTO t1 VALUES (10,2,-1), (20,3,-2),
(30,4,-3), (40,5,-4);
CREATE VIEW v1 (x,y) AS SELECT a, c FROM t1;
-** Connecting test_con1 using username 'root' **
-** Connection test_con1 **
+CONNECT test_con1,localhost,root,,;
+connection test_con1;
SET @@Session.UPDATABLE_VIEWS_WITH_LIMIT=YES;
Warning expected, 'View does not contain complete key of the table'
UPDATE v1 SET x=x+6 LIMIT 1;
@@ -24,8 +24,8 @@ a b c
25 3 -2
35 4 -3
45 5 -4
-** Connecting test_con2 using username 'root' **
-** Connection test_con2 **
+CONNECT test_con2,localhost,root,,;
+connection test_con2;
SET @@Session.UPDATABLE_VIEWS_WITH_LIMIT=NO;
SELECT @@SESSION.UPDATABLE_VIEWS_WITH_LIMIT;
@@SESSION.UPDATABLE_VIEWS_WITH_LIMIT
@@ -59,8 +59,9 @@ SET UPDATABLE_VIEWS_WITH_LIMIT=YES;
UPDATE v1 SET x=x+2 LIMIT 1;
Warnings:
Note 1355 View being updated does not have complete key of underlying table in it
-** Connection default **
-** Disconnecting test_con1, test_con2 **
+connection default;
+disconnect test_con1;
+disconnect test_con2;
SET @@SESSION.updatable_views_with_limit = @session_updatable_views_with_limit;
DROP VIEW IF EXISTS v1;
DROP TABLE IF EXISTS t1;
diff --git a/mysql-test/suite/sys_vars/r/wait_timeout_func.result b/mysql-test/suite/sys_vars/r/wait_timeout_func.result
index 01b4a71df87..7ad6f1e9430 100644
--- a/mysql-test/suite/sys_vars/r/wait_timeout_func.result
+++ b/mysql-test/suite/sys_vars/r/wait_timeout_func.result
@@ -1,12 +1,14 @@
SET @start_value= @@global.wait_timeout;
'#--------------------FN_DYNVARS_186_01-------------------------#'
SET @start_time= UNIX_TIMESTAMP();
-connect (test_con1, localhost, root,,);
+connect test_con1, localhost, root,,;
+connection test_con1;
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
Expect 1
1
SET @@session.wait_timeout = <session_value>;
-connect (test_con2, localhost, root,,);
+connect test_con2, localhost, root,,;
+connection test_con2;
SET @@session.wait_timeout = <session_value> - 1;
connection default;
wait until connections ready
@@ -18,7 +20,8 @@ SET @@global.wait_timeout= <global_value>;
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
Expect 1
1
-connect (test_con3, localhost, root,,);
+connect test_con3, localhost, root,,;
+connection test_con3;
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
Expect 1
1
diff --git a/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
index 51c32669934..e0e2bd0eb82 100644
--- a/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_increment_func.test
@@ -79,7 +79,6 @@ SELECT * from t1;
# Test behavior of variable on new connection # 01 #
##########################################################
---echo ## Creating new connection test_con1 ##
CONNECT (test_con1,localhost,root,,);
CONNECTION test_con1;
@@ -106,7 +105,6 @@ SELECT * from t1;
# Test behavior of variable on new connection # 02 #
##########################################################
---echo ## Creating another new connection test_con2 ##
CONNECT (test_con2,localhost,root,,);
connection test_con2;
@@ -131,7 +129,6 @@ SELECT @@global.auto_increment_increment;
# connection # 02
#####################################################################
---echo ## Switching to test_con1 ##
connection test_con1;
--echo ## Verifying values of global & session value of variable ##
@@ -178,16 +175,13 @@ SELECT * from t1;
# Disconnecting all connection & dropping table #
############################################################
---echo ## Disconnecting test_con2 ##
DISCONNECT test_con2;
--echo ## Dropping table t1 ##
DROP table if exists t1;
---echo ## Disconnecting test_con1 ##
DISCONNECT test_con1;
---echo ## switching to default connection ##
connection default;
# restore vars
diff --git a/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
index 0ac96255acf..8d7120c8fb3 100644
--- a/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
+++ b/mysql-test/suite/sys_vars/t/auto_increment_offset_func.test
@@ -82,7 +82,6 @@ SELECT * from t1;
SET @@global.auto_increment_increment = 15;
SET @@global.auto_increment_offset = 36;
---echo ## New connection test_con1 ##
CONNECT (test_con1,localhost,root,,);
CONNECTION test_con1;
@@ -180,10 +179,8 @@ SELECT * from t1;
--echo ## Dropping table ##
DROP table if exists t1;
---echo ## Disconnecting connection ##
DISCONNECT test_con1;
---echo ## switching to default connection ##
connection default;
# restore vars
diff --git a/mysql-test/suite/sys_vars/t/autocommit_func.test b/mysql-test/suite/sys_vars/t/autocommit_func.test
index 10c763ca58e..2d5c66fb3d5 100644
--- a/mysql-test/suite/sys_vars/t/autocommit_func.test
+++ b/mysql-test/suite/sys_vars/t/autocommit_func.test
@@ -51,7 +51,6 @@ SET @@autocommit = 0;
# after updating record in 1st connection
######################################################################
---echo ## Creating new connection ##
CONNECT (test_con1,localhost,root,,);
CONNECTION test_con1;
@@ -68,7 +67,6 @@ SELECT * from t1;
--echo ## Creating another connection and verifying records in table ##
---echo ## New Connection test_con2 ##
CONNECT (test_con2,localhost,root,,);
CONNECTION test_con2;
SELECT * from t1;
@@ -82,13 +80,11 @@ SELECT * from t1;
######################################################################
--echo ## Verifying behavior of variable by commiting rows in test_con1 ##
---echo ## Connecting with connection # 01 ##
CONNECTION test_con1;
SELECT * from t1;
COMMIT;
---echo ## New Connection test_con2 ##
--echo ## Now verifying records in table from connection # 02 ##
CONNECTION test_con2;
SELECT * from t1;
@@ -100,7 +96,6 @@ SELECT * from t1;
# first connection
######################################################################
---echo ## Connecting to connection # 01 ##
CONNECTION test_con1;
SELECT * from t1;
@@ -127,12 +122,10 @@ SELECT * from t1;
######################################################################
---echo ## Connecting with connection # 01 ##
CONNECTION test_con1;
INSERT into t1(name) values('Record_3');
---echo ## Connection test_con2 ##
--echo ## Now verifying records in table from connection # 02 and changing value ##
--echo ## of autocommit to true ##
CONNECTION test_con2;
@@ -159,7 +152,6 @@ COMMIT;
--echo ## Dropping table t1 ##
DROP table t1;
---echo ## Disconnecting both connections ##
DISCONNECT test_con1;
DISCONNECT test_con2;
diff --git a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test
index ae5edbb078e..fd2dbefe7f6 100644
--- a/mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test
+++ b/mysql-test/suite/sys_vars/t/automatic_sp_privileges_func.test
@@ -43,13 +43,10 @@ CREATE USER 'userTest1'@'localhost';
#
# Value TRUE
#
---echo ** Connection default **
connection default;
SET GLOBAL automatic_sp_privileges = TRUE;
---echo ** Connecting using userTest **
connect (conUser,localhost,userTest,,);
---echo ** Connection conUser **
connection conUser;
delimiter |;
@@ -67,13 +64,10 @@ CALL testProc();
#
# Value FALSE
#
---echo ** Connection default**
connection default;
SET GLOBAL automatic_sp_privileges = FALSE;
---echo ** Connecting using userTest1 **
connect (conUser1,localhost,userTest1,,);
---echo ** Connection conUser1 **
connection conUser1;
delimiter |;
@@ -100,12 +94,10 @@ ALTER PROCEDURE testProc1 COMMENT 'My Comment';
--error ER_PROCACCESS_DENIED_ERROR
DROP PROCEDURE testProc1;
---echo ** Connection default **
connection default;
GRANT EXECUTE, ALTER ROUTINE ON PROCEDURE testProc1 TO 'userTest1'@'localhost';
---echo ** Connection conUser1 **
connection conUser1;
CALL testProc1();
@@ -118,10 +110,8 @@ ALTER PROCEDURE testProc1 COMMENT 'My Comment';
# Cleanup
#
--echo ** Cleanup **
---echo ** Connection default **
connection default;
---echo disconnecting connections
disconnect conUser;
disconnect conUser1;
diff --git a/mysql-test/suite/sys_vars/t/character_set_client_func.test b/mysql-test/suite/sys_vars/t/character_set_client_func.test
index 90f5cdaae0f..1c2b589ecde 100644
--- a/mysql-test/suite/sys_vars/t/character_set_client_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_client_func.test
@@ -30,9 +30,7 @@ SET @session_character_set_client = @@session.character_set_client;
SET @@global.character_set_client = utf8;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.character_set_client;
SELECT @@session.character_set_client;
@@ -43,7 +41,6 @@ disconnect con1;
# Begin the functionality Testing of character_set_client #
#############################################################
---echo 'connection default'
connection default;
SHOW VARIABLES like 'character_set_client';
diff --git a/mysql-test/suite/sys_vars/t/character_set_connection_func.test b/mysql-test/suite/sys_vars/t/character_set_connection_func.test
index 11a8e311fd1..737099158c7 100644
--- a/mysql-test/suite/sys_vars/t/character_set_connection_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_connection_func.test
@@ -32,9 +32,7 @@ SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_connection = utf8;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.character_set_connection;
SELECT @@session.character_set_connection;
@@ -45,7 +43,6 @@ disconnect con1;
# Begin the functionality Testing of character_set_connection #
###############################################################
---echo 'connection default'
connection default;
--disable_warnings
@@ -102,4 +99,3 @@ DROP TABLE t1;
#############################################################
# End of functionality Testing for character_set_connection #
#############################################################
-
diff --git a/mysql-test/suite/sys_vars/t/character_set_database_func.test b/mysql-test/suite/sys_vars/t/character_set_database_func.test
index d3da8660766..d5956ba0623 100644
--- a/mysql-test/suite/sys_vars/t/character_set_database_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_database_func.test
@@ -32,9 +32,7 @@ SET @session_character_set_server = @@session.character_set_server;
SET @global_character_set_server = @@global.character_set_server;
SET @@global.character_set_database = utf8;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.character_set_database;
SELECT @@session.character_set_database;
@@ -45,7 +43,6 @@ disconnect con1;
# Begin the functionality Testing of character_set_database #
#############################################################
---echo 'connection default'
connection default;
--disable_warnings
diff --git a/mysql-test/suite/sys_vars/t/character_set_results_func.test b/mysql-test/suite/sys_vars/t/character_set_results_func.test
index df7437f225f..6b869789775 100644
--- a/mysql-test/suite/sys_vars/t/character_set_results_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_results_func.test
@@ -30,9 +30,7 @@ SET @session_character_set_results = @@session.character_set_results;
SET @@global.character_set_results = utf8;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.character_set_results;
SELECT @@session.character_set_results;
@@ -44,7 +42,6 @@ disconnect con1;
# Begin the functionality Testing of character_set_results #
#############################################################
---echo 'connection default'
connection default;
--disable_warnings
@@ -91,7 +88,6 @@ SELECT b, CHAR_LENGTH(b) FROM t1;
DROP TABLE t1;
# restore
---echo 'connection default;'
connection default;
SET @@global.character_set_results = @global_character_set_results;
SET @@session.character_set_results = @session_character_set_results;
@@ -99,4 +95,3 @@ SET @@session.character_set_results = @session_character_set_results;
##########################################################
# End of functionality Testing for character_set_results #
##########################################################
-
diff --git a/mysql-test/suite/sys_vars/t/character_set_server_func.test b/mysql-test/suite/sys_vars/t/character_set_server_func.test
index c17568c35ea..183f87c2ba7 100644
--- a/mysql-test/suite/sys_vars/t/character_set_server_func.test
+++ b/mysql-test/suite/sys_vars/t/character_set_server_func.test
@@ -29,9 +29,7 @@ SET @session_character_set_server = @@session.character_set_server;
SET @@global.character_set_server = utf8;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.character_set_server;
SELECT @@session.character_set_server;
@@ -42,7 +40,6 @@ disconnect con1;
# Begin the functionality Testing of character_set_server #
#############################################################
---echo 'connection default'
connection default;
#The server character set and collation are used as default values if the database
#character set and collation are not specified in CREATE DATABASE statements.
@@ -72,9 +69,7 @@ select @@character_set_database;
--echo '----test with new connection----'
#==============================================================================
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@session.character_set_server;
@@ -96,7 +91,6 @@ select @@character_set_database;
disconnect con1;
#restore
---echo 'connection default;'
connection default;
SET @@global.character_set_server = @global_character_set_server;
SET @@session.character_set_server = @session_character_set_server;
diff --git a/mysql-test/suite/sys_vars/t/collation_connection_func.test b/mysql-test/suite/sys_vars/t/collation_connection_func.test
index bdb2efd9959..0cf41895b8f 100644
--- a/mysql-test/suite/sys_vars/t/collation_connection_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_connection_func.test
@@ -27,9 +27,7 @@ SET @global_collation_connection = @@global.collation_connection;
SET @session_collation_connection = @@session.collation_connection;
SET @@global.collation_connection = latin1_danish_ci;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.collation_connection;
SELECT @@session.collation_connection;
@@ -40,7 +38,6 @@ disconnect con1;
# Begin the functionality Testing of collation_connection #
###########################################################
---echo 'connection default'
connection default;
--disable_warnings
diff --git a/mysql-test/suite/sys_vars/t/collation_database_func.test b/mysql-test/suite/sys_vars/t/collation_database_func.test
index aa8716408f7..2914d8a07d3 100644
--- a/mysql-test/suite/sys_vars/t/collation_database_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_database_func.test
@@ -30,9 +30,7 @@ SET @session_collation_server = @@session.collation_server;
SET @@global.collation_database = latin1_danish_ci;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.collation_database;
SELECT @@session.collation_database;
@@ -43,7 +41,6 @@ disconnect con1;
# Begin the functionality Testing of collation_database #
#########################################################
---echo 'connection default'
connection default;
--disable_warnings
diff --git a/mysql-test/suite/sys_vars/t/collation_server_func.test b/mysql-test/suite/sys_vars/t/collation_server_func.test
index 045cb5cf720..71eabcc874c 100644
--- a/mysql-test/suite/sys_vars/t/collation_server_func.test
+++ b/mysql-test/suite/sys_vars/t/collation_server_func.test
@@ -28,9 +28,7 @@ SET @global_collation_server = @@global.collation_server;
SET @session_collation_server = @@session.collation_server;
SET @@global.collation_server = latin1_danish_ci;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.collation_server;
SELECT @@session.collation_server;
@@ -41,7 +39,6 @@ disconnect con1;
# Begin the functionality Testing of collation_server #
#######################################################
---echo 'connection default'
connection default;
--disable_warnings
diff --git a/mysql-test/suite/sys_vars/t/completion_type_func.test b/mysql-test/suite/sys_vars/t/completion_type_func.test
index 6b1aa6a29cd..2411cacf8bb 100644
--- a/mysql-test/suite/sys_vars/t/completion_type_func.test
+++ b/mysql-test/suite/sys_vars/t/completion_type_func.test
@@ -37,7 +37,6 @@ PRIMARY KEY (id),
name VARCHAR(30)
) ENGINE = INNODB;
---echo ## Creating new connections test_con1, test_con2 ##
connect (test_con1,localhost,root,,);
connect (test_con2,localhost,root,,);
@@ -60,12 +59,10 @@ INSERT INTO t1 VALUES(2,'Record_2');
INSERT INTO t1 VALUES(3,'Record_3');
SELECT * FROM t1;
---echo Switching to connection test_con1
connection test_con1;
--echo ## Don't expect to see id's 2 and 3 in the table w/o COMMIT ##
SELECT * FROM t1;
---echo Switching to default connection
connection default;
COMMIT;
@@ -75,13 +72,11 @@ INSERT INTO t1 VALUES(4,'Record_4');
INSERT INTO t1 VALUES(5,'Record_5');
SELECT * FROM t1;
---echo Switching to connection test_con1
connection test_con1;
--echo ## Don't expect to see id's 4 and 5 here ##
--echo ## Expect to see 3, Record_3 ##
SELECT * FROM t1;
---echo Switching to connection default;
connection default;
@@ -94,7 +89,6 @@ SELECT * FROM t1;
--echo # Setting initial value of completion_type to one #
--echo #########################################################
---echo Switching to connection test_con1;
connection test_con1;
SET @@session.completion_type = 1;
@@ -109,11 +103,9 @@ INSERT INTO t1 VALUES(8,'Record_8');
SELECT * FROM t1;
connection test_con2;
---echo switching to test_con2
--echo ## Do not expect to see 8, Record_8 as no COMMIT has occurred ##
SELECT * FROM t1;
---echo switch to connection test_con1
connection test_con1;
--echo ## Testing ROLLBACK behavior
@@ -130,12 +122,10 @@ SELECT * FROM t1;
--echo ## Expect a new transaction ##
INSERT INTO t1 VALUES(9, 'Record_9');
---echo Switching to connection test_con2
connection test_con2;
--echo ## Don't expect to see 9, Record_9 due to no COMMIT yet ##
SELECT * FROM t1;
---echo Switching to connection test_con1
connection test_con1;
ROLLBACK;
--echo ## Don't expect to see 9, Record_9
@@ -159,7 +149,6 @@ COMMIT;
--Error 2006,2013,ER_QUERY_INTERRUPTED,ER_CONNECTION_KILLED
INSERT INTO t1 VALUES(4,'Record_4');
---echo switch to connection test_con2
connection test_con2;
SET @@session.completion_type = 2;
diff --git a/mysql-test/suite/sys_vars/t/concurrent_insert_func.test b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test
index b97c926e6b5..2f91cc99fbe 100644
--- a/mysql-test/suite/sys_vars/t/concurrent_insert_func.test
+++ b/mysql-test/suite/sys_vars/t/concurrent_insert_func.test
@@ -60,7 +60,6 @@ LOCK TABLE t1 READ LOCAL;
--echo ## Creating new connection to insert some rows in table ##
connect (test_con1,localhost,root,,);
---echo connection test_con1;
connection test_con1;
--echo ## New records should come at the end of all rows ##
@@ -68,7 +67,6 @@ INSERT INTO t1(name) VALUES('Record_4');
SELECT * FROM t1;
--echo ## unlocking tables ##
---echo connection default;
connection default;
UNLOCK TABLES;
@@ -84,7 +82,6 @@ DELETE FROM t1 WHERE name ='Record_2';
####################################################################
# lock table and connect with connection1
LOCK TABLE t1 READ LOCAL;
---echo connection test_con1;
connection test_con1;
# setting value of concurrent_insert to 1
@@ -94,7 +91,6 @@ SET @@global.concurrent_insert=1;
send
INSERT INTO t1(name) VALUES('Record_7');
---echo connection default;
connection default;
# wait until INSERT will be locked (low performance)
let $wait_condition= SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST
@@ -114,12 +110,10 @@ INSERT INTO t1(name) VALUES('Record_6');
let $wait_condition= SELECT COUNT(*) = 5 FROM t1;
--source include/wait_condition.inc
---echo connection test_con1;
connection test_con1;
# to complete the send above^
reap;
SELECT * FROM t1;
---echo connection default;
connection default;
--echo '#--------------------FN_DYNVARS_018_03-------------------------#'
@@ -132,7 +126,6 @@ connection default;
--echo ## lock table and connect with connection1 ##
LOCK TABLE t1 READ LOCAL;
---echo connection test_con1;
connection test_con1;
--echo ## setting value of concurrent_insert to 2 ##
SET @@global.concurrent_insert=2;
@@ -142,7 +135,6 @@ INSERT INTO t1(name) VALUES('Record_5');
SELECT * FROM t1;
SELECT @@concurrent_insert;
---echo connection default;
connection default;
--echo ## Unlocking table ##
@@ -162,8 +154,6 @@ SELECT * FROM t1;
--echo ## Dropping table ##
DROP TABLE t1;
---echo ## Disconnecting connection ##
disconnect test_con1;
SET @@global.concurrent_insert= @start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/debug_dbug_func.test b/mysql-test/suite/sys_vars/t/debug_dbug_func.test
index 209c62281fb..b4cd4aefd5e 100644
--- a/mysql-test/suite/sys_vars/t/debug_dbug_func.test
+++ b/mysql-test/suite/sys_vars/t/debug_dbug_func.test
@@ -67,29 +67,23 @@ SET GLOBAL debug_dbug= '';
SET SESSION debug_dbug= '';
--echo # Test 2 - Bug test case, two connections
---echo # Connection default
connection default;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval SET GLOBAL debug_dbug= '+O,$MYSQL_TMP_DIR/bug46165.2.trace';
SET SESSION debug_dbug= '-d:-t:-i';
---echo # Connection con1
connect (con1, localhost, root);
SET GLOBAL debug_dbug= '';
---echo # Connection default
connection default;
SET SESSION debug_dbug= '';
---echo # Connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
SET GLOBAL debug_dbug= '';
--echo # Test 3 - Active session trace file on disconnect
---echo # Connection con1
connect (con1, localhost, root);
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval SET GLOBAL debug_dbug= '+O,$MYSQL_TMP_DIR/bug46165.3.trace';
@@ -105,26 +99,21 @@ disconnect con1;
--source include/wait_until_disconnected.inc
--echo # Test 4 - Active session trace file on two connections
---echo # Connection default
connection default;
--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval SET GLOBAL debug_dbug= '+O,$MYSQL_TMP_DIR/bug46165.4.trace';
SET SESSION debug_dbug= '-d:-t:-i';
---echo # Connection con1
connect (con1, localhost, root);
SET SESSION debug_dbug= '-d:-t:-i';
SET GLOBAL debug_dbug= '';
SET SESSION debug_dbug= '';
---echo # Connection default
connection default;
SET SESSION debug_dbug= '';
---echo # Connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
--echo # Test 5 - Different trace files
diff --git a/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test b/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test
index 1e826293949..94607432fd9 100644
--- a/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test
+++ b/mysql-test/suite/sys_vars/t/default_regex_flags_basic.test
@@ -31,11 +31,9 @@ SET @@default_regex_flags=DEFAULT;
SET @@global.default_regex_flags='MULTILINE';
SELECT @@session.default_regex_flags;
connect (con1,localhost,root,,);
---echo # connection con1
connection con1;
SELECT @@session.default_regex_flags;
connection default;
---echo # connection default
disconnect con1;
SELECT @@session.default_regex_flags;
SET @@global.default_regex_flags=DEFAULT;
diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_func.test b/mysql-test/suite/sys_vars/t/delay_key_write_func.test
index a44b37653d2..89f40ba544b 100644
--- a/mysql-test/suite/sys_vars/t/delay_key_write_func.test
+++ b/mysql-test/suite/sys_vars/t/delay_key_write_func.test
@@ -29,17 +29,13 @@ SET @start_value= @@global.delay_key_write;
SET @@global.delay_key_write = ON;
SELECT @@global.delay_key_write;
---echo 'connect (user1,localhost,root,,,,)'
connect (user1,localhost,root,,,,);
---echo 'connection user1'
connection user1;
SELECT @@global.delay_key_write AS res_is_ON;
SET @@global.delay_key_write = ALL;
disconnect user1;
---echo 'connect (user1,localhost,root,,,,)'
connect (user1,localhost,root,,,,);
---echo 'connection user1'
connection user1;
SELECT @@global.delay_key_write AS res_is_ALL;
diff --git a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
index 427f2730e47..33c278dc118 100644
--- a/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/delayed_insert_limit_func.test
@@ -30,10 +30,8 @@
--source include/not_embedded.inc
---echo Creating connection con0
connect (con0,localhost,root,,);
let $con0_id=`SELECT CONNECTION_ID()`;
---echo Creating connection con1
connect (con1,localhost,root,,);
let $con1_id=`SELECT CONNECTION_ID()`;
@@ -63,7 +61,6 @@ INSERT INTO t1 VALUES('6','1','1');
LOCK TABLE v1 WRITE;
---echo ** Connection con1 **
connection con1;
delimiter |;
@@ -107,7 +104,6 @@ INSERT DELAYED INTO t1 VALUES('42','1','1');
INSERT DELAYED INTO t1 VALUES('43','1','1');|
delimiter ;|
---echo ** Connection con0 **
connection con0;
let $wait_condition=
SELECT variable_value > @@global.delayed_insert_limit
@@ -118,7 +114,6 @@ let $my_select= SELECT COUNT(*) FROM t1;
send;
eval $my_select;
---echo ** Connection default **
connection default;
--echo ** Wait till con0 is blocked **
let $wait_condition=
@@ -127,12 +122,10 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLES;
---echo ** Connection con1 **
connection con1;
--echo Asynchronous "reap" result
reap;
---echo ** Connection con0 **
connection con0;
--echo Asynchronous "reap" result
--echo The next result suffers from
@@ -146,7 +139,6 @@ connection con0;
--replace_result 6 21
reap;
---echo ** Connection default **
connection default;
let $wait_condition= SELECT count(*) = 43 FROM t1;
--source include/wait_condition.inc
@@ -175,7 +167,6 @@ INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE;
---echo ** Connection con1 **
connection con1;
--echo Asynchronous execute
@@ -201,7 +192,6 @@ INSERT DELAYED INTO t1 VALUES('22');|
delimiter ;|
---echo ** Connection con0 **
connection con0;
let $wait_condition=
SELECT variable_value > 0 FROM information_schema.global_status
@@ -214,7 +204,6 @@ let $my_select= SELECT COUNT(*) BETWEEN 6 AND 22 FROM t1;
send;
eval $my_select;
---echo ** Connection default **
connection default;
--echo ** Wait till con0 is blocked **
let $wait_condition=
@@ -223,16 +212,13 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLES;
---echo ** Connection con1 **
connection con1;
reap;
---echo ** Connection con0 **
connection con0;
--echo Asynchronous "reap" result
reap;
---echo ** Connection default**
connection default;
--echo Checking if the delayed insert gives the same result afterwards
eval $my_select;
@@ -242,13 +228,11 @@ eval $my_select;
# Cleanup
#
---echo ** Connection default**
connection default;
DROP TABLE t1;
DROP VIEW v1;
SET @@GLOBAL.delayed_insert_limit = @global_delayed_insert_limit;
---echo Disconnecting from con1, con0
disconnect con0;
disconnect con1;
let $wait_condition=
diff --git a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
index 472b6469f42..afce8bf744f 100644
--- a/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
+++ b/mysql-test/suite/sys_vars/t/div_precision_increment_func.test
@@ -83,7 +83,6 @@ salary INT,
income_tax FLOAT
);
---echo ## Creating new connection test_con1 ##
connect (test_con1, localhost, root,,);
connection test_con1;
@@ -99,7 +98,6 @@ INSERT into t1(name, salary, income_tax) values('Record_2', 501, 501*2.5/1000);
INSERT into t1(name, salary, income_tax) values('Record_3', 210, 210*2.5/1000);
SELECT * from t1;
---echo ## Creating new connection ##
connect (test_con2, localhost, root,,);
connection test_con2;
@@ -116,13 +114,8 @@ SELECT * from t1;
--echo ## Dropping table t1 ##
drop table t1;
---echo ## Disconnection both the connections ##
disconnect test_con1;
disconnect test_con2;
connection default;
eval SET @@global.div_precision_increment = $save_div_precision_increment;
-
-
-
-
diff --git a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
index 14134a5fb95..7fe0eb849d0 100644
--- a/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
+++ b/mysql-test/suite/sys_vars/t/foreign_key_checks_func.test
@@ -28,15 +28,11 @@
SET @@session.foreign_key_checks = 0;
# con1 will be default connection from now on
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@session.foreign_key_checks;
SET @@session.foreign_key_checks = 1;
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
connection con2;
SELECT @@session.foreign_key_checks;
disconnect con2;
@@ -46,7 +42,6 @@ disconnect con2;
# Begin the functionality Testing of foreign_key_checks #
#################################################################
---echo 'connection con1'
connection con1;
--disable_warnings
diff --git a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
index 242d404d244..7ac270b3415 100644
--- a/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
+++ b/mysql-test/suite/sys_vars/t/ft_boolean_syntax_func.test
@@ -25,15 +25,11 @@
SET @@global.ft_boolean_syntax = ' -+()<>~*:``&|';
# con1 will be default connection from now on
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.ft_boolean_syntax;
SET @@global.ft_boolean_syntax = '+ -><()~*:""&|';
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
connection con2;
SELECT @@global.ft_boolean_syntax;
disconnect con2;
@@ -44,7 +40,6 @@ disconnect con1;
# Begin the functionality Testing of ft_boolean_syntax #
#########################################################
---echo 'connection default'
connection default;
--disable_warnings
@@ -117,4 +112,3 @@ SET @@global.ft_boolean_syntax=DEFAULT;
# End of functionality Testing for ft_boolean_syntax #
#########################################################
DROP TABLE articles;
-
diff --git a/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test b/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test
index 29a4ff5becb..b053ee229d7 100644
--- a/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test
+++ b/mysql-test/suite/sys_vars/t/group_concat_max_len_func.test
@@ -66,7 +66,6 @@ INSERT INTO t1(rollno, name) VALUES(4, 'Record_8');
# caused by the MyISAM feature "concurrent_inserts".
SELECT * FROM t1 ORDER BY id;
---echo ## Creating two new connections ##
connect (test_con1,localhost,root,,);
connect (test_con2,localhost,root,,);
@@ -76,7 +75,6 @@ connect (test_con2,localhost,root,,);
# Verifying initial behavior of variable by concatinating values greater than 4
###############################################################################
---echo ## Connecting with test_con1 ##
connection test_con1;
--echo ## Accessing data and using group_concat on column whose value is greater than 4 ##
@@ -94,7 +92,6 @@ SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
# Verifying behavior of variable by increasing session value of variable #
##############################################################################
---echo ## Connecting with new connection test_con2 ##
connection test_con2;
--echo ## Verifying initial value of variable. It should be 4 ##
@@ -130,11 +127,9 @@ SELECT id, rollno, GROUP_CONCAT(name) FROM t1 GROUP BY rollno;
--echo ## Dropping table t1 ##
DROP TABLE t1;
---echo ## Disconnecting both the connection ##
disconnect test_con2;
disconnect test_con1;
connection default;
SET @@global.group_concat_max_len = @save;
-
diff --git a/mysql-test/suite/sys_vars/t/identity_func.test b/mysql-test/suite/sys_vars/t/identity_func.test
index ff93607a2cd..e3bbaa1d3a2 100644
--- a/mysql-test/suite/sys_vars/t/identity_func.test
+++ b/mysql-test/suite/sys_vars/t/identity_func.test
@@ -54,7 +54,6 @@ name VARCHAR(30)
--echo ## It should be zero ##
SELECT @@identity = 0;
---echo ## Creating and connecting with new connection test_con1 ##
connect (test_con1, localhost, root,,);
connection test_con1;
SET @@autocommit = 0;
@@ -80,7 +79,6 @@ SELECT @@identity from t2;
# Verifying value of identity with new connection #
##########################################################
---echo ## Creating and connecting with new connection test_con2 ##
connect (test_con2, localhost, root,,);
connection test_con2;
SELECT * from t1;
@@ -110,7 +108,6 @@ SELECT @@identity from t2;
# Verifying identity value by using commit in connectio # 01 #
###################################################################
---echo ## Switching to connection test_con1 ##
connection test_con1;
--echo ## Commiting rows added in test_con1 ##
@@ -134,11 +131,5 @@ SELECT @@identity from t1;
--echo ## Dropping tables t1 & t2 ##
drop table t1, t2;
---echo ## Disconnecting both the connections ##
disconnect test_con1;
disconnect test_con2;
-
-
-
-
-
diff --git a/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test
index 9493536bc59..3b97a85db01 100644
--- a/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test
+++ b/mysql-test/suite/sys_vars/t/innodb_fatal_semaphore_wait_threshold.test
@@ -10,16 +10,13 @@
# Only test for innodb
--source include/have_innodb.inc
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--disable_warnings
drop table if exists t1;
--enable_warnings
---echo # Switch to connection con1
connection con1;
eval create table t1 (id integer, x integer) engine = InnoDB;
insert into t1 values(0, 0);
@@ -38,7 +35,6 @@ SELECT * from t1 where id = 0 FOR UPDATE;
# To make sure con1 holding the lock table mutex and sleeping
--sleep 2
---echo # Switch to connection con2
connection con2;
set autocommit=0;
@@ -66,7 +62,6 @@ SELECT * from t1 where id = 0 FOR UPDATE;
# so mysqld will abort after 600 * 10 + 1 * 10 = 6010 seconds
# in debug mode and 600 + 1 * 10 = 610 seconds in release mode.
---echo # Switched to the default connection
connection default;
--disable_result_log
diff --git a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
index c7a9e567e69..62c88f43ebd 100644
--- a/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_max_dirty_pages_pct_func.test
@@ -33,22 +33,15 @@ SET @innodb_max_dirty_pages_pct = @@global.innodb_max_dirty_pages_pct;
############################################################################
SET @@global.innodb_max_dirty_pages_pct = 80;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.innodb_max_dirty_pages_pct;
SET @@global.innodb_max_dirty_pages_pct = 70;
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
connection con2;
SELECT @@global.innodb_max_dirty_pages_pct;
---echo 'connection default'
connection default;
---echo 'disconnect con2'
disconnect con2;
---echo 'disconnect con1'
disconnect con1;
# restore initial value
SET @@global.innodb_max_dirty_pages_pct = @innodb_max_dirty_pages_pct;
diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
index f1b6fe84fe1..693a21b2732 100644
--- a/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_func.test
@@ -26,9 +26,7 @@
####################################################################
SET @@global.innodb_support_xa = OFF;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.innodb_support_xa;
SELECT @@session.innodb_support_xa;
@@ -40,7 +38,6 @@ disconnect con1;
# Begin the functionality Testing of innodb_support_xa #
###########################################################
---echo 'connection default'
connection default;
SET @@global.innodb_support_xa = 1;
@@ -93,9 +90,7 @@ xa end 'testa','testb';
BEGIN;
--Error ER_XAER_RMFAIL
CREATE table t2 (a int);
---echo 'connect (con1,localhost,root,,,,)'
CONNECT (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
--Error ER_XAER_DUPID
@@ -116,7 +111,6 @@ xa recover;
# uncomment the line below when binlog will be able to prepare
#disconnect con1;
---echo 'connection default'
CONNECTION default;
xa prepare 'testa','testb';
xa recover;
@@ -124,7 +118,6 @@ xa recover;
xa commit 'testb',0x2030405060,11;
xa commit 'testa','testb';
---echo 'connection con1'
CONNECTION con1;
xa rollback 'testb',0x2030405060,11;
diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
index 330addd6b3b..d69cacd1377 100644
--- a/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
+++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_func.test
@@ -31,9 +31,7 @@ SET @start_value= @@global.innodb_table_locks;
SELECT @start_value;
SET @@global.innodb_table_locks = OFF;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.innodb_table_locks;
SELECT @@session.innodb_table_locks;
@@ -48,10 +46,8 @@ disconnect con1;
#==============================================================================
--echo '----check when innodb_table_locks = ON and autocommit = OFF---'
#==============================================================================
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection default'
connection default;
--disable_warnings
@@ -66,17 +62,14 @@ BEGIN;
INSERT INTO t1 VALUES(1);
SELECT * FROM t1 FOR UPDATE;
---echo 'CONNECTION con2'
CONNECTION con2;
SET @@innodb_table_locks = ON;
SET @@autocommit = OFF;
send LOCK TABLES t1 WRITE;
---echo 'CONNECTION default'
CONNECTION default;
COMMIT;
---echo 'CONNECTION con2'
CONNECTION con2;
reap;
UNLOCK tables;
diff --git a/mysql-test/suite/sys_vars/t/insert_id_func.test b/mysql-test/suite/sys_vars/t/insert_id_func.test
index d7103f806bd..a710afbb0cc 100644
--- a/mysql-test/suite/sys_vars/t/insert_id_func.test
+++ b/mysql-test/suite/sys_vars/t/insert_id_func.test
@@ -62,7 +62,6 @@ INSERT into t1(name) values('Record_3');
# Verifying value of insert_id with new connection #
##########################################################
---echo ## Creating & Connecting new connection test_con1 ##
connect (test_con1, localhost, root,,);
connection test_con1;
@@ -85,7 +84,6 @@ SELECT * from t1;
# Now verifying some new value of insert_id with second new connection #
#############################################################################
---echo ## Creating and switching to new connection test_con2 ##
connect (test_con2, localhost, root,,);
connection test_con2;
@@ -103,11 +101,5 @@ SELECT * from t1;
--echo ## Dropping table t1 ##
drop table t1;
---echo ## Disconnecting connections ##
disconnect test_con1;
disconnect test_con2;
-
-
-
-
-
diff --git a/mysql-test/suite/sys_vars/t/interactive_timeout_func.test b/mysql-test/suite/sys_vars/t/interactive_timeout_func.test
index 0df069ad73e..28487a7b3e3 100644
--- a/mysql-test/suite/sys_vars/t/interactive_timeout_func.test
+++ b/mysql-test/suite/sys_vars/t/interactive_timeout_func.test
@@ -50,7 +50,6 @@ let $start_value= `SELECT @@global.interactive_timeout`;
--echo ## Setting initial value of variable to 1 ##
SET @@global.interactive_timeout = 1;
---echo ## Creating new connection test_con1 ##
# Not yet possible to set CLEAN_INTERACTIVE flag
connect (test_con1, localhost, root,,,,,);
connection test_con1;
@@ -65,24 +64,19 @@ SET @@session.interactive_timeout = 1;
SELECT @@session.interactive_timeout;
SELECT @@global.interactive_timeout;
---echo connection default;
connection default;
--echo ## Using sleep to check timeout ##
--echo sleep 2;
sleep 2;
---echo connection test_con1;
connection test_con1;
SELECT * from t1;
INSERT into t1(name) values('Record_2');
---echo connection default;
connection default;
---echo disconnect test_con1;
disconnect test_con1;
DROP TABLE t1;
eval SET @@global.interactive_timeout= $start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/key_buffer_size_func.test b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
index df0ce62c69c..77637bb8d81 100644
--- a/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
+++ b/mysql-test/suite/sys_vars/t/key_buffer_size_func.test
@@ -50,7 +50,6 @@ FLUSH STATUS;
SET @@global.key_buffer_size = 131072;
---echo ## Creating two new connections ##
CONNECT (test_con1,localhost,root,,);
CONNECT (test_con2,localhost,root,,);
@@ -60,7 +59,6 @@ CONNECT (test_con2,localhost,root,,);
# Verifying initial behavior of variable by concatinating values greater than 4
###############################################################################
---echo ## Connecting with connection test_con1 ##
CONNECTION test_con1;
SELECT @@global.key_buffer_size;
@@ -80,13 +78,11 @@ INSERT INTO t1(rollno, name) VALUES(4, 'Record_10');
--echo ## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
---echo ## Switching to connection test_con2 ##
connection test_con2;
--echo ## Key_reads must be zero (no disk access) ##
show status like 'Key_reads';
---echo ## Connecting with connection test_con1 ##
CONNECTION test_con1;
--echo ## Inserting some rows in table ##
@@ -111,10 +107,8 @@ show status like 'Key_reads';
--echo ## Dropping table ##
DROP TABLE IF EXISTS t1;
---echo ## Disconnecting both the connections ##
DISCONNECT test_con2;
DISCONNECT test_con1;
connection default;
SET @@global.key_buffer_size= @start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/last_insert_id_func.test b/mysql-test/suite/sys_vars/t/last_insert_id_func.test
index 2309c539bd9..f68dbe61f94 100644
--- a/mysql-test/suite/sys_vars/t/last_insert_id_func.test
+++ b/mysql-test/suite/sys_vars/t/last_insert_id_func.test
@@ -59,7 +59,6 @@ SELECT @@session.last_insert_id = 2;
# Verifying value of last_insert_id with new connection without committing rows #
#################################################################################
---echo ## Creating & connecting to new connection test_con1 ##
connect (test_con1, localhost, root,,);
connection test_con1;
@@ -82,7 +81,6 @@ SELECT @@session.last_insert_id;
# Now verifying value of last_insert_id with second new connection #
#########################################################################
---echo ## Creating & connecting to new connection test_con2 ##
connect (test_con2, localhost, root,,);
connection test_con2;
@@ -103,7 +101,6 @@ SELECT @@last_insert_id;
# connection # 1
############################################################################
---echo ## Switching to test_con1 ##
connection test_con1;
--echo ## Verifying all records in table & value of variable ##
@@ -137,11 +134,5 @@ SELECT @@session.last_insert_id;
--echo ## Dropping table t1 ##
drop table t1;
---echo ## Disconnecting both the connections ##
disconnect test_con1;
disconnect test_con2;
-
-
-
-
-
diff --git a/mysql-test/suite/sys_vars/t/lc_time_names_func.test b/mysql-test/suite/sys_vars/t/lc_time_names_func.test
index 2c86a597773..22a48d58562 100644
--- a/mysql-test/suite/sys_vars/t/lc_time_names_func.test
+++ b/mysql-test/suite/sys_vars/t/lc_time_names_func.test
@@ -25,16 +25,12 @@
######################################################################
SET @@global.lc_time_names = "en_CA";
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.lc_time_names;
SELECT @@session.lc_time_names;
SET @@global.lc_time_names = "en_IN";
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
connection con2;
SELECT @@global.lc_time_names;
SELECT @@session.lc_time_names;
@@ -47,7 +43,6 @@ disconnect con1;
# Begin the functionality Testing of lc_time_names #
#################################################################
---echo 'connection default'
connection default;
SET NAMES 'utf8';
@@ -84,4 +79,3 @@ SET @@global.lc_time_names = "en_US";
##########################################################
# End of functionality Testing for lc_time_names #
##########################################################
-
diff --git a/mysql-test/suite/sys_vars/t/local_infile_func.test b/mysql-test/suite/sys_vars/t/local_infile_func.test
index 00013f779a7..99bb9c65715 100644
--- a/mysql-test/suite/sys_vars/t/local_infile_func.test
+++ b/mysql-test/suite/sys_vars/t/local_infile_func.test
@@ -29,16 +29,12 @@
SET @@global.local_infile = 0;
# con1 will be default connection from now on
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.local_infile;
SET @@global.local_infile = 1;
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
connection con2;
SELECT @@global.local_infile;
disconnect con2;
@@ -49,7 +45,6 @@ disconnect con2;
# Begin the functionality Testing of local_infile #
######################################################
---echo 'connection con1'
connection con1;
#=============================================================
@@ -91,4 +86,3 @@ SET @@global.local_infile = 1;
######################################################
# Endo of functionality Testing for local_infile #
######################################################
-
diff --git a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test
index 0168114b11b..41911d82ac5 100644
--- a/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test
+++ b/mysql-test/suite/sys_vars/t/log_bin_trust_function_creators_func.test
@@ -43,7 +43,6 @@ SET @@global.log_bin_trust_function_creators = 0;
--echo ## Creating new table t2 ##
CREATE TABLE t2 (a INT);
---echo ## Creating & connecting with new connection test_con1 ##
connect (test_con1,localhost,tt,,);
connection test_con1;
@@ -103,13 +102,11 @@ DROP TABLE t1;
# is allowed to create function or not.
########################################################################
---echo ## Switching to default connection ##
connection default;
--echo ## Setting value of variable to 1 ##
SET @@global.log_bin_trust_function_creators = 1;
---echo ## Creating and connecting to new connection test_con2 ##
connect (test_con2,localhost,tt,,);
connection test_con2;
@@ -141,7 +138,6 @@ DROP FUNCTION f1;
--echo ## Dropping table t1 & t2 ##
DROP TABLE t1,t2;
---echo ## Disconnecting test_con2##
disconnect test_con2;
connection default;
diff --git a/mysql-test/suite/sys_vars/t/log_output_func.test b/mysql-test/suite/sys_vars/t/log_output_func.test
index 6b7c01a7dab..eac0040744d 100644
--- a/mysql-test/suite/sys_vars/t/log_output_func.test
+++ b/mysql-test/suite/sys_vars/t/log_output_func.test
@@ -36,12 +36,10 @@ LET $start_general_log_file= `SELECT @@global.general_log_file`;
SET @@global.log_output = 'NONE';
# con1 will be default connection from now on
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
SET @@global.log_output = 'TABLE,FILE';
# Test that the effect is global
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
SELECT @@global.log_output;
@@ -50,7 +48,6 @@ SELECT @@global.log_output;
# Begin the functionality Testing of log_output #
####################################################
---echo 'connection con1'
connection con1;
#===============================================================
@@ -111,7 +108,6 @@ file_exists $MYSQLTEST_VARDIR/run/mytest.log ;
# Clean up
#==============================================================
---echo connection default;
connection default;
SET @@global.general_log= 'OFF';
#SET @@global.general_log_file= @start_general_log_file;
@@ -125,4 +121,3 @@ SET @@global.general_log= 'ON';
####################################################
# End of functionality Testing for log_output #
####################################################
-
diff --git a/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
index 93303b78639..ee25b6d8f5f 100644
--- a/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
+++ b/mysql-test/suite/sys_vars/t/max_allowed_packet_basic.test
@@ -226,4 +226,3 @@ SELECT @@session.max_allowed_packet;
#######################################################
# END OF max_allowed_packet TESTS #
#######################################################
-
diff --git a/mysql-test/suite/sys_vars/t/max_allowed_packet_func.test b/mysql-test/suite/sys_vars/t/max_allowed_packet_func.test
index 0cfbeb4de5f..2ba3d552f6b 100644
--- a/mysql-test/suite/sys_vars/t/max_allowed_packet_func.test
+++ b/mysql-test/suite/sys_vars/t/max_allowed_packet_func.test
@@ -69,7 +69,6 @@ SET @@global.net_buffer_length = 1024;
SELECT @@global.max_allowed_packet;
SELECT @@global.net_buffer_length;
---echo ## Creating new connection test_con1 ##
connect (test_con1,localhost,root,,);
connection test_con1;
@@ -82,4 +81,3 @@ connection default;
drop table t1;
SET @@global.max_allowed_packet= @start_max_allowed_packet;
SET @@global.net_buffer_length= @start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/max_join_size_func.test b/mysql-test/suite/sys_vars/t/max_join_size_func.test
index 0ea0d77bcd6..c649c036565 100644
--- a/mysql-test/suite/sys_vars/t/max_join_size_func.test
+++ b/mysql-test/suite/sys_vars/t/max_join_size_func.test
@@ -80,7 +80,6 @@ SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
# Verifying case where max_join_size is less than the join size #
####################################################################
---echo ## Creating new connection test_con1 ##
connect (test_con1, localhost, root,,);
connection test_con1;
@@ -100,7 +99,6 @@ SELECT * FROM t1 INNER JOIN t2 ON t1.id = t2.id;
--echo ## Setting global value of variable ##
SET @@global.max_join_size=8;
---echo ## Creating and switching to new connection test_con2 ##
connect (test_con2, localhost, root,,);
connection test_con2;
@@ -118,7 +116,5 @@ Drop table t1, t2;
SET @@global.max_join_size = DEFAULT;
SET @@session.max_join_size = DEFAULT;
---echo ## Dropping connections ##
disconnect test_con1;
disconnect test_con2;
-
diff --git a/mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test b/mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test
index d49382b9f4f..f648b23c0a3 100644
--- a/mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test
+++ b/mysql-test/suite/sys_vars/t/max_seeks_for_key_func.test
@@ -97,4 +97,3 @@ disconnect test_con2;
DROP TABLE t1;
SET @@global.max_seeks_for_key= @start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/max_sort_length_func.test b/mysql-test/suite/sys_vars/t/max_sort_length_func.test
index 74642a10861..fd0b87750a1 100644
--- a/mysql-test/suite/sys_vars/t/max_sort_length_func.test
+++ b/mysql-test/suite/sys_vars/t/max_sort_length_func.test
@@ -65,9 +65,7 @@ c TEXT(30)
##########################################################
---echo ** Connecting test_con1 using username 'root' **
connect (test_con1,localhost,root,,);
---echo ** Connection test_con1 **
connection test_con1;
# Value of session & global vairable here should be 10
@@ -100,9 +98,7 @@ SELECT c from t ORDER BY c, id;
# Test behavior of variable on new connection # 02 #
##########################################################
---echo ** Connecting test_con2 using username 'root' **
connect (test_con2,localhost,root,,);
---echo ** Connection test_con2 **
connection test_con2;
@@ -238,10 +234,8 @@ SELECT c from t2 ORDER BY c, id;
# Cleanup
#
---echo ** Connection default **
connection default;
---echo ** Disconnecting test_con1, test_con2 **
disconnect test_con1;
disconnect test_con2;
@@ -254,4 +248,3 @@ DROP TABLE IF EXISTS t2;
--enable_warnings
SET @@global.max_sort_length= @start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test
index ab43536457b..9e0346432e8 100644
--- a/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test
+++ b/mysql-test/suite/sys_vars/t/max_sp_recursion_depth_func.test
@@ -32,9 +32,7 @@ SET @session_max_recursion_depth = @@SESSION.max_sp_recursion_depth;
##########################################################
# Test behavior of variable on new connection # 01 #
##########################################################
---echo ** Connecting test_con1 using username 'root' **
CONNECT (test_con1,localhost,root,,);
---echo ** Connection test_con1 **
CONNECTION test_con1;
@@ -68,9 +66,7 @@ CALL sp_addRecords(0,8);
# Test behavior of variable on new connection # 02 #
##########################################################
---echo ** Connecting test_con2 using username 'root' **
CONNECT (test_con2,localhost,root,,);
---echo ** Connection test_con2 **
connection test_con2;
@@ -165,10 +161,8 @@ CALL sp_addRecords3(0,8);
# Cleanup
#
---echo ** Connection default **
connection default;
---echo ** Disconnecting test_con1, test_con2 **
disconnect test_con1;
disconnect test_con2;
diff --git a/mysql-test/suite/sys_vars/t/max_user_connections_func.test b/mysql-test/suite/sys_vars/t/max_user_connections_func.test
index 2af396b614f..71d4be18962 100644
--- a/mysql-test/suite/sys_vars/t/max_user_connections_func.test
+++ b/mysql-test/suite/sys_vars/t/max_user_connections_func.test
@@ -47,20 +47,16 @@ GRANT USAGE on *.* TO test@localhost;
#Should not make more then 2 connection#
########################################
---echo ** Connecting conn1 using username 'test' **
CONNECT (conn1,localhost,test,,);
---echo ** Connecting conn2 using username 'test' **
CONNECT (conn2,localhost,test,,);
---echo ** Connecting conn3 using username 'test' **
--disable_query_log
--Error ER_TOO_MANY_USER_CONNECTIONS
CONNECT (conn3,localhost,test,,);
--enable_query_log
--echo Expected error "too many connections"
---echo ** Disconnecting conn1 **
DISCONNECT conn1;
--echo ** Poll till disconnected conn1 disappears from processlist
@@ -75,19 +71,15 @@ let $wait_condition= SELECT count(id) <= 2
connection default;
Set Global max_user_connections=3;
---echo ** Connecting conn5 using username 'test' **
CONNECT (conn5,localhost,test,,);
---echo ** Connecting conn6 using username 'test' **
CONNECT (conn6,localhost,test,,);
#
# Cleanup
#
---echo ** Connection default **
CONNECTION default;
---echo ** Disconnecting conn5, conn6 **
DISCONNECT conn2;
DISCONNECT conn5;
DISCONNECT conn6;
@@ -95,4 +87,3 @@ DISCONNECT conn6;
drop user test@localhost;
SET @@global.max_user_connections = @default_max_user_connections;
-
diff --git a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
index 6f1a50cf64e..48016056886 100644
--- a/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
+++ b/mysql-test/suite/sys_vars/t/myisam_data_pointer_size_func.test
@@ -29,15 +29,11 @@ call mtr.add_suppression("The table 't1' is full");
SET @start_value= @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 2;
# con1 will be default connection from now on
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.myisam_data_pointer_size;
SET @@global.myisam_data_pointer_size = 3;
---echo 'connect (con2,localhost,root,,,,)'
connect (con2,localhost,root,,,,);
---echo 'connection con2'
connection con2;
SELECT @@global.myisam_data_pointer_size;
disconnect con2;
@@ -48,7 +44,6 @@ disconnect con2;
# Begin the functionality Testing of myisam_data_pointer_size #
#################################################################
---echo 'connection con1'
connection con1;
#===========================================================
diff --git a/mysql-test/suite/sys_vars/t/myisam_stats_method_func.test b/mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
index a317f8d93da..42335f00c41 100644
--- a/mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
+++ b/mysql-test/suite/sys_vars/t/myisam_stats_method_func.test
@@ -27,9 +27,7 @@
SET @start_value = @@global.myisam_stats_method;
SET @@global.myisam_stats_method = nulls_equal;
---echo 'connect (con1,localhost,root,,,,)'
connect (con1,localhost,root,,,,);
---echo 'connection con1'
connection con1;
SELECT @@global.myisam_stats_method;
SELECT @@session.myisam_stats_method;
@@ -40,7 +38,6 @@ disconnect con1;
# Begin the functionality Testing of myisam_stats_method #
###########################################################
---echo 'connection default'
connection default;
--disable_warnings
@@ -108,4 +105,3 @@ SET @@global.myisam_stats_method= @start_value;
########################################################
# End of functionality Testing for myisam_stats_method #
########################################################
-
diff --git a/mysql-test/suite/sys_vars/t/old_passwords_func.test b/mysql-test/suite/sys_vars/t/old_passwords_func.test
index 2707fc3ab6d..bf1d7dcc874 100644
--- a/mysql-test/suite/sys_vars/t/old_passwords_func.test
+++ b/mysql-test/suite/sys_vars/t/old_passwords_func.test
@@ -33,7 +33,6 @@ SET @global_secure_auth = @@GLOBAL.secure_auth;
--echo '#------------------------FN_DYNVARS_115_01---------------------------#'
---echo ** Connection default **
connection default;
#
@@ -54,25 +53,20 @@ CREATE USER 'userOldPass'@'localhost' IDENTIFIED BY 'pass3';
SET GLOBAL secure_auth = FALSE;
---echo ** Connecting con1 using username 'userNewPass1' **
connect (con1,localhost,userNewPass1,pass1,);
SELECT CURRENT_USER();
--echo userNewPass1@localhost Expected
---echo ** Connecting con2 using username 'userNewPass2' **
connect (con2,localhost,userNewPass2,pass2,);
SELECT CURRENT_USER();
--echo userNewPass2@localhost Expected
---echo ** Connecting con3 using username 'userOldPass' **
connect (con3,localhost,userOldPass,pass3,);
SELECT CURRENT_USER();
--echo userOldPass@localhost Expected
---echo ** Connection default **
connection default;
---echo ** Disconnecting con1, con2, con3 **
disconnect con1;
disconnect con2;
disconnect con3;
@@ -81,17 +75,14 @@ disconnect con3;
SET GLOBAL secure_auth = TRUE;
---echo ** Connecting con1 using username 'userNewPass1' **
connect (con1,localhost,userNewPass1,pass1,);
SELECT CURRENT_USER();
--echo userNewPass1@localhost Expected
---echo ** Connecting con2 using username 'userNewPass2' **
connect (con2,localhost,userNewPass2,pass2,);
SELECT CURRENT_USER();
--echo userNewPass2@localhost Expected
---echo ** Connecting con3 using username 'userOldPass' **
--disable_query_log
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (con3,localhost,userOldPass,pass3,);
@@ -100,10 +91,8 @@ connect (con3,localhost,userOldPass,pass3,);
SELECT CURRENT_USER();
--echo userNewPass2@localhost Expected
---echo ** Connection default **
connection default;
---echo ** Disconnecting con1, con2 **
disconnect con1;
disconnect con2;
diff --git a/mysql-test/suite/sys_vars/t/query_cache_type_func.test b/mysql-test/suite/sys_vars/t/query_cache_type_func.test
index e015e374aeb..e1b5f4d1a12 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_type_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_type_func.test
@@ -29,9 +29,7 @@
# Save initial value
#
---echo ** Connecting to con0 using root **
connect (con0,localhost,root,,);
---echo ** Connection con0 **
connection con0;
SET @start_global_value = @@GLOBAL.query_cache_type;
@@ -254,10 +252,8 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
SET @@GLOBAL.query_cache_type = OFF;
---echo ** Connecting con1 using root **
connect (con1,localhost,root,,);
---echo ** Connection con1 **
connection con1;
SELECT @@query_cache_type;
@@ -269,10 +265,8 @@ SELECT @@query_cache_type;
#
SET @@GLOBAL.query_cache_type = DEMAND;
---echo ** Connecting con2 using root **
connect (con2,localhost,root,,);
---echo ** Connection con2 **
connection con2;
SELECT @@query_cache_type;
@@ -284,9 +278,7 @@ SELECT @@query_cache_type;
#
SET @@GLOBAL.query_cache_type = ON;
---echo ** Connecting con3 using root **
connect (con3,localhost,root,,);
---echo ** Connection con3 **
connection con3;
SELECT @@query_cache_type;
@@ -299,12 +291,10 @@ SELECT @@query_cache_type;
# Cleanup
#
---echo Disconnecting con1,con2,con3
disconnect con1;
disconnect con2;
disconnect con3;
---echo ** Connection con0 **
connection con0;
SET @@GLOBAL.query_cache_type = @start_global_value;
@@ -315,6 +305,4 @@ DROP TABLE t1;
DROP PROCEDURE testProcHit;
---echo Disconnecting con0
disconnect con0;
-
diff --git a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
index 5c7533eb50a..6b38e3fa342 100644
--- a/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
+++ b/mysql-test/suite/sys_vars/t/query_cache_wlock_invalidate_func.test
@@ -37,11 +37,8 @@
#
# Save initial value
#
---echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
---echo ** Connecting con1 using root **
connect (con1, localhost, root,,);
---echo ** Connection con0 **
connection con0;
SET @start_global_value = @@GLOBAL.query_cache_wlock_invalidate;
@@ -82,12 +79,10 @@ SET GLOBAL query_cache_type = ON;
#
--echo Testing for value ON
---echo ** Connection con0 **
connection con0;
SET SESSION query_cache_wlock_invalidate = ON;
---echo ** Connection con1 **
connection con1;
SET SESSION query_cache_wlock_invalidate = ON;
@@ -124,23 +119,19 @@ SHOW STATUS LIKE 'Qcache_queries_in_cache';
enable_result_log;
---echo ** Connection con1 **
connection con1;
SELECT * FROM t1;
---echo ** Connection con0 **
connection con0;
LOCK TABLE t1 WRITE;
---echo ** Connection con1 **
connection con1;
--echo ** Asynchronous Execution **
send SELECT * FROM t1;
---echo ** Connection con0 **
connection con0;
--echo wait until table is locked
@@ -149,7 +140,6 @@ let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist
--source include/wait_condition.inc
UNLOCK TABLES;
---echo ** Connection con1 **
connection con1;
--echo ** Asynchronous Result **
reap;
@@ -159,12 +149,10 @@ reap;
#
--echo Testing for value OFF
---echo ** Connection con0 **
connection con0;
SET SESSION query_cache_wlock_invalidate = OFF;
---echo ** Connection con1 **
connection con1;
SET SESSION query_cache_wlock_invalidate = OFF;
@@ -198,27 +186,22 @@ SELECT * FROM t1;
SHOW STATUS LIKE 'Qcache_queries_in_cache';
--echo 1 Expected
---echo ** Connection con1 **
connection con1;
SELECT * FROM t1;
---echo ** Connection con0 **
connection con0;
LOCK TABLE t1 WRITE;
---echo ** Connection con1 **
connection con1;
--echo ** Should not be blocked **
SELECT * FROM t1;
SELECT * FROM t1;
SELECT * FROM t1;
---echo ** Connection con0 **
connection con0;
UNLOCK TABLES;
---echo ** Connection con1 **
connection con1;
--echo '#----------------------------FN_DYNVARS_136_05------------------------#'
@@ -228,18 +211,14 @@ connection con1;
SET GLOBAL query_cache_wlock_invalidate = OFF;
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.query_cache_wlock_invalidate;
--echo Expected Value : 0 / OFF;
SET SESSION query_cache_wlock_invalidate = ON;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.query_cache_wlock_invalidate;
@@ -247,12 +226,10 @@ SELECT @@SESSION.query_cache_wlock_invalidate;
SET SESSION query_cache_wlock_invalidate = OFF;
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.query_cache_wlock_invalidate;
--echo Expected Value : 1 / ON;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.query_cache_wlock_invalidate;
--echo Expected Value : 0 / OFF;
@@ -260,9 +237,7 @@ SELECT @@SESSION.query_cache_wlock_invalidate;
SELECT @@GLOBAL.query_cache_wlock_invalidate;
--echo Expected Value : 0 / OFF;
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
@@ -272,7 +247,6 @@ disconnect con_int2;
--echo
--echo CLEANUP
---echo ** Connection con0 **
connection con0;
SET @@GLOBAL.query_cache_wlock_invalidate = @start_global_value;
@@ -280,13 +254,10 @@ SET @@SESSION.query_cache_wlock_invalidate = @start_session_value ;
SET @@GLOBAL.query_cache_size = @old_cache_size;
SET @@GLOBAL.query_cache_type = @old_cache_type;
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
DROP TABLE t1;
--enable_ps_protocol
-
diff --git a/mysql-test/suite/sys_vars/t/query_prealloc_size_func.test b/mysql-test/suite/sys_vars/t/query_prealloc_size_func.test
index 7267b9e317e..ff765539d9a 100644
--- a/mysql-test/suite/sys_vars/t/query_prealloc_size_func.test
+++ b/mysql-test/suite/sys_vars/t/query_prealloc_size_func.test
@@ -89,4 +89,3 @@ disconnect con_int2;
DROP TABLE t1;
SET @@global.query_prealloc_size = @start_value;
-
diff --git a/mysql-test/suite/sys_vars/t/read_only_func.test b/mysql-test/suite/sys_vars/t/read_only_func.test
index c8fb932544b..bc3991aee7c 100644
--- a/mysql-test/suite/sys_vars/t/read_only_func.test
+++ b/mysql-test/suite/sys_vars/t/read_only_func.test
@@ -81,7 +81,6 @@ select * from t1 where id=1;
--echo ** Creating new user with out super privilege**
CREATE user sameea;
---echo ** Connecting connn using username 'sameea' **
CONNECT (connn,localhost,sameea,,);
--Error ER_SPECIFIC_ACCESS_DENIED_ERROR
@@ -114,11 +113,9 @@ CREATE TEMPORARY TABLE t3(a int);
###########################
# Turning read_only OFF #
###########################
---echo ** Connection default **
connection default;
SET Global read_only=OFF;
---echo ** Connection connn **
connection connn;
CREATE TABLE t2
@@ -135,10 +132,8 @@ UPDATE t2 SET name="samia" where id=1;
#
# Cleanup
#
---echo ** Connection default **
connection default;
---echo ** Disconnecting connn **
DISCONNECT connn;
DROP USER sameea;
diff --git a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
index 1d57bfeddc5..f8cbc54fc70 100644
--- a/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
+++ b/mysql-test/suite/sys_vars/t/rpl_init_slave_func.test
@@ -29,7 +29,6 @@
###############################################################################
source include/master-slave.inc;
---echo connection slave
connection slave;
--disable_query_log
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT");
diff --git a/mysql-test/suite/sys_vars/t/secure_auth_func.test b/mysql-test/suite/sys_vars/t/secure_auth_func.test
index 10dc383035d..905164ba893 100644
--- a/mysql-test/suite/sys_vars/t/secure_auth_func.test
+++ b/mysql-test/suite/sys_vars/t/secure_auth_func.test
@@ -56,10 +56,8 @@ SET GLOBAL secure_auth = OFF;
#
CREATE USER 'testUser'@'localhost' IDENTIFIED BY 'newpass';
---echo ** Connecting con_user1 using testUser **
connect (con_user1,localhost,testUser,newpass,);
---echo ** Connection default**
connection default;
#
@@ -67,10 +65,8 @@ connection default;
#
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
---echo ** Connecting con_user2 using testUser **
connect (con_user2,localhost,testUser,newpass,);
---echo ** Connection default**
connection default;
--echo '#--------------------FN_DYNVARS_144_03-------------------------#'
@@ -84,9 +80,7 @@ SET GLOBAL secure_auth = ON;
#
SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass');
---echo ** Connecting con_user3 using testUser **
connect (con_user3,localhost,testUser,newpass,);
---echo ** Connection default **
connection default;
#
@@ -94,14 +88,12 @@ connection default;
#
SET PASSWORD FOR 'testUser'@'localhost' = OLD_PASSWORD('newpass');
---echo ** Connecting con_user4 using testUser **
--disable_query_log
--error ER_SERVER_IS_IN_SECURE_AUTH_MODE
connect (con_user4,localhost,testUser,newpass,);
--enable_query_log
--echo Expected error "Server is in secure auth mode"
---echo ** Connection default**
connection default;
#
@@ -109,10 +101,8 @@ connection default;
#
SET PASSWORD FOR 'testUser'@'localhost' = PASSWORD('newpass');
---echo ** Connecting con_user4 using testUser **
connect (con_user4,localhost,testUser,newpass,);
---echo ** Connection default **
connection default;
#
@@ -121,7 +111,6 @@ connection default;
SET GLOBAL secure_auth = @old_secure_auth;
---echo Disconnecting Connections con_user1, con_user2, con_user3, con_user4
disconnect con_user1;
disconnect con_user2;
disconnect con_user3;
diff --git a/mysql-test/suite/sys_vars/t/slow_launch_time_func.test b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
index 4a4951535ac..c3725044898 100644
--- a/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_launch_time_func.test
@@ -32,7 +32,6 @@
--source include/one_thread_per_connection.inc
SET @global_slow_launch_time = @@GLOBAL.slow_launch_time;
---echo ** Connection default **
connection default;
--echo '#--------------------FN_DYNVARS_124_01-------------------------#'
@@ -48,7 +47,6 @@ SELECT @@GLOBAL.slow_launch_time;
let $value_before=
query_get_value(show status like 'slow_launch_threads', Value, 1);
---echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
let $value_after=
query_get_value(show status like 'slow_launch_threads', Value, 1);
@@ -61,7 +59,6 @@ if (!`SELECT $value_after = $value_before + 1`)
echo Number of slow_launch_threads before new connect: $value_before;
echo Number of slow_launch_threads after new connect: $value_after;
}
---echo ** Switch to connection default and disconnect conn1 **
connection default;
disconnect conn1;
@@ -78,7 +75,6 @@ SELECT @@GLOBAL.slow_launch_time;
let $value_before=
query_get_value(show status like 'slow_launch_threads', Value, 1);
---echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
let $value_after=
query_get_value(show status like 'slow_launch_threads', Value, 1);
@@ -96,7 +92,6 @@ if ($value_after != $value_before)
# Cleanup
#
---echo ** Switch to connection default and disconnect conn2 **
connection default;
disconnect conn2;
SET @@GLOBAL.slow_launch_time = @global_slow_launch_time;
diff --git a/mysql-test/suite/sys_vars/t/slow_query_log_func.test b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
index 2f1d7449976..0c77dbff226 100644
--- a/mysql-test/suite/sys_vars/t/slow_query_log_func.test
+++ b/mysql-test/suite/sys_vars/t/slow_query_log_func.test
@@ -124,11 +124,9 @@ BEGIN
END|
delimiter ;|
---echo Connection 2
connection con2;
LOCK TABLE t1 WRITE;
---echo Back to default connection
connection default;
send CALL p1();
@@ -155,4 +153,3 @@ SET @global.slow_query_log = @global_slow_query_log;
###############################################################################
# End of the functionality test for slow_query_log #
###############################################################################
-
diff --git a/mysql-test/suite/sys_vars/t/sql_big_selects_func.test b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
index 6cff8cfe553..59d8184861d 100644
--- a/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_big_selects_func.test
@@ -80,20 +80,16 @@ SELECT * FROM t1 INNER JOIN t2 ON t1.a = t2.a;
# Session data integrity check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_big_selects;
--echo 1 Expected
SET SESSION sql_big_selects = 0;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_big_selects;
@@ -101,22 +97,18 @@ SELECT @@SESSION.sql_big_selects;
SET SESSION sql_big_selects = 1;
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_big_selects;
--echo 0 Expected
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_big_selects;
--echo 1 Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
index 4530545b8f0..0f6084b65f6 100644
--- a/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_buffer_result_func.test
@@ -78,10 +78,8 @@ SHOW STATUS LIKE 'Created_tmp_tables';
#
# Session data integrity check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_buffer_result;
@@ -89,10 +87,8 @@ SELECT @@SESSION.sql_buffer_result;
SET SESSION sql_buffer_result = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_buffer_result;
@@ -100,22 +96,18 @@ SELECT @@SESSION.sql_buffer_result;
SET SESSION sql_buffer_result = TRUE;
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_buffer_result;
--echo 0 / FALSE Expected
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_buffer_result;
--echo 1 / TRUE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_log_off_func.test b/mysql-test/suite/sys_vars/t/sql_log_off_func.test
index fb06a12b264..3c5c189ba1e 100644
--- a/mysql-test/suite/sys_vars/t/sql_log_off_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_log_off_func.test
@@ -70,38 +70,30 @@ SELECT argument FROM mysql.general_log WHERE argument = 'UPDATE t1 SET a = \'aa1
#
# Session data integrity check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_log_off;
--echo 0 / FALSE Expected
SET SESSION sql_log_off = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_log_off;
--echo 0 / FALSE Expected
SET SESSION sql_log_off = TRUE;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_log_off;
--echo 1 / TRUE Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_log_off;
--echo 0 / FALSE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
index ba13558a135..7939f3dfda0 100644
--- a/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_low_priority_updates_func.test
@@ -30,12 +30,9 @@
#
# Setup
#
---echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
---echo ** Connecting con1 using root **
connect (con1,localhost,root,,);
---echo ** Connection default **
connection default;
SET @global_low_priority_updates = @@GLOBAL.low_priority_updates;
@@ -53,13 +50,10 @@ create view v1 as select * from t1;
# Value ON
#
---echo ** Connection con0 **
connection con0;
SET SESSION low_priority_updates = ON;
---echo ** Connection con1 **
connection con1;
SET SESSION low_priority_updates = ON;
---echo ** Connection default **
connection default;
SET SESSION low_priority_updates = ON;
@@ -72,7 +66,6 @@ INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE;
---echo ** Connection con1 **
connection con1;
--echo ** Asynchronous Execution **
@@ -83,7 +76,6 @@ UPDATE t1 SET a = CONCAT(a,"-updated");|
delimiter ;|
---echo ** Connection con0 **
connection con0;
let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist
@@ -101,7 +93,6 @@ UNLOCK TABLES;|
delimiter ;|
---echo ** Connection default **
connection default;
let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist
@@ -109,14 +100,12 @@ let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist
--source include/wait_condition.inc
UNLOCK TABLES;
---echo ** Connection con0 **
connection con0;
--echo ** Asynchronous Result **
reap;
--echo Expected values of a without -updated;
---echo ** Connection default **
connection default;
DELETE FROM t1;
@@ -126,14 +115,11 @@ DELETE FROM t1;
# Value ON
#
---echo ** Connection con0 **
connection con0;
SET SESSION low_priority_updates = OFF;
---echo ** Connection con1 **
connection con1;
reap;
SET SESSION low_priority_updates = OFF;
---echo ** Connection default**
connection default;
SET SESSION low_priority_updates = OFF;
@@ -146,7 +132,6 @@ INSERT INTO t1 VALUES('6');
LOCK TABLE v1 WRITE;
---echo ** Connection con1 **
connection con1;
--echo ** Asynchronous Execution **
@@ -157,7 +142,6 @@ UPDATE t1 SET a = CONCAT(a,"-updated");|
delimiter ;|
---echo ** Connection con0 **
connection con0;
let $wait_condition = SELECT COUNT(*) > 0 FROM information_schema.processlist
@@ -175,7 +159,6 @@ UNLOCK TABLES;|
delimiter ;|
---echo ** Connection default **
connection default;
let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist
@@ -183,13 +166,11 @@ let $wait_condition= SELECT count(*) = 2 FROM information_schema.processlist
--source include/wait_condition.inc
UNLOCK TABLES;
---echo ** Connection con0 **
connection con0;
--echo ** Asynchronous Result **
reap;
--echo Expected values of a with -updated;
---echo ** Connection default**
connection default;
DELETE FROM t1;
@@ -199,40 +180,32 @@ DELETE FROM t1;
# Session data integrity check & GLOBAL Value check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.low_priority_updates;
--echo 1 / TRUE Expected
SET SESSION low_priority_updates = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.low_priority_updates;
--echo 1 / TRUE Expected
SET SESSION low_priority_updates = TRUE;
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.low_priority_updates;
--echo 0 / FALSE Expected
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.low_priority_updates;
--echo 1 / TRUE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
@@ -240,9 +213,7 @@ disconnect con_int2;
# Cleanup
#
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
diff --git a/mysql-test/suite/sys_vars/t/sql_mode_func.test b/mysql-test/suite/sys_vars/t/sql_mode_func.test
index 5bb804c26da..5a5aca91c31 100644
--- a/mysql-test/suite/sys_vars/t/sql_mode_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_mode_func.test
@@ -148,32 +148,26 @@ SELECT * FROM t1 WHERE a = 't2a2';
#
SET GLOBAL sql_mode = '';
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_mode;
--echo '' Expected
SET SESSION sql_mode = 'TRADITIONAL';
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_mode;
--echo '' Expected
SET SESSION sql_mode = 'ANSI';
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_mode;
--echo 'REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, ANSI' Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_mode;
--echo 'STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER, TRADITIONAL' Expected
@@ -182,10 +176,8 @@ SELECT @@SESSION.sql_mode;
SELECT @@GLOBAL.sql_mode;
--echo '' Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_notes_func.test b/mysql-test/suite/sys_vars/t/sql_notes_func.test
index f7c521d3736..737bd044ded 100644
--- a/mysql-test/suite/sys_vars/t/sql_notes_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_notes_func.test
@@ -83,39 +83,31 @@ SELECT @@warning_count;
# Session data integrity check & GLOBAL Value check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_notes;
--echo 1 / TRUE Expected
SET SESSION sql_notes = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_notes;
--echo 1 / TRUE Expected
SET SESSION sql_notes = TRUE;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_notes;
--echo 1 / TRUE Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_notes;
--echo 0 / FALSE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
@@ -131,4 +123,3 @@ DROP TABLE IF EXISTS t1;
--enable_warnings
--enable_ps_protocol
-
diff --git a/mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test b/mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test
index 6350771a0da..2800061890a 100644
--- a/mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_quote_show_create_func.test
@@ -65,40 +65,32 @@ SHOW CREATE TABLE t1;
# Session data integrity check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_quote_show_create;
--echo 1 / TRUE Expected
SET SESSION sql_quote_show_create = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_quote_show_create;
--echo 1 / TRUE Expected
SET SESSION sql_quote_show_create = TRUE;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_quote_show_create;
--echo 1 / TRUE Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_quote_show_create;
--echo 0 / FALSE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_safe_updates_func.test b/mysql-test/suite/sys_vars/t/sql_safe_updates_func.test
index a8ce3a8d0f7..5643fb5c4d8 100644
--- a/mysql-test/suite/sys_vars/t/sql_safe_updates_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_safe_updates_func.test
@@ -155,40 +155,32 @@ DEALLOCATE PREPARE stmt;
# Session data integrity check
#
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_safe_updates;
--echo 0 / FALSE Expected
SET SESSION sql_safe_updates = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_safe_updates;
--echo 0 / FALSE Expected
SET SESSION sql_safe_updates = TRUE;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_safe_updates;
--echo 1 / TRUE Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_safe_updates;
--echo 0 / FALSE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_select_limit_func.test b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test
index 99bc05c465c..c818a4ce04f 100644
--- a/mysql-test/suite/sys_vars/t/sql_select_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_select_limit_func.test
@@ -161,32 +161,26 @@ INSERT INTO t3 SELECT * FROM t1;
SET GLOBAL sql_select_limit = 2;
---echo ** Connecting con_int2 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_select_limit;
--echo 2 Expected
SET SESSION sql_select_limit = 10;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_select_limit;
--echo 2 Expected
SET SESSION sql_select_limit = 12;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_select_limit;
--echo 12 Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_select_limit;
--echo 10 Expected
@@ -194,10 +188,8 @@ SELECT @@SESSION.sql_select_limit;
SELECT @@GLOBAL.sql_select_limit;
--echo 2 Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/sql_warnings_func.test b/mysql-test/suite/sys_vars/t/sql_warnings_func.test
index e7705d1f146..558c5b7d36a 100644
--- a/mysql-test/suite/sys_vars/t/sql_warnings_func.test
+++ b/mysql-test/suite/sys_vars/t/sql_warnings_func.test
@@ -70,40 +70,32 @@ INSERT INTO t1 VALUES('abcdef', 'val1');
--disable_info
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_warnings;
--echo 0 / FALSE Expected
SET SESSION sql_warnings = FALSE;
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_warnings;
--echo 0 / FALSE Expected
SET SESSION sql_warnings = TRUE;
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.sql_warnings;
--echo 1 / TRUE Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.sql_warnings;
--echo 0 / FALSE Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/thread_cache_size_func.test b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
index 7382fd671a9..30d5188a927 100644
--- a/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
+++ b/mysql-test/suite/sys_vars/t/thread_cache_size_func.test
@@ -42,16 +42,11 @@ SHOW STATUS LIKE 'Threads_cached';
# Make 4 connections #
##################################
---echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
---echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
---echo ** Connecting conn3 using username 'root' **
CONNECT (conn3,localhost,root,,);
---echo ** Connecting conn4 using username 'root' **
CONNECT (conn4,localhost,root,,);
---echo ** Connection default **
CONNECTION default;
# Wait until all connections done
@@ -65,7 +60,6 @@ SHOW STATUS LIKE 'Threads_cached';
#Disconnecting all the connections #
####################################
---echo ** Disconnecting conn1,conn2,conn3,conn4 **
DISCONNECT conn1;
DISCONNECT conn2;
DISCONNECT conn3;
@@ -87,19 +81,15 @@ SHOW STATUS LIKE 'Threads_cached';
#
SET @@GLOBAL.thread_cache_size= 1;
---echo ** Connecting conn1 using username 'root' **
CONNECT (conn1,localhost,root,,);
---echo ** Connecting conn2 using username 'root' **
CONNECT (conn2,localhost,root,,);
---echo connection default;
CONNECTION default;
# Wait until all connects ready
let $wait_condition= SELECT COUNT(*)= 3 FROM INFORMATION_SCHEMA.PROCESSLIST;
--source include/wait_condition.inc
---echo ** Disconnecting conn1,conn2 **
DISCONNECT conn1;
DISCONNECT conn2;
@@ -115,4 +105,3 @@ SHOW STATUS LIKE 'Threads_cached';
#
SET @@GLOBAL.thread_cache_size = @global_thread_cache_size;
-
diff --git a/mysql-test/suite/sys_vars/t/time_zone_func.test b/mysql-test/suite/sys_vars/t/time_zone_func.test
index 1d9bc954d8a..f9d062bab50 100644
--- a/mysql-test/suite/sys_vars/t/time_zone_func.test
+++ b/mysql-test/suite/sys_vars/t/time_zone_func.test
@@ -134,32 +134,26 @@ SET @@time_zone = '6';
SET GLOBAL time_zone = 'SYSTEM';
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.time_zone;
--echo SYSTEM Expected
SET SESSION time_zone = '+05:00';
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.time_zone;
--echo SYSTEM Expected
SET SESSION time_zone = '-10:00';
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.time_zone;
--echo -10:00 Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.time_zone;
--echo +05:00 Expected
@@ -168,10 +162,8 @@ SELECT @@SESSION.time_zone;
SELECT @@GLOBAL.time_zone;
--echo SYSTEM Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
diff --git a/mysql-test/suite/sys_vars/t/timestamp_func.test b/mysql-test/suite/sys_vars/t/timestamp_func.test
index e93614e89fb..6157a1bc916 100644
--- a/mysql-test/suite/sys_vars/t/timestamp_func.test
+++ b/mysql-test/suite/sys_vars/t/timestamp_func.test
@@ -24,27 +24,21 @@
# All comparisons must deliver true(1)
# Exception: --sysdate-is-now switches off this behaviour and must not be set.
---echo ** Connecting con1 using root **
connect (con1,localhost,root,,);
SELECT date(now()) = date(sysdate());
SET @@session.timestamp = 1100000000;
SELECT date(now()) != date(sysdate());
# Assure that setting of the variable has no effect on other session.
---echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
SELECT @@session.timestamp != 1100000000;
SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());
---echo ** Connection con1 **
connection con1;
SELECT @@session.timestamp != 1000000000;
SELECT @@session.timestamp = 1100000000;
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
-
diff --git a/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test b/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test
index 7ca3b4cddac..80457f3c707 100644
--- a/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test
+++ b/mysql-test/suite/sys_vars/t/timestamp_sysdate_is_now_func.test
@@ -21,27 +21,21 @@
# Due to "--sysdate-is-now" timestamp must have an effect on both.
# See also timestamp_func.test.
---echo ** Connecting con1 using root **
connect (con1,localhost,root,,);
SELECT date(now()) = date(sysdate());
SET @@session.timestamp = 1100000000;
SELECT date(now()) != date(sysdate());
# Assure that setting of the variable has no effect on other session.
---echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
SELECT @@session.timestamp != 1100000000;
SET @@session.timestamp = 1000000000;
SELECT date(now()) != date(sysdate());
---echo ** Connection con1 **
connection con1;
SELECT @@session.timestamp != 1000000000;
SELECT @@session.timestamp = 1100000000;
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
-
diff --git a/mysql-test/suite/sys_vars/t/tx_isolation_func.test b/mysql-test/suite/sys_vars/t/tx_isolation_func.test
index 7072de6b086..164422be06a 100644
--- a/mysql-test/suite/sys_vars/t/tx_isolation_func.test
+++ b/mysql-test/suite/sys_vars/t/tx_isolation_func.test
@@ -33,23 +33,18 @@ SET @global_tx_isolation = @@GLOBAL.tx_isolation;
# Creating connections
#
---echo ** Connecting con0 using root **
connect (con0,localhost,root,,);
---echo ** Connection con0 **
connection con0;
SET SESSION AUTOCOMMIT = OFF;
---echo ** Connecting con1 using root **
connect (con1, localhost, root,,);
---echo ** Connection con1 **
connection con1;
SET SESSION AUTOCOMMIT = OFF;
---echo ** Connection default **
connection default;
#
@@ -72,12 +67,10 @@ INSERT INTO t1 VALUES(24, 24);
#
# Testing for value READ-UNCOMMITTED
#
---echo ** Connection con0 **
connection con0;
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
---echo ** Connection con1 **
connection con1;
SET SESSION tx_isolation = 'READ-UNCOMMITTED';
set binlog_format=mixed;
@@ -85,7 +78,6 @@ set binlog_format=mixed;
#
# Testing WHERE on keys using IN clause
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -93,7 +85,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8) FOR UPDATE;
UPDATE t1 SET b = 10 WHERE a IN (2,4,6,8);
---echo ** Connection con1 **
connection con1;
START TRANSACTION;
@@ -107,7 +98,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
DELETE FROM t1 WHERE a = 1 OR a = 3;
@@ -119,7 +109,6 @@ COMMIT;
# Testing WHERE on keys using # on even rows
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -127,7 +116,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
UPDATE t1 SET b = 10 WHERE a % 2 = 0;
---echo ** Connection con1 **
connection con1;
START TRANSACTION;
@@ -142,7 +130,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
COMMIT;
@@ -151,18 +138,15 @@ COMMIT;
#
# Testing for value READ-COMMITTED
#
---echo ** Connection con0 **
connection con0;
SET SESSION tx_isolation = 'READ-COMMITTED';
---echo ** Connection con1 **
connection con1;
SET SESSION tx_isolation = 'READ-COMMITTED';
#
# Testing WHERE on keys using % on even rows
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -170,7 +154,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
UPDATE t1 SET b = 11 WHERE a % 2 = 0;
---echo ** Connection con1 **
connection con1;
START TRANSACTION;
@@ -184,7 +167,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
COMMIT;
@@ -194,18 +176,15 @@ COMMIT;
#
# Testing for value REPEATABLE-READ
#
---echo ** Connection con0 **
connection con0;
SET SESSION tx_isolation = 'REPEATABLE-READ';
---echo ** Connection con1 **
connection con1;
SET SESSION tx_isolation = 'REPEATABLE-READ';
#
# Testing WHERE on keys using % on even rows
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -213,7 +192,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
UPDATE t1 SET b = 12 WHERE a % 2 = 0;
---echo ** Connection con1 **
connection con1;
START TRANSACTION;
@@ -230,7 +208,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
COMMIT;
@@ -239,7 +216,6 @@ COMMIT;
#
# Testing WHERE on keys using IN clause
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -247,7 +223,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0 FOR UPDATE;
UPDATE t1 SET b = 13 WHERE a IN (2,4,6,8,10,12,14,16,18,20,22,24,26) = 0;
---echo ** Connection con1 **
connection con1;
START TRANSACTION;
@@ -264,7 +239,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
COMMIT;
@@ -273,7 +247,6 @@ COMMIT;
#
# Testing WHERE on keys using IN clause
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -281,7 +254,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a IN (2,4,6,8) = 0 FOR UPDATE;
UPDATE t1 SET b = 14 WHERE a IN (2,4,6,8) = 0;
---echo ** Connection con1 **
connection con1;
START TRANSACTION;
@@ -298,7 +270,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
COMMIT;
@@ -307,18 +278,15 @@ COMMIT;
#
# Testing for value SERIALIZABLE
#
---echo ** Connection con0 **
connection con0;
SET SESSION tx_isolation = 'SERIALIZABLE';
---echo ** Connection con0 **
connection con1;
SET SESSION tx_isolation = 'SERIALIZABLE';
#
# Testing WHERE on keys using # on even rows
#
---echo ** Connection con0 **
connection con0;
START TRANSACTION;
@@ -326,7 +294,6 @@ START TRANSACTION;
SELECT * FROM t1 WHERE a % 2 = 0 FOR UPDATE;
UPDATE t1 SET b = 15 WHERE a % 2 = 0;
---echo ** Connection con0 **
connection con1;
START TRANSACTION;
@@ -344,7 +311,6 @@ SELECT * FROM t1;
COMMIT;
---echo ** Connection con0 **
connection con0;
COMMIT;
@@ -356,32 +322,26 @@ COMMIT;
#
SET GLOBAL tx_isolation = 'READ-UNCOMMITTED';
---echo ** Connecting con_int1 using root **
connect (con_int1,localhost,root,,);
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.tx_isolation;
--echo READ-UNCOMMITTED Expected
SET SESSION tx_isolation = 'SERIALIZABLE';
---echo ** Connecting con_int2 using root **
connect (con_int2,localhost,root,,);
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.tx_isolation;
--echo READ-UNCOMMITTED Expected
SET SESSION tx_isolation = 'REPEATABLE-READ';
---echo ** Connection con_int2 **
connection con_int2;
SELECT @@SESSION.tx_isolation;
--echo REPEATABLE-READ Expected
---echo ** Connection con_int1 **
connection con_int1;
SELECT @@SESSION.tx_isolation;
--echo SERIALIZABLE Expected
@@ -390,10 +350,8 @@ SELECT @@SESSION.tx_isolation;
SELECT @@GLOBAL.tx_isolation;
--echo READ-UNCOMMITTED Expected
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con_int1, con_int2
disconnect con_int1;
disconnect con_int2;
@@ -404,9 +362,7 @@ disconnect con_int2;
SET @@SESSION.tx_isolation = @session_tx_isolation;
SET @@GLOBAL.tx_isolation = @global_tx_isolation;
---echo ** Connection default **
connection default;
---echo Disconnecting Connections con0, con1
disconnect con0;
disconnect con1;
diff --git a/mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test
index 2e1a3f97346..a2cd1e5523c 100644
--- a/mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test
+++ b/mysql-test/suite/sys_vars/t/updatable_views_with_limit_func.test
@@ -52,9 +52,7 @@ INSERT INTO t1 VALUES (10,2,-1), (20,3,-2),
CREATE VIEW v1 (x,y) AS SELECT a, c FROM t1;
---echo ** Connecting test_con1 using username 'root' **
CONNECT (test_con1,localhost,root,,);
---echo ** Connection test_con1 **
CONNECTION test_con1;
SET @@Session.UPDATABLE_VIEWS_WITH_LIMIT=YES;
@@ -76,9 +74,7 @@ UPDATE v1 SET x=x+5;
SELECT * FROM t1;
---echo ** Connecting test_con2 using username 'root' **
CONNECT (test_con2,localhost,root,,);
---echo ** Connection test_con2 **
CONNECTION test_con2;
SET @@Session.UPDATABLE_VIEWS_WITH_LIMIT=NO;
@@ -127,10 +123,8 @@ UPDATE v1 SET x=x+2 LIMIT 1;
# Cleanup
#
---echo ** Connection default **
connection default;
---echo ** Disconnecting test_con1, test_con2 **
disconnect test_con1;
disconnect test_con2;
@@ -140,4 +134,3 @@ SET @@SESSION.updatable_views_with_limit = @session_updatable_views_with_limit;
DROP VIEW IF EXISTS v1;
DROP TABLE IF EXISTS t1;
--enable_warnings
-
diff --git a/mysql-test/suite/sys_vars/t/wait_timeout_func.test b/mysql-test/suite/sys_vars/t/wait_timeout_func.test
index 313d9e8191d..ee129b147dd 100644
--- a/mysql-test/suite/sys_vars/t/wait_timeout_func.test
+++ b/mysql-test/suite/sys_vars/t/wait_timeout_func.test
@@ -33,7 +33,6 @@ SET @start_value= @@global.wait_timeout;
#######################################################################
SET @start_time= UNIX_TIMESTAMP();
---echo connect (test_con1, localhost, root,,);
connect (test_con1, localhost, root,,);
connection test_con1;
@@ -46,14 +45,12 @@ let $session_value =
--replace_result $session_value <session_value>
eval SET @@session.wait_timeout = $session_value;
---echo connect (test_con2, localhost, root,,);
connect (test_con2, localhost, root,,);
connection test_con2;
--replace_result $session_value <session_value>
eval SET @@session.wait_timeout = $session_value - 1;
---echo connection default;
connection default;
--echo wait until connections ready
@@ -75,14 +72,12 @@ eval SET @@global.wait_timeout= $global_value;
# @@session.wait_timeout of already established sessions.
SELECT @@session.wait_timeout = @start_value AS 'Expect 1';
---echo connect (test_con3, localhost, root,,);
connect (test_con3, localhost, root,,);
connection test_con3;
# If not explicitly changed, @@session.wait_timeout equals @@global.wait_timeout.
SELECT @@session.wait_timeout = @@global.wait_timeout AS 'Expect 1';
---echo connection default;
connection default;
# We can be sure that the connections test_con1 and test_con2 must be
# established because both have already executed a SET @@session.wait_timeout.
@@ -95,4 +90,3 @@ SELECT info FROM information_schema.processlist;
--replace_result $global_value <global_value> $session_value <session_value>;
eval SELECT UNIX_TIMESTAMP() - @start_time >= $global_value + $session_value;
SET @@global.wait_timeout= @start_value;
-
diff --git a/mysql-test/suite/vcol/r/not_supported.result b/mysql-test/suite/vcol/r/not_supported.result
index 06627fccf8b..251fdaad101 100644
--- a/mysql-test/suite/vcol/r/not_supported.result
+++ b/mysql-test/suite/vcol/r/not_supported.result
@@ -1,3 +1,4 @@
+connect con1, localhost, root;
set lc_time_names = 'es_MX';
set time_zone='+10:00';
set div_precision_increment=20;
@@ -32,6 +33,8 @@ a b v
select * from t8;
a b v
1234567890 2 2009-02-14 09:31:30
+disconnect con1;
+connection default;
set time_zone='+1:00';
select * from t1;
a b v
diff --git a/mysql-test/suite/vcol/r/rpl_vcol.result b/mysql-test/suite/vcol/r/rpl_vcol.result
index 120ce38031f..a20719ad813 100644
--- a/mysql-test/suite/vcol/r/rpl_vcol.result
+++ b/mysql-test/suite/vcol/r/rpl_vcol.result
@@ -1,6 +1,7 @@
SET @@session.storage_engine = 'InnoDB';
include/master-slave.inc
[connection master]
+connection master;
create table t1 (a int, b int as (a+1));
show create table t1;
Table Create Table
@@ -14,9 +15,12 @@ select * from t1;
a b
1 2
2 3
+connection slave;
select * from t1;
a b
1 2
2 3
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test
index df4958bd2bc..8f4b3ee2fb7 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1473,12 +1473,10 @@ INSERT INTO t1 VALUES (1,1), (2,2);
START TRANSACTION;
INSERT INTO t1 VALUES (3,3);
---echo # Connection con1
connect (con1, localhost, root);
--echo # Sending:
--send ALTER TABLE t1 DISABLE KEYS
---echo # Connection default
connection default;
--echo # Waiting until ALTER TABLE is blocked.
let $wait_condition=
@@ -1489,14 +1487,12 @@ let $wait_condition=
UPDATE t1 SET b = 4;
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: ALTER TABLE t1 DISABLE KEYS
--reap
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
DROP TABLE t1;
diff --git a/mysql-test/t/alter_user.test b/mysql-test/t/alter_user.test
index e32d0c29f2e..ca444f70a70 100644
--- a/mysql-test/t/alter_user.test
+++ b/mysql-test/t/alter_user.test
@@ -1,6 +1,4 @@
--source include/not_embedded.inc
---enable_connect_log
-
select * from mysql.user where user = 'root' and host = 'localhost';
--echo # Test syntax
@@ -79,4 +77,3 @@ alter user foo with MAX_QUERIES_PER_HOUR 10
MAX_USER_CONNECTIONS 40;
select * from mysql.user where user = 'foo';
drop user foo;
---disable_connect_log
diff --git a/mysql-test/t/analyze_stmt_privileges.test b/mysql-test/t/analyze_stmt_privileges.test
index b565f17c0f7..32ff4ddfb7e 100644
--- a/mysql-test/t/analyze_stmt_privileges.test
+++ b/mysql-test/t/analyze_stmt_privileges.test
@@ -5,7 +5,6 @@
--echo # MDEV-7025 and MDEV-7027 ANALYZE SELECT/INSERT/UPDATE/DELETE from a
--echo # view does not check access permissions on the underlying table
--echo #
---enable_connect_log
create database db;
use db;
create table t1 (i int, c varchar(8));
diff --git a/mysql-test/t/analyze_stmt_privileges2.test b/mysql-test/t/analyze_stmt_privileges2.test
index 9a0299be535..e3274882ba6 100644
--- a/mysql-test/t/analyze_stmt_privileges2.test
+++ b/mysql-test/t/analyze_stmt_privileges2.test
@@ -23,7 +23,6 @@
# Save the initial number of concurrent sessions
--source include/count_sessions.inc
---enable_connect_log
set GLOBAL sql_mode="";
set LOCAL sql_mode="";
diff --git a/mysql-test/t/auth_rpl.test b/mysql-test/t/auth_rpl.test
index 0ff024c73e7..9b2c4357cf0 100644
--- a/mysql-test/t/auth_rpl.test
+++ b/mysql-test/t/auth_rpl.test
@@ -10,13 +10,11 @@
# First stop the slave to guarantee that nothing is replicated.
#
--connection slave
---echo [connection slave]
--source include/stop_slave.inc
#
# Create an replication account on the master.
#
--connection master
---echo [connection master]
CREATE USER 'plug_user' IDENTIFIED WITH 'test_plugin_server' AS 'plug_user';
GRANT REPLICATION SLAVE ON *.* TO plug_user;
FLUSH PRIVILEGES;
@@ -25,7 +23,6 @@ FLUSH PRIVILEGES;
# Now go to slave and change the replication user.
#
--connection slave
---echo [connection slave]
--let $master_user= query_get_value(SHOW SLAVE STATUS, Master_User, 1)
CHANGE MASTER TO
MASTER_USER= 'plug_user',
diff --git a/mysql-test/t/bug39022.test b/mysql-test/t/bug39022.test
index 6056dbf0e7b..8d1deb163d7 100644
--- a/mysql-test/t/bug39022.test
+++ b/mysql-test/t/bug39022.test
@@ -18,20 +18,16 @@ connect (thread1, localhost, root,,);
connect (thread2, localhost, root,,);
connection thread1;
---echo # in thread1
START TRANSACTION;
connection thread2;
---echo # in thread2
REPLACE INTO t2 VALUES (-17);
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE;
connection thread1;
---echo # in thread1
REPLACE INTO t1(a,b) VALUES (67,20);
connection thread2;
---echo # in thread2
COMMIT;
START TRANSACTION;
REPLACE INTO t1(a,b) VALUES (65,-50);
@@ -40,21 +36,18 @@ send;
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; #waits
connection thread1;
---echo # in thread1
--echo # should not crash
--error ER_LOCK_DEADLOCK
SELECT d FROM t2,t1 WHERE d=(SELECT MAX(a) FROM t1 WHERE t1.a > t2.d) LOCK IN SHARE MODE; #crashes
connection thread2;
---echo # in thread2
REAP;
disconnect thread2;
--source include/wait_until_disconnected.inc
connection thread1;
---echo # in thread1;
disconnect thread1;
--source include/wait_until_disconnected.inc
diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test
index 966d41adfbd..6a7b7253a59 100644
--- a/mysql-test/t/check.test
+++ b/mysql-test/t/check.test
@@ -67,12 +67,10 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
LOCK TABLE t1 WRITE;
---echo # Connection con1
connect(con1, localhost, root);
SET lock_wait_timeout= 1;
CHECK TABLE t1;
---echo # Connection default
connection default;
UNLOCK TABLES;
DROP TABLE t1;
diff --git a/mysql-test/t/commit.test b/mysql-test/t/commit.test
index c2051358073..762397dfa23 100644
--- a/mysql-test/t/commit.test
+++ b/mysql-test/t/commit.test
@@ -15,7 +15,6 @@ connect (con1,localhost,root,,);
# provided
# init
---echo connection default;
connection default;
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
@@ -63,13 +62,11 @@ START TRANSACTION;
SELECT * FROM t1;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
---echo connection con1
connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1000);
COMMIT;
---echo connection default
connection default;
--echo We should not be able to read the '1000'
SELECT * FROM t1;
@@ -99,29 +96,24 @@ SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
# transaction will have the same tran. iso. level
# as the first.
#
---echo connection default
connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
---echo connection con1
connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
---echo connection default
connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1001;
--echo Should be 1
COMMIT AND CHAIN;
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
---echo connection default
connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1002;
--echo Should be 1
@@ -133,29 +125,24 @@ COMMIT;
#
# Verify isolation level with ROLLBACK AND CHAIN
#
---echo connection default
connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
---echo connection con1
connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
---echo connection default
connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1001;
--echo Should be 1
ROLLBACK AND CHAIN;
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
---echo connection default
connection default;
SELECT COUNT(*) FROM t1 WHERE s1 = 1002;
--echo Should be 1
@@ -176,40 +163,33 @@ COMMIT;
#
SET @@completion_type=1;
---echo connection default
connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
---echo connection con1
connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
--echo Should see 1001
COMMIT AND NO CHAIN;
--echo default transaction is now in REPEATABLE READ
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
--echo Should see 1001 and 1002
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1003);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
--echo Should see 1001 and 1002, but NOT 1003
@@ -225,42 +205,35 @@ COMMIT;
# Verify that ROLLBACK AND NO CHAIN overrides the value
# of @@completion_type
#
---echo connection default
connection default;
SET @@completion_type=1;
COMMIT AND NO CHAIN;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
START TRANSACTION;
---echo connection con1
connection con1;
START TRANSACTION;
INSERT INTO t1 VALUES (1001);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
--echo Should see 1001
ROLLBACK AND NO CHAIN;
--echo default transaction is now in REPEATABLE READ
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1002);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
--echo Should see 1001 and 1002
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1003);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1 WHERE s1 >= 1000;
--echo Should see 1001 and 1002, but NOT 1003
@@ -281,7 +254,6 @@ COMMIT;
# SET TRANSACTION. (Note that this is _not_
# in accordance with ISO 9075.)
#
---echo connection default
connection default;
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
@@ -289,12 +261,10 @@ SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
START TRANSACTION;
SELECT * FROM t1;
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1000);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1;
--echo Should get same result as above (i.e should not read '1000')
@@ -320,12 +290,10 @@ INSERT INTO t1 VALUES (1000);
SELECT * FROM t1;
--echo Should read '1000'
---echo connection con1
connection con1;
INSERT INTO t1 VALUES (1001);
COMMIT;
---echo connection default
connection default;
SELECT * FROM t1;
--echo Should only read the '1000' as this transaction is now in REP READ
diff --git a/mysql-test/t/consistent_snapshot.test b/mysql-test/t/consistent_snapshot.test
index fb1f3bc007c..a481e757bed 100644
--- a/mysql-test/t/consistent_snapshot.test
+++ b/mysql-test/t/consistent_snapshot.test
@@ -7,25 +7,20 @@
DROP TABLE IF EXISTS t1;
--enable_warnings
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
--echo ### Test 1:
--echo ### - While a consistent snapshot transaction is executed,
--echo ### no external inserts should be visible to the transaction.
---echo # Switch to connection con1
connection con1;
CREATE TABLE t1 (a INT) ENGINE=innodb;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
---echo # Switch to connection con2
connection con2;
INSERT INTO t1 VALUES(1);
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1; # if consistent snapshot was set as expected, we
# should see nothing.
@@ -38,11 +33,9 @@ COMMIT;
DELETE FROM t1;
START TRANSACTION; # Now we omit WITH CONSISTENT SNAPSHOT
---echo # Switch to connection con2
connection con2;
INSERT INTO t1 VALUES(1);
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1; # if consistent snapshot was not set, as expected, we
# should see 1.
@@ -56,17 +49,14 @@ START TRANSACTION WITH CONSISTENT SNAPSHOT;
DELETE FROM t1;
COMMIT WORK AND CHAIN;
---echo # Switch to connection con2
connection con2;
INSERT INTO t1 VALUES(1);
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1; # if consistent snapshot was not set, as expected, we
# should see 1.
COMMIT;
---echo # Switch to connection default + close connections con1 and con2
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/t/ctype_errors.test b/mysql-test/t/ctype_errors.test
index 681223dae64..b228a3b9f19 100644
--- a/mysql-test/t/ctype_errors.test
+++ b/mysql-test/t/ctype_errors.test
@@ -50,13 +50,11 @@ connection default;
--echo #
connect (con1,localhost,root,,test);
---echo # Connection con1
SET lc_messages=ru_RU;
SET NAMES latin1;
--error ER_PARSE_ERROR
--query SELECT '01234567890123456789012345678901234\'
disconnect con1;
---echo # Connection default
connection default;
--echo End of 5.5 tests
diff --git a/mysql-test/t/ddl_i18n_koi8r.test b/mysql-test/t/ddl_i18n_koi8r.test
index 0a62a8ba0f8..5e2417fab4d 100644
--- a/mysql-test/t/ddl_i18n_koi8r.test
+++ b/mysql-test/t/ddl_i18n_koi8r.test
@@ -116,8 +116,6 @@ ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
# - Change connection to flush cache;
--connect (con2,localhost,root,,)
---echo
---echo ---> connection: con2
# - Switch environment variables and trigger loading views;
@@ -178,8 +176,6 @@ DROP DATABASE mysqltest1|
# - Change connection to flush cache;
--connect (con3,localhost,root,,)
---echo
---echo ---> connection: con3
# - Switch environment variables and trigger loading views;
@@ -208,9 +204,6 @@ set names koi8r|
#
--connection default
---echo
---echo ---> connection: default
-
--disconnect con2
--disconnect con3
@@ -378,8 +371,6 @@ ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
# - Change connection to flush SP-cache;
--connect (con2,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con2
# - Switch environment variables and trigger loading stored procedures;
@@ -458,8 +449,6 @@ DROP DATABASE mysqltest2|
# - Change connection to flush SP-cache;
--connect (con3,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con3
# - Switch environment variables and trigger loading stored procedures;
@@ -485,9 +474,6 @@ set names koi8r|
#
--connection default
---echo
---echo ---> connection: default
-
--disconnect con2
--disconnect con3
@@ -654,8 +640,6 @@ ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
# (connect using NULL database);
--connect (con2,localhost,root,,)
---echo
---echo ---> connection: con2
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
@@ -744,8 +728,6 @@ ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
# (connect using NULL database);
--connect (con3,localhost,root,,)
---echo
---echo ---> connection: con3
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
@@ -772,9 +754,6 @@ use mysqltest1|
#
--connection default
---echo
---echo ---> connection: default
-
--disconnect con2
--disconnect con3
@@ -914,8 +893,6 @@ ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
# - Change connection to flush cache;
--connect (con2,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con2
# - Switch environment variables and trigger loading stored procedures;
@@ -996,8 +973,6 @@ DROP DATABASE mysqltest2|
# - Change connection to flush cache;
--connect (con3,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con3
# - Switch environment variables and trigger loading stored procedures;
@@ -1135,19 +1110,12 @@ SHOW CREATE TABLE mysqltest2.t2|
delimiter ;|
--connection con2
---echo
---echo ---> connection: con2
--disconnect con2
--source include/wait_until_disconnected.inc
--connection con3
---echo
---echo ---> connection: con3
--disconnect con3
--source include/wait_until_disconnected.inc
--connection default
---echo
---echo ---> connection: default
USE test;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
-
diff --git a/mysql-test/t/ddl_i18n_utf8.test b/mysql-test/t/ddl_i18n_utf8.test
index 023047b952e..9fecad87515 100644
--- a/mysql-test/t/ddl_i18n_utf8.test
+++ b/mysql-test/t/ddl_i18n_utf8.test
@@ -116,8 +116,6 @@ ALTER DATABASE mysqltest1 COLLATE cp866_general_ci|
# - Change connection to flush cache;
--connect (con2,localhost,root,,)
---echo
---echo ---> connection: con2
# - Switch environment variables and trigger loading views;
@@ -178,8 +176,6 @@ DROP DATABASE mysqltest1|
# - Change connection to flush cache;
--connect (con3,localhost,root,,)
---echo
---echo ---> connection: con3
# - Switch environment variables and trigger loading views;
@@ -208,8 +204,6 @@ set names utf8|
#
--connection default
---echo
---echo ---> connection: default
--disconnect con2
--disconnect con3
@@ -378,8 +372,6 @@ ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
# - Change connection to flush SP-cache;
--connect (con2,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con2
# - Switch environment variables and trigger loading stored procedures;
@@ -458,8 +450,6 @@ DROP DATABASE mysqltest2|
# - Change connection to flush SP-cache;
--connect (con3,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con3
# - Switch environment variables and trigger loading stored procedures;
@@ -485,8 +475,6 @@ set names utf8|
#
--connection default
---echo
---echo ---> connection: default
--disconnect con2
--disconnect con3
@@ -654,8 +642,6 @@ ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
# (connect using NULL database);
--connect (con2,localhost,root,,)
---echo
---echo ---> connection: con2
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
@@ -744,8 +730,6 @@ ALTER TABLE mysqltest2.t1 DROP COLUMN fake|
# (connect using NULL database);
--connect (con3,localhost,root,,)
---echo
---echo ---> connection: con3
SET @@character_set_client= cp1251|
SET @@character_set_results= cp1251|
@@ -772,8 +756,6 @@ use mysqltest1|
#
--connection default
---echo
---echo ---> connection: default
--disconnect con2
--disconnect con3
@@ -914,8 +896,6 @@ ALTER DATABASE mysqltest2 COLLATE cp866_general_ci|
# - Change connection to flush cache;
--connect (con2,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con2
# - Switch environment variables and trigger loading stored procedures;
@@ -996,8 +976,6 @@ DROP DATABASE mysqltest2|
# - Change connection to flush cache;
--connect (con3,localhost,root,,mysqltest1)
---echo
---echo ---> connection: con3
# - Switch environment variables and trigger loading stored procedures;
@@ -1135,19 +1113,12 @@ SHOW CREATE TABLE mysqltest2.t2|
delimiter ;|
--connection con2
---echo
---echo ---> connection: con2
--disconnect con2
--source include/wait_until_disconnected.inc
--connection con3
---echo
---echo ---> connection: con3
--disconnect con3
--source include/wait_until_disconnected.inc
--connection default
---echo
---echo ---> connection: default
USE test;
DROP DATABASE mysqltest1;
DROP DATABASE mysqltest2;
-
diff --git a/mysql-test/t/debug_sync.test b/mysql-test/t/debug_sync.test
index ebeeec61632..aead6f3ac2e 100644
--- a/mysql-test/t/debug_sync.test
+++ b/mysql-test/t/debug_sync.test
@@ -330,23 +330,19 @@ SHOW VARIABLES LIKE 'DEBUG_SYNC';
#
CREATE USER mysqltest_1@localhost;
GRANT SUPER ON *.* TO mysqltest_1@localhost;
---echo connection con1, mysqltest_1
connect (con1,localhost,mysqltest_1,,);
SET DEBUG_SYNC= 'RESET';
disconnect con1;
---echo connection default
connection default;
DROP USER mysqltest_1@localhost;
#
CREATE USER mysqltest_2@localhost;
GRANT ALL ON *.* TO mysqltest_2@localhost;
REVOKE SUPER ON *.* FROM mysqltest_2@localhost;
---echo connection con1, mysqltest_2
connect (con1,localhost,mysqltest_2,,);
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
SET DEBUG_SYNC= 'RESET';
disconnect con1;
---echo connection default
connection default;
DROP USER mysqltest_2@localhost;
@@ -361,21 +357,17 @@ DROP TABLE IF EXISTS t1;
#
# Test.
CREATE TABLE t1 (c1 INT);
- --echo connection con1
connect (con1,localhost,root,,);
SET DEBUG_SYNC= 'before_lock_tables_takes_lock
SIGNAL opened WAIT_FOR flushed';
send INSERT INTO t1 VALUES(1);
---echo connection default
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'after_flush_unlock SIGNAL flushed';
FLUSH TABLE t1;
- --echo connection con1
connection con1;
reap;
disconnect con1;
---echo connection default
connection default;
DROP TABLE t1;
@@ -391,23 +383,19 @@ DROP TABLE IF EXISTS t1;
# Test.
CREATE TABLE t1 (c1 INT);
LOCK TABLE t1 READ;
- --echo connection con1
connect (con1,localhost,root,,);
# Retain action after use. First used by general_log.
SET DEBUG_SYNC= 'wait_for_lock SIGNAL locked EXECUTE 2';
send INSERT INTO t1 VALUES (1);
---echo connection default
connection default;
# Wait until INSERT waits for lock.
SET DEBUG_SYNC= 'now WAIT_FOR locked';
# let INSERT continue.
UNLOCK TABLES;
- --echo connection con1
connection con1;
--echo retrieve INSERT result.
reap;
disconnect con1;
---echo connection default
connection default;
DROP TABLE t1;
diff --git a/mysql-test/t/delayed.test b/mysql-test/t/delayed.test
index 2886dff8f91..85f28de128b 100644
--- a/mysql-test/t/delayed.test
+++ b/mysql-test/t/delayed.test
@@ -315,7 +315,6 @@ insert into t1 values (1,1);
lock table t1 read;
connect (update,localhost,root,,);
connection update;
---echo connection: update
--send insert delayed into t1 values (2,2);
connection default;
let $wait_condition=
@@ -323,10 +322,8 @@ let $wait_condition=
where command = "Delayed insert" and state = "Waiting for table level lock";
--source include/wait_condition.inc
connect (select,localhost,root,,);
---echo connection: select
select * from t1;
connection default;
---echo connection: default
select * from t1;
connection default;
disconnect update;
@@ -421,17 +418,14 @@ CREATE TABLE t3 (a INT);
--echo # Test 1: Using LOCK TABLE
---echo # Connection con1
connect (con1, localhost, root);
LOCK TABLE t1 WRITE;
---echo # Connection default
connection default;
LOCK TABLE t2 WRITE;
--echo # Sending:
--send INSERT DELAYED INTO t1 VALUES (1)
---echo # Connection con1
connection con1;
--echo # Wait until INSERT DELAYED is blocked on table 't1'.
let $wait_condition=
@@ -443,7 +437,6 @@ let $wait_condition=
INSERT DELAYED INTO t2 VALUES (1);
UNLOCK TABLES;
---echo # Connection default
connection default;
--echo # Reaping: INSERT DELAYED INTO t1 VALUES (1)
--reap
@@ -454,12 +447,10 @@ UNLOCK TABLES;
START TRANSACTION;
SELECT * FROM t1 WHERE a=0;
---echo # Connection con1
connection con1;
--echo # Sending:
--send ALTER TABLE t1 MODIFY a INT UNSIGNED;
---echo # Connection default
connection default;
--echo # Wait until ALTER TABLE is blocked on table 't1'.
let $wait_condition=
@@ -471,24 +462,20 @@ let $wait_condition=
INSERT DELAYED INTO t1 VALUES (3);
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: ALTER TABLE t1 COMMENT 'test'
--reap
--echo # Test 3: Using RENAME TABLE
---echo # Connection default
connection default;
START TRANSACTION;
INSERT INTO t2 VALUES (1);
---echo # Connection con1
connection con1;
--echo # Sending:
--send RENAME TABLE t1 to t5, t2 to t4
---echo # Connection default
connection default;
--echo # Wait until RENAME TABLE is blocked on table 't1'.
let $wait_condition=
@@ -500,12 +487,10 @@ let $wait_condition=
INSERT DELAYED INTO t1 VALUES (4);
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: RENAME TABLE t1 to t5, t2 to t4
--reap
---echo # Connection default
connection default;
--echo # Reverting the renames
RENAME TABLE t5 to t1, t4 to t2;
@@ -515,11 +500,9 @@ RENAME TABLE t5 to t1, t4 to t2;
START TRANSACTION;
INSERT INTO t2 VALUES (1);
---echo # Connection con2
connect (con2, localhost, root);
--send LOCK TABLE t1 WRITE, t2 WRITE
---echo # Connection con1
connection con1;
--echo # Wait until LOCK TABLE is blocked on table 't2'.
let $wait_condition=
@@ -529,7 +512,6 @@ let $wait_condition=
--source include/wait_condition.inc
--send INSERT DELAYED INTO t1 VALUES (5)
---echo # Connection default
connection default;
--echo # Wait until INSERT DELAYED is blocked on table 't1'.
let $wait_condition=
@@ -541,18 +523,15 @@ let $wait_condition=
INSERT DELAYED INTO t1 VALUES (6);
COMMIT;
---echo # Connection con2
connection con2;
--echo # Reaping: LOCK TABLE t1 WRITE, t2 WRITE
--reap
UNLOCK TABLES;
---echo # Connection con1
connection con1;
--echo # Reaping: INSERT DELAYED INTO t1 VALUES (5)
--reap
---echo # Connection default
connection default;
--echo # Test 5: LOCK TABLES + INSERT DELAYED in one connection.
@@ -567,16 +546,13 @@ INSERT DELAYED INTO t2 VALUES (8);
UNLOCK TABLES;
SET AUTOCOMMIT= 1;
---echo # Connection con2
connection con2;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
DROP TABLE t1, t2, t3;
--enable_ps_protocol
@@ -596,12 +572,10 @@ create table tm(a int) engine=merge union=(t1, t2);
begin;
select * from t1;
---echo # Connection 'con1'.
connection con1;
--echo # Sending:
--send alter table t1 comment 'test'
---echo # Connection 'default'.
connection default;
--echo # Wait until ALTER TABLE blocks and starts waiting
--echo # for connection 'default'. It should wait with a
@@ -619,13 +593,11 @@ insert delayed into tm values (1);
--echo # Unblock ALTER TABLE.
commit;
---echo # Connection 'con1'.
connection con1;
--echo # Reaping ALTER TABLE:
--reap
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection 'default'.
connection default;
drop tables tm, t1, t2;
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index cace397e92a..76288c8fbae 100644
--- a/mysql-test/t/events_bugs.test
+++ b/mysql-test/t/events_bugs.test
@@ -919,7 +919,6 @@ GRANT create, insert, select, event ON events_test.* TO evtest1@localhost;
GRANT select,insert ON test.* TO evtest1@localhost;
SHOW GRANTS FOR evtest1@localhost;
---echo connection e1;
--replace_result $MASTER_MYPORT MASTER_MYPORT $MASTER_MYSOCK MASTER_MYSOCK
connect (e1,localhost,evtest1,ev1,events_test,$MASTER_MYPORT,$MASTER_MYSOCK);
DELIMITER |;
@@ -951,7 +950,6 @@ SELECT COUNT(*) > 0 FROM events_test.event_log;
--source include/wait_condition.inc
SELECT COUNT(*) > 0 AS "Expect 1" FROM events_test.event_log;
#
---echo connection default;
connection default;
DROP USER evtest1@localhost;
# 2. If we meet BUG#28924 again than a server crash happens within the next
@@ -1025,10 +1023,6 @@ SET GLOBAL READ_ONLY = 1;
--echo
---echo #
---echo # Connection: u1_con (mysqltest_u1@localhost/events_test).
---echo #
-
--connect(u1_con,localhost,mysqltest_u1,,events_test)
--echo
@@ -1050,10 +1044,6 @@ DROP EVENT e1;
# Check that the super user still can create/update/drop events.
---echo #
---echo # Connection: root_con (root@localhost/events_test).
---echo #
-
--connect(root_con,localhost,root,,events_test)
--echo
@@ -1079,10 +1069,6 @@ SET GLOBAL READ_ONLY = 0;
--echo
---echo #
---echo # Connection: u1_con (mysqltest_u1@localhost/test).
---echo #
-
--connection u1_con
--echo
@@ -1101,10 +1087,6 @@ WHERE event_schema = 'events_test';
--echo
---echo #
---echo # Connection: root_con (root@localhost/events_test).
---echo #
-
--connection root_con
--echo
@@ -1170,10 +1152,6 @@ SET GLOBAL READ_ONLY = 0;
--echo
---echo #
---echo # Connection: default
---echo #
-
--disconnect u1_con
--disconnect root_con
--connection default
diff --git a/mysql-test/t/filesort_debug.test b/mysql-test/t/filesort_debug.test
index c375334ad29..86795298f07 100644
--- a/mysql-test/t/filesort_debug.test
+++ b/mysql-test/t/filesort_debug.test
@@ -32,7 +32,6 @@ DROP FUNCTION f1;
connect (con1, localhost, root);
connect (con2, localhost, root);
---echo # connection 1
connection con1;
CREATE TABLE t1(f0 int auto_increment primary key, f1 int);
INSERT INTO t1(f1) VALUES (0),(1),(2),(3),(4),(5);
@@ -43,14 +42,12 @@ SET DEBUG_SYNC='filesort_start SIGNAL filesort_started WAIT_FOR filesort_killed'
--echo # Sending: (not reaped since connection is killed later)
--send SELECT * FROM t1 ORDER BY f1 ASC, f0
---echo # connection 2
connection con2;
let $ignore= `SELECT @id := $ID`;
SET DEBUG_SYNC='now WAIT_FOR filesort_started';
KILL @id;
SET DEBUG_SYNC='now SIGNAL filesort_killed';
---echo # connection default
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/t/flush-innodb-notembedded.test b/mysql-test/t/flush-innodb-notembedded.test
index 15bfeb53475..1f73ba50fc4 100644
--- a/mysql-test/t/flush-innodb-notembedded.test
+++ b/mysql-test/t/flush-innodb-notembedded.test
@@ -14,54 +14,44 @@ GRANT RELOAD, SELECT ON *.* TO user3@localhost;
GRANT SELECT, LOCK TABLES ON *.* TO user4@localhost;
GRANT RELOAD, LOCK TABLES ON *.* TO user5@localhost;
---echo # Connection con1 as user1
--connect(con1, localhost, user1)
FLUSH TABLE db1.t1 FOR EXPORT;
UNLOCK TABLES;
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
---echo # Connection con1 as user2
--connect(con1, localhost, user2)
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
FLUSH TABLE db1.t1 FOR EXPORT;
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
---echo # Connection con1 as user3
--connect(con1, localhost, user3)
--error ER_DBACCESS_DENIED_ERROR
FLUSH TABLE db1.t1 FOR EXPORT;
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
---echo # Connection con1 as user4
--connect(con1, localhost, user4)
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
FLUSH TABLE db1.t1 FOR EXPORT;
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
---echo # Connection con1 as user5
--connect(con1, localhost, user5)
--error ER_TABLEACCESS_DENIED_ERROR
FLUSH TABLE db1.t1 FOR EXPORT;
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
DROP USER user1@localhost, user2@localhost, user3@localhost,
user4@localhost, user5@localhost;
diff --git a/mysql-test/t/flush-innodb.test b/mysql-test/t/flush-innodb.test
index acf9493693a..bf7b79bb5a3 100644
--- a/mysql-test/t/flush-innodb.test
+++ b/mysql-test/t/flush-innodb.test
@@ -109,18 +109,15 @@ DROP VIEW v1;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT) engine= InnoDB;
CREATE TABLE t2 (a INT) engine= InnoDB;
---echo # Connection con1
--connect (con1, localhost, root)
START TRANSACTION;
INSERT INTO t1 VALUES (1, 1);
---echo # Connection default
--connection default
--echo # Should be blocked
--echo # Sending:
--send FLUSH TABLES t1 FOR EXPORT
---echo # Connection con1
--connection con1
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -129,12 +126,10 @@ let $wait_condition=
--source include/wait_condition.inc
COMMIT;
---echo # Connection default
--connection default
--echo # Reaping: FLUSH TABLES t1 FOR EXPORT
--reap
---echo # Connection con1
--connection con1
--echo # Should not be blocked
INSERT INTO t2 VALUES (1);
@@ -142,7 +137,6 @@ INSERT INTO t2 VALUES (1);
--echo # Sending:
--send INSERT INTO t1 VALUES (2, 2)
---echo # Connection default
--connection default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -151,7 +145,6 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLES;
---echo # Connection con1
--connection con1
--echo # Reaping: INSERT INTO t1 VALUES (2, 2);
--reap
@@ -162,18 +155,15 @@ UNLOCK TABLES;
START TRANSACTION;
SELECT * FROM t1;
---echo # Connection default
--connection default
--echo # Should not be blocked
FLUSH TABLES t1 FOR EXPORT;
---echo # Connection con1
--connection con1
COMMIT;
--echo # Should not be blocked
SELECT * FROM t1;
---echo # Connection default
--connection default
UNLOCK TABLES;
@@ -183,12 +173,10 @@ UNLOCK TABLES;
START TRANSACTION;
SELECT * FROM t1;
---echo # Connection con2
--connect (con2, localhost, root)
--echo # Sending:
--send ALTER TABLE t1 ADD INDEX i1(b)
---echo # Connection con1
--connection con1
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -198,7 +186,6 @@ let $wait_condition=
--echo # Should be blocked
--send FLUSH TABLE t1 FOR EXPORT
---echo # Connection default
--connection default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -207,27 +194,22 @@ let $wait_condition=
--source include/wait_condition.inc
COMMIT;
---echo # Connection con2
--connection con2
--echo # Reaping ALTER TABLE ...
--reap
---echo # Connection con1
--connection con1
--echo # Reaping FLUSH TABLE t1 FOR EXPORT
--reap
UNLOCK TABLES;
---echo # Connection default
--connection default
FLUSH TABLE t1 FOR EXPORT;
---echo # Connection con2
--connection con2
--echo # Should be blocked
--send DROP TABLE t1
---echo # Connection default
--connection default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -236,14 +218,12 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLES;
---echo # Connection con2
--connection con2
--echo # Reaping DROP TABLE t1
--reap
--disconnect con2
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
DROP TABLE t2;
@@ -253,13 +233,11 @@ DROP TABLE t2;
CREATE TABLE t1(a INT) engine= InnoDB;
FLUSH TABLES WITH READ LOCK;
---echo # Connection con1
--connection con1
--echo # This should not block
FLUSH TABLE t1 FOR EXPORT;
UNLOCK TABLES;
---echo # Connection default
--connection default
UNLOCK TABLES;
DROP TABLE t1;
@@ -272,12 +250,10 @@ CREATE TABLE t1(a INT) engine= MEMORY;
FLUSH TABLE t1 FOR EXPORT;
DROP TABLE t1;
---echo # Connection con1
--connection con1
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection defalt
--connection default
--echo # Test 7: Check privileges required.
@@ -291,11 +267,9 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) engine= InnoDB;
CREATE TABLE t2 (a INT) engine= InnoDB;
---echo # Connection con1
--connect (con1, localhost, root)
FLUSH TABLE t1 FOR EXPORT;
---echo # Connection default
--connection default
--echo # This should not block
FLUSH TABLE t2 FOR EXPORT;
@@ -304,7 +278,6 @@ UNLOCK TABLES;
--echo # Sending:
--send FLUSH TABLE t1 FOR EXPORT
---echo # Connection con1
--connection con1
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -313,7 +286,6 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLES;
---echo # Connection default
--connection default
--echo # Reaping: FLUSH TABLE t1 FOR EXPORT
--reap
@@ -324,33 +296,27 @@ UNLOCK TABLES;
LOCK TABLE t1 READ;
---echo # Connection con1
--connection con1
--echo # Should not block
FLUSH TABLE t1 FOR EXPORT;
UNLOCK TABLES;
---echo # Connection default
--connection default
UNLOCK TABLES;
FLUSH TABLE t1 FOR EXPORT;
---echo # Connection con1
--connection con1
--echo # Should not block
LOCK TABLE t1 READ;
UNLOCK TABLES;
---echo # Connection default
--connection default
UNLOCK TABLES;
---echo # Connection con1
--connection con1
--disconnect con1
--source include/wait_until_disconnected.inc
---echo # Connection default
--connection default
DROP TABLE t1, t2;
@@ -372,21 +338,17 @@ DROP TABLE t1;
--echo # Test 11: Test 'flush table with fully qualified table names
--echo # and with syntax local/NO_WRITE_TO_BINLOG
---echo # Connection con1
--connect (con1, localhost, root)
---echo # Connection default
--connection default
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
INSERT INTO t1 VALUES (100),(200);
FLUSH LOCAL TABLES test.t1 FOR EXPORT;
---echo # Connection con1
--connection con1
--echo # Should be blocked
--echo # Sending:
--send FLUSH LOCAL TABLES t1 FOR EXPORT
---echo # Connection default
--connection default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -395,19 +357,16 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLE;
---echo # Connection con1
--connection con1
--echo # Reaping: FLUSH LOCAL TABLES t1 FOR EXPORT
--reap
SELECT * FROM t1 ORDER BY i;
---echo # Connection default
--connection default
--echo # Should be blocked
--echo # Sending:
--send FLUSH NO_WRITE_TO_BINLOG TABLES test.t1 FOR EXPORT
---echo # Connection con1
--connection con1
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -416,7 +375,6 @@ let $wait_condition=
--source include/wait_condition.inc
UNLOCK TABLES;
---echo # Connection default
--connection default
--echo # Reaping: FLUSH NO_WRITE_TO_BINLOG TABLES test.t1 FOR EXPORT
--reap
@@ -427,7 +385,6 @@ DROP TABLE t1;
--echo # Test 12: Active transaction get committed if user execute
--echo # "FLUSH TABLE ... FOR EXPORT" or "LOCK TABLE.."
---echo # Connection default
--connection default
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
INSERT INTO t1 VALUES (100),(200);
@@ -448,7 +405,6 @@ DROP TABLE t1;
--echo # Test 13: Verify "FLUSH TABLE ... FOR EXPORT" and "LOCK TABLE.."
--echo # in same session
---echo # Connection default
--connection default
CREATE TABLE t1 ( i INT ) ENGINE = Innodb;
diff --git a/mysql-test/t/flush.test b/mysql-test/t/flush.test
index a1df9359d30..81834b7de10 100644
--- a/mysql-test/t/flush.test
+++ b/mysql-test/t/flush.test
@@ -303,19 +303,16 @@ insert into t3 (a) values (2);
--echo # III. Concurrent tests.
--echo #
connect (con1,localhost,root,,);
---echo # --> connection default
--echo #
--echo # Check that flush tables <list> with read lock
--echo # does not affect non-locked tables.
connection default;
--echo #
flush tables t1 with read lock;
---echo # --> connection con1;
connection con1;
select * from t1;
select * from t2;
insert into t2 (a) values (3);
---echo # --> connection default;
connection default;
unlock tables;
--echo #
@@ -324,12 +321,10 @@ unlock tables;
--echo # Vice versa it is not true, since tables read-locked by
--echo # "FLUSH TABLES <list> WITH READ LOCK" can't be flushed.
flush tables with read lock;
---echo # --> connection con1;
connection con1;
flush table t1 with read lock;
select * from t1;
unlock tables;
---echo # --> connection default;
connection default;
unlock tables;
--echo #
@@ -338,11 +333,9 @@ unlock tables;
--echo # WITH READ LOCK.
--echo #
flush table t1 with read lock;
---echo # --> connection con1
connection con1;
flush table t2 with read lock;
unlock tables;
---echo # --> connection default
connection default;
unlock tables;
--echo #
@@ -350,11 +343,9 @@ unlock tables;
--echo # does not conflict with SET GLOBAL read_only=1.
--echo #
set global read_only=1;
---echo # connection con1
connection con1;
flush table t1 with read lock;
unlock tables;
---echo # connection default
connection default;
set global read_only=0;
--echo #
@@ -362,15 +353,12 @@ set global read_only=0;
--echo # tables locked with FLUSH TABLE <list> WITH READ LOCK.
--echo #
flush tables t1, t2 with read lock;
---echo # connection con1
connection con1;
lock table t1 read, t2 read;
unlock tables;
---echo # connection default
connection default;
unlock tables;
---echo # --> connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
@@ -440,13 +428,11 @@ drop table if exists t1;
--enable_warnings
connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
---echo # --> conection default
connection default;
create table t1 (a int);
begin;
select * from t1;
---echo # --> connection con1
connection con1;
--echo #
--echo # Issue a LOCK TABLE t1 READ. We could use HANDLER t1 OPEN
@@ -454,13 +440,11 @@ connection con1;
--echo # prevents FLUSH TABLE t1 from immediate completion would do.
--echo #
lock table t1 read;
---echo # --> connection con2
connection con2;
--echo #
--echo # FLUSH TABLE expels the table definition from the cache.
--echo # Sending 'flush table t1'...
send flush table t1;
---echo # --> connection default
connection default;
--echo # Let flush table sync in.
let $wait_condition=
@@ -469,7 +453,6 @@ let $wait_condition=
and info = "flush table t1";
--source include/wait_condition.inc
send select * from t1;
---echo # --> connection con1
connection con1;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -477,11 +460,9 @@ let $wait_condition=
and info = "select * from t1";
select * from t1;
unlock tables;
---echo # --> connection con2
connection con2;
--echo # Reaping 'flush table t1'...
reap;
---echo # --> connection default
connection default;
--echo # Reaping 'select * from t1'...
reap;
@@ -493,19 +474,16 @@ commit;
begin;
select * from t1;
---echo # --> connection con1
connection con1;
--echo #
--echo # Issue a LOCK TABLE t1 READ.
--echo #
lock table t1 read;
---echo # --> connection con2
connection con2;
--echo #
--echo # FLUSH TABLES expels the table definition from the cache.
--echo # Sending 'flush tables'...
send flush tables;
---echo # --> connection default
connection default;
--echo # Let flush table sync in.
let $wait_condition=
@@ -514,7 +492,6 @@ let $wait_condition=
and info = "flush tables";
--source include/wait_condition.inc
send select * from t1;
---echo # --> connection con1
connection con1;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -522,11 +499,9 @@ let $wait_condition=
and info = "select * from t1";
select * from t1;
unlock tables;
---echo # --> connection con2
connection con2;
--echo # Reaping 'flush tables'...
reap;
---echo # --> connection default
connection default;
--echo # Reaping 'select * from t1'...
reap;
@@ -534,15 +509,12 @@ commit;
--echo # Cleanup
---echo # --> connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # --> connection con2
connection con2;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # --> connection default
connection default;
drop table t1;
@@ -593,12 +565,10 @@ create table t1 (i int);
create table t2 (i int);
handler t1 open;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Sending:
--send flush tables with read lock
---echo # Switching to connection 'con2'.
connection con2;
--echo # Wait until FTWRL starts waiting for 't1' to be closed.
let $wait_condition=
@@ -607,13 +577,11 @@ let $wait_condition=
and info = "flush tables with read lock";
--source include/wait_condition.inc
---echo # Switching to connection 'default'.
connection default;
--echo # The below statement should not cause deadlock.
--echo # Sending:
--send insert into t2 values (1)
---echo # Switching to connection 'con2'.
connection con2;
--echo # Wait until INSERT starts to wait for FTWRL to go away.
let $wait_condition=
@@ -622,14 +590,12 @@ let $wait_condition=
and info = "insert into t2 values (1)";
--source include/wait_condition.inc
---echo # Switching to connection 'con1'.
connection con1;
--echo # FTWRL should be able to continue now.
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
--reap
@@ -688,7 +654,6 @@ CREATE TRIGGER t1_au AFTER UPDATE ON t1 FOR EACH ROW SET @var = "a";
BEGIN;
UPDATE t1 SET value= value + 1 WHERE id = 1;
---echo # Switching to connection 'con1'.
connect(con1, localhost, root);
--echo # The below FLUSH TABLES WITH READ LOCK should succeed and
--echo # should not be blocked by the transaction in default connection.
@@ -697,7 +662,6 @@ UNLOCK TABLES;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Switching to connection 'default'.
connection default;
COMMIT;
DROP TABLE t1;
diff --git a/mysql-test/t/flush_block_commit.test b/mysql-test/t/flush_block_commit.test
index 90443dc9242..6a6120ce63f 100644
--- a/mysql-test/t/flush_block_commit.test
+++ b/mysql-test/t/flush_block_commit.test
@@ -9,13 +9,9 @@
--echo # Save the initial number of concurrent sessions
--source include/count_sessions.inc
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
---echo # Establish connection con3 (user=root)
connect (con3,localhost,root,,);
---echo # Switch to connection con1
connection con1;
--disable_warnings
@@ -27,14 +23,11 @@ CREATE TABLE t1 (a INT) ENGINE=innodb;
BEGIN;
INSERT INTO t1 VALUES(1);
---echo # Switch to connection con2
connection con2;
FLUSH TABLES WITH READ LOCK;
---echo # Switch to connection con1
connection con1;
--echo # Sending:
--send COMMIT
---echo # Switch to connection con2
connection con2;
--echo # Wait until COMMIT gets blocked.
let $wait_condition=
@@ -44,33 +37,26 @@ let $wait_condition=
--echo # Verify that 'con1' was blocked and data did not move.
SELECT * FROM t1;
UNLOCK TABLES;
---echo # Switch to connection con1
connection con1;
--echo # Reaping COMMIT
--reap
# No deadlock ?
---echo # Switch to connection con1
connection con1;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
---echo # Switch to connection con2
connection con2;
BEGIN;
send SELECT * FROM t1 FOR UPDATE; # blocked by con1
sleep 1;
---echo # Switch to connection con3
connection con3;
send FLUSH TABLES WITH READ LOCK; # blocked by con2
---echo # Switch to connection con1
connection con1;
COMMIT; # should not be blocked by con3
---echo # Switch to connection con2
connection con2;
reap;
COMMIT;
---echo # Switch to connection con3
connection con3;
reap;
UNLOCK TABLES;
@@ -78,15 +64,12 @@ UNLOCK TABLES;
# Bug#6732 FLUSH TABLES WITH READ LOCK + COMMIT hangs later FLUSH TABLES
# WITH READ LOCK
---echo # Switch to connection con2
connection con2;
COMMIT; # unlock InnoDB row locks to allow insertions
---echo # Switch to connection con1
connection con1;
BEGIN;
INSERT INTO t1 VALUES(10);
FLUSH TABLES WITH READ LOCK;
---echo # Switch to connection con2
connection con2;
FLUSH TABLES WITH READ LOCK; # bug caused hang here
UNLOCK TABLES;
@@ -100,7 +83,6 @@ COMMIT;
--echo # Cleanup
---echo # Switch to connection default and close connections con1, con2, con3
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/t/flush_block_commit_notembedded.test b/mysql-test/t/flush_block_commit_notembedded.test
index fe9dbf7c19e..3d894c5f16c 100644
--- a/mysql-test/t/flush_block_commit_notembedded.test
+++ b/mysql-test/t/flush_block_commit_notembedded.test
@@ -13,31 +13,24 @@
--source include/count_sessions.inc
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Establish connection con2 (user=root)
connect (con2,localhost,root,,);
# FLUSH TABLES WITH READ LOCK should block writes to binlog too
---echo # Switch to connection con1
connection con1;
CREATE TABLE t1 (a INT) ENGINE=innodb;
RESET MASTER;
SET AUTOCOMMIT=0;
SELECT 1;
---echo # Switch to connection con2
connection con2;
FLUSH TABLES WITH READ LOCK;
--source include/show_binlog_events.inc
---echo # Switch to connection con1
connection con1;
send INSERT INTO t1 VALUES (1);
---echo # Switch to connection con2
connection con2;
sleep 1;
--source include/show_binlog_events.inc
UNLOCK TABLES;
---echo # Switch to connection con1
connection con1;
reap;
DROP TABLE t1;
@@ -62,7 +55,6 @@ connection con2;
commit;
drop table t1;
---echo # Switch to connection default and close connections con1 and con2
connection default;
disconnect con1;
disconnect con2;
diff --git a/mysql-test/t/flush_read_lock.test b/mysql-test/t/flush_read_lock.test
index 7ba80ea38ac..4a9752ae9f1 100644
--- a/mysql-test/t/flush_read_lock.test
+++ b/mysql-test/t/flush_read_lock.test
@@ -231,41 +231,30 @@ unlock tables;
--echo # COMMIT is blocked by active FTWRL in another
--echo # connection.
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
begin;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Do some work so ROLLBACK is not a no-op.
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
rollback;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
begin;
--echo # Do some work so COMMIT is not a no-op.
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--echo # Send:
--send commit
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Wait until COMMIT is blocked.
let $wait_condition=
@@ -274,7 +263,6 @@ let $wait_condition=
info = "commit";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap COMMIT.
--reap
@@ -286,11 +274,9 @@ insert into t3_trans values (1);
set debug_sync='RESET';
set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
--send commit
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
--send flush tables with read lock
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Wait until FTWRL is blocked.
let $wait_condition=
@@ -299,16 +285,13 @@ let $wait_condition=
info = "flush tables with read lock";
--source include/wait_condition.inc
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap COMMIT.
--reap
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
delete from t3_trans;
set debug_sync= "RESET";
@@ -574,13 +557,10 @@ unlock tables;
--echo # Check that active FTWRL in another connection
--echo # blocks EXECUTE which changes data.
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send execute stmt1
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that EXECUTE is blocked.
let $wait_condition=
@@ -589,18 +569,15 @@ let $wait_condition=
info = "insert into t1_base values (1)";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap EXECUTE.
--reap
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send execute stmt1;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
--send flush tables with read lock
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Wait until FTWRL is blocked.
let $wait_condition=
@@ -609,16 +586,13 @@ let $wait_condition=
info = "flush tables with read lock";
--source include/wait_condition.inc
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap EXECUTE.
--reap
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
set debug_sync= "RESET";
delete from t1_base;
@@ -808,23 +782,18 @@ drop trigger t1_bi;
--echo # Check that FTWRL statements can be run while FTWRL
--echo # is active in another connection.
--echo #
---echo # Switching to connection '$con_aux1'.
flush tables with read lock;
--echo # The second FTWRL in a row is allowed at the moment.
--echo # It does not make much sense as it does only flush.
flush tables with read lock;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
flush tables with read lock;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo #
@@ -836,23 +805,17 @@ flush tables with read lock;
--echo # It does not make much sense though.
flush tables t1_base, t2_base with read lock;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
flush tables t1_base, t2_base with read lock;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
flush tables t1_base, t2_base with read lock;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--send flush tables with read lock
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Wait until FTWRL is blocked.
let $wait_condition=
@@ -860,15 +823,12 @@ let $wait_condition=
where state = "Waiting for table flush" and
info = "flush tables with read lock";
--source include/wait_condition.inc
---echo # Switching to connection 'default'.
connection default;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
@@ -915,18 +875,14 @@ unlock tables;
--echo # Check that HANDLER statements can be run while FTWRL
--echo # is active in another connection.
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
handler t1_base open;
handler t1_base read first;
handler t1_base close;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
@@ -984,29 +940,23 @@ unlock tables;
--echo # Check that KILL statements can be run while FTWRL
--echo # is active in another connection.
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--error ER_QUERY_INTERRUPTED
kill query @id;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Finally check that KILL doesn't block FTWRL
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send kill query @id
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap KILL.
--error ER_QUERY_INTERRUPTED
@@ -1043,17 +993,13 @@ flush tables with read lock;
lock tables t1_base read;
unlock tables;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
lock tables t1_base read;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo #
@@ -1064,13 +1010,10 @@ flush tables with read lock;
lock tables t1_base write;
unlock tables;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send lock tables t1_base write
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that LOCK TABLES WRITE is blocked.
let $wait_condition=
@@ -1079,7 +1022,6 @@ let $wait_condition=
info = "lock tables t1_base write";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap LOCK TABLES WRITE
--reap
@@ -1093,17 +1035,13 @@ flush tables with read lock;
lock tables t1_temp write;
unlock tables;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
lock tables t1_temp write;
unlock tables;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
@@ -1116,13 +1054,10 @@ flush tables with read lock;
optimize table t1_base;
unlock tables;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send optimize table t1_base
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that OPTIMIZE TABLE is blocked.
let $wait_condition=
@@ -1131,7 +1066,6 @@ let $wait_condition=
info = "optimize table t1_base";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap OPTIMIZE TABLE
--reap
@@ -1191,43 +1125,31 @@ commit;
--echo # Check that these statements are not blocked by
--echo # active FTWRL in another connection.
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
begin;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Do some changes to avoid SAVEPOINT and friends
--echo # being almost no-ops.
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
savepoint sv1;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
insert into t3_trans values (2);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
rollback to savepoint sv1;
release savepoint sv1;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
rollback;
--echo # Check that these statements don't block FTWRL in
@@ -1239,38 +1161,32 @@ insert into t3_trans values (1);
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send savepoint sv1
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap SAVEPOINT
--reap
insert into t3_trans values (2);
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send rollback to savepoint sv1
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap ROLLBACK TO SAVEPOINT
--reap
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send release savepoint sv1
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
flush tables with read lock;
unlock tables;
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap RELEASE SAVEPOINT
--reap
@@ -1304,13 +1220,10 @@ flush tables with read lock;
repair table t1_base;
unlock tables;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send repair table t1_base
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that REPAIR TABLE is blocked.
let $wait_condition=
@@ -1319,7 +1232,6 @@ let $wait_condition=
info = "repair table t1_base";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap REPAIR TABLE
--reap
@@ -1496,28 +1408,21 @@ delete from t3_temp_trans;
--echo # SET AUTOCOMMIT=1 is blocked by active FTWRL in
--echo # another connection.
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
set autocommit= 0;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Do some work so implicit commit in SET AUTOCOMMIT=1
--echo # is not a no-op.
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--echo # Send:
--send set autocommit= 1
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Wait until SET AUTOCOMMIT=1 is blocked.
let $wait_condition=
@@ -1526,7 +1431,6 @@ let $wait_condition=
info = "set autocommit= 1";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap SET AUTOCOMMIT=1.
--reap
@@ -1538,11 +1442,9 @@ insert into t3_trans values (1);
set debug_sync='RESET';
set debug_sync='ha_commit_trans_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
--send set autocommit= 1
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
--send flush tables with read lock
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Wait until FTWRL is blocked.
let $wait_condition=
@@ -1551,16 +1453,13 @@ let $wait_condition=
info = "flush tables with read lock";
--source include/wait_condition.inc
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap SET AUTOCOMMIT=1.
--reap
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
delete from t3_trans;
set debug_sync= "RESET";
@@ -1698,44 +1597,33 @@ unlock tables;
--echo # Check that XA non-COMMIT statements are not and COMMIT is
--echo # blocked by active FTWRL in another connection
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
xa start 'test1';
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
xa end 'test1';
xa prepare 'test1';
xa rollback 'test1';
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
xa start 'test1';
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
connection default;
xa end 'test1';
xa prepare 'test1';
--echo # Send:
--send xa commit 'test1';
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Wait until XA COMMIT is blocked.
let $wait_condition=
@@ -1744,7 +1632,6 @@ let $wait_condition=
info = "xa commit 'test1'";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap XA COMMIT.
--reap
@@ -1758,11 +1645,9 @@ xa prepare 'test1';
set debug_sync='RESET';
set debug_sync='trans_xa_commit_after_acquire_commit_lock SIGNAL parked WAIT_FOR go';
--send xa commit 'test1'
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
--send flush tables with read lock
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Wait until FTWRL is blocked.
let $wait_condition=
@@ -1771,16 +1656,13 @@ let $wait_condition=
info = "flush tables with read lock";
--source include/wait_condition.inc
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap XA COMMIT.
--reap
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
delete from t3_trans;
set debug_sync= "RESET";
@@ -1841,13 +1723,10 @@ flush tables with read lock;
analyze table t3_trans;
unlock tables;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send analyze table t3_trans
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that ANALYZE TABLE is blocked.
let $wait_condition=
@@ -1856,7 +1735,6 @@ let $wait_condition=
info = "analyze table t3_trans";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap ANALYZE TABLE
--reap
@@ -1920,13 +1798,10 @@ let $cleanup_stmt= alter table t3_temp_trans drop column c1;
begin;
insert into t3_trans values (1);
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send check table t1_base
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that CHECK TABLE is blocked.
let $wait_condition=
@@ -1935,20 +1810,16 @@ let $wait_condition=
info = "check table t1_base";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap CHECK TABLE
--reap
begin;
delete from t3_trans;
--echo #
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--send alter table t1_temp add column c1 int
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Check that ALTER TABLE is blocked.
let $wait_condition=
@@ -1957,7 +1828,6 @@ let $wait_condition=
info = "alter table t1_temp add column c1 int";
--source include/wait_condition.inc
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap ALTER TABLE
--reap
@@ -1974,21 +1844,17 @@ alter table t1_temp drop column c1;
begin;
insert into t1_base values (1);
insert into t3_trans values (1);
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # The below FTWRL should not be blocked by transaction in 'default'.
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
--echo # Transaction still is able to read even with FTWRL active in another
--echo # connection.
select * from t1_base;
select * from t2_base;
select * from t3_trans;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
commit;
delete from t1_base;
@@ -2004,11 +1870,9 @@ delete from t3_trans;
set debug_sync='RESET';
set debug_sync='execute_command_after_close_tables SIGNAL parked WAIT_FOR go';
--send insert into t1_base values (1)
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
set debug_sync='now WAIT_FOR parked';
--send flush tables with read lock
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Wait until FTWRL is blocked.
let $wait_condition=
@@ -2018,7 +1882,6 @@ let $wait_condition=
--source include/wait_condition.inc
--echo # Try to run another INSERT and see that it is blocked.
--send insert into t2_base values (1);
---echo # Switching to connection 'con3'.
connection con3;
--echo # Wait until new INSERT is blocked.
let $wait_condition=
@@ -2027,20 +1890,16 @@ let $wait_condition=
info = "insert into t2_base values (1)";
--echo # Unblock INSERT in the first connection.
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'default'.
connection default;
--echo # Reap first INSERT.
--reap
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # Reap FTWRL.
--reap
unlock tables;
---echo # Switching to connection '$con_aux2'.
connection $con_aux2;
--echo # Reap second INSERT.
--reap
---echo # Switching to connection 'default'.
connection default;
set debug_sync= "RESET";
delete from t1_base;
@@ -2056,22 +1915,18 @@ delete from t2_base;
--echo # only taken when there were such modifications.
--echo
flush tables with read lock;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
--echo # The below FTWRL should not be blocked by transaction in 'default'.
flush tables with read lock;
---echo # Switching to connection 'default'.
connection default;
select * from t1_base;
select * from t3_trans;
commit;
---echo # Switching to connection '$con_aux1'.
connection $con_aux1;
select * from t1_base;
select * from t3_trans;
commit;
unlock tables;
---echo # Switching to connection 'default'.
connection default;
unlock tables;
diff --git a/mysql-test/t/flush_read_lock_kill.test b/mysql-test/t/flush_read_lock_kill.test
index a672fa5dfc5..d83e5b3f1df 100644
--- a/mysql-test/t/flush_read_lock_kill.test
+++ b/mysql-test/t/flush_read_lock_kill.test
@@ -26,7 +26,6 @@ SET DEBUG_SYNC= 'RESET';
CREATE TABLE t1 (kill_id INT) engine = InnoDB;
INSERT INTO t1 VALUES(connection_id());
---echo # Switching to connection 'default'.
connection default;
--echo # Start transaction.
BEGIN;
@@ -38,7 +37,6 @@ SET DEBUG_SYNC='ha_commit_trans_after_acquire_commit_lock SIGNAL acquired WAIT_F
--echo # Sending:
--send COMMIT
---echo # Switching to 'con1'.
connection con1;
--echo # Wait till COMMIT acquires protection against global read
--echo # lock and pauses.
@@ -46,7 +44,6 @@ SET DEBUG_SYNC='now WAIT_FOR acquired';
--echo # Sending:
send FLUSH TABLES WITH READ LOCK;
---echo # Switching to 'con2'.
connection con2;
SELECT ((@id := kill_id) - kill_id) FROM t1 LIMIT 1;
@@ -61,19 +58,16 @@ let $wait_condition=
--echo # Kill connection 'con1'.
KILL CONNECTION @id;
---echo # Switching to 'con1'.
connection con1;
--echo # Try to reap FLUSH TABLES WITH READ LOCK,
--echo # it fail due to killed statement and connection.
--error 1317,2013
reap;
---echo # Switching to 'con2'.
connection con2;
--echo # Resume COMMIT.
SET DEBUG_SYNC='now SIGNAL go';
---echo # Switching to 'default'.
connection default;
--echo # Reaping COMMIT.
--reap
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 47afb6664a5..222608c0579 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -617,7 +617,6 @@ select is_free_lock('test');
select is_used_lock('test') = connection_id();
connect (con1,localhost,root,,);
---echo # -> Switching to connection 'con1'
connection con1;
--echo # IS_USED_LOCK, IS_FREE_LOCK: the lock is acquired in another
--echo # connection
@@ -630,7 +629,6 @@ select get_lock('test', 0);
--echo # RELEASE_LOCK returns 0 if the lock belongs to another connection
select release_lock('test');
---echo # -> Switching to connection 'default'
connection default;
--echo # RELEASE_LOCK returns 1 if it successfully releases a lock
@@ -640,23 +638,19 @@ select release_lock('test');
--echo # Test that get_lock() returns NULL if error.
select get_lock('test', 0);
---echo # -> Switching to connection 'con1'
connection con1;
create table t1 select connection_id() as id;
send select get_lock('test', 7200);
---echo # -> Switching to connection 'default'
connection default;
let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state='User lock';
source include/wait_condition.inc;
select (@id := id) - id from t1;
kill query @id;
---echo # -> Switching to connection 'con1'
connection con1;
reap;
---echo # -> Switching to connection 'default'
connection default;
--echo # GET_LOCK() works recursively
@@ -686,12 +680,10 @@ select release_lock('test3');
--echo # Deadlocks are detected e.g. in case of a mutual wait
select get_lock('test1', 0);
---echo # -> Switching to connection 'con1'
connection con1;
select get_lock('test2', 0);
send select get_lock('test1', 7200);
---echo # -> Switching to connection 'default'
connection default;
let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state='User lock';
source include/wait_condition.inc;
@@ -700,13 +692,11 @@ select get_lock('test2', 7200);
select release_lock('test1');
---echo # -> Switching to connection 'con1'
connection con1;
reap;
select release_lock('test2');
select release_lock('test1');
---echo # -> Switching to connection 'default'
connection default;
--echo # LOCK/UNLOCK TABLES works fine with a user lock.
@@ -738,12 +728,10 @@ select release_lock('test2');
--echo # are detected OK.
select get_lock('test', 0);
---echo # -> Switching to connection 'con1'
connection con1;
lock table t1 write;
send select get_lock('test', 7200);
---echo # -> Switching to connection 'default'
connection default;
let $wait_condition= SELECT count(*) > 0 FROM information_schema.processlist WHERE info LIKE 'select%' AND state = 'User lock';
source include/wait_condition.inc;
@@ -752,7 +740,6 @@ lock table t1 read;
select release_lock('test');
---echo # -> Switching to connection 'con1'
connection con1;
reap;
select release_lock('test');
@@ -1071,7 +1058,6 @@ DROP TABLE t2;
--echo # MDEV-4018 : Microseconds in GET_LOCK()
--echo #
---echo # -> Switching to connection 'default'
connection default;
select is_used_lock('test') = connection_id();
@@ -1079,7 +1065,6 @@ select is_used_lock('test') = connection_id();
select get_lock('test', 0);
connect (con1,localhost,root,,);
---echo # -> Switching to connection 'con1'
connection con1;
select is_used_lock('test') = connection_id();
select get_lock('test', 0);
@@ -1089,7 +1074,6 @@ select get_lock('test', 0.1);
select get_lock('test', 0.000001);
select get_lock('test', 0.0000000000000001);
---echo # -> Switching to connection 'default'
connection default;
select is_used_lock('test') = connection_id();
select release_lock('test');
diff --git a/mysql-test/t/grant.test b/mysql-test/t/grant.test
index 1d828cd8693..d3f84596106 100644
--- a/mysql-test/t/grant.test
+++ b/mysql-test/t/grant.test
@@ -1037,8 +1037,6 @@ GRANT ALL PRIVILEGES ON test.* TO mysqltest_1@localhost;
# Test.
--connect (bug9504_con1,localhost,mysqltest_1,,)
---echo
---echo ---> connection: bug9504_con1
# - Check that we can switch to the db;
@@ -1065,9 +1063,6 @@ SELECT mysqltest4.f_inv();
# Cleanup.
--connection default
---echo
---echo ---> connection: default
-
--disconnect bug9504_con1
DROP DATABASE mysqltest1;
@@ -1106,8 +1101,6 @@ CREATE PROCEDURE mysqltest1.p1() SQL SECURITY INVOKER
# Test.
--connect (bug27337_con1,localhost,mysqltest_1,,mysqltest2)
---echo
---echo ---> connection: bug27337_con1
--error ER_TABLEACCESS_DENIED_ERROR
CREATE TABLE t1(c INT);
@@ -1120,8 +1113,6 @@ CREATE TABLE t1(c INT);
--disconnect bug27337_con1
--connect (bug27337_con2,localhost,mysqltest_1,,mysqltest2)
---echo
---echo ---> connection: bug27337_con2
--error ER_TABLEACCESS_DENIED_ERROR
CREATE TABLE t1(c INT);
@@ -1131,9 +1122,6 @@ SHOW TABLES;
# Cleanup.
--connection default
---echo
---echo ---> connection: default
-
--disconnect bug27337_con2
DROP DATABASE mysqltest1;
@@ -1162,8 +1150,6 @@ GRANT SELECT ON mysqltest2.t2 TO mysqltest_2@localhost;
# Test.
--connect (bug27337_con1,localhost,mysqltest_1,,mysqltest1)
---echo
---echo ---> connection: bug27337_con1
SHOW TABLES FROM mysqltest1;
@@ -1172,8 +1158,6 @@ PREPARE stmt1 FROM 'SHOW TABLES FROM mysqltest1';
EXECUTE stmt1;
--connect (bug27337_con2,localhost,mysqltest_2,,mysqltest2)
---echo
---echo ---> connection: bug27337_con2
SHOW COLUMNS FROM mysqltest2.t2;
@@ -1182,15 +1166,11 @@ PREPARE stmt2 FROM 'SHOW COLUMNS FROM mysqltest2.t2';
EXECUTE stmt2;
--connection default
---echo
---echo ---> connection: default
REVOKE SELECT ON mysqltest1.t1 FROM mysqltest_1@localhost;
REVOKE SELECT ON mysqltest2.t2 FROM mysqltest_2@localhost;
--connection bug27337_con1
---echo
---echo ---> connection: bug27337_con1
--error ER_DBACCESS_DENIED_ERROR
SHOW TABLES FROM mysqltest1;
@@ -1199,8 +1179,6 @@ SHOW TABLES FROM mysqltest1;
EXECUTE stmt1;
--connection bug27337_con2
---echo
---echo ---> connection: bug27337_con2
--error ER_TABLEACCESS_DENIED_ERROR
SHOW COLUMNS FROM mysqltest2.t2;
@@ -1211,8 +1189,6 @@ EXECUTE stmt2;
# Cleanup.
--connection default
---echo
---echo ---> connection: default
--disconnect bug27337_con1
--disconnect bug27337_con2
@@ -1321,8 +1297,6 @@ GRANT SELECT(b) ON t1 TO testuser@localhost;
GRANT SELECT ON t2 TO testuser@localhost;
GRANT SELECT ON mysqltest2.* TO testuser@localhost;
---echo
---echo # Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
--connect (bug57952_con1,localhost,testuser,,mysqltest1)
PREPARE s1 FROM 'SELECT b FROM t1';
PREPARE s2 FROM 'SELECT a FROM t2';
@@ -1336,16 +1310,12 @@ CALL p1;
CALL p2;
CALL p3;
---echo
---echo # Connection: default
--connection default
REVOKE SELECT ON t1 FROM testuser@localhost;
GRANT SELECT(a) ON t1 TO testuser@localhost;
REVOKE SELECT ON t2 FROM testuser@localhost;
REVOKE SELECT ON mysqltest2.* FROM testuser@localhost;
---echo
---echo # Connection: bug57952_con1 (testuser@localhost, db: mysqltest1)
--connection bug57952_con1
--echo # - Check column-level privileges...
--error ER_COLUMNACCESS_DENIED_ERROR
@@ -1380,8 +1350,6 @@ EXECUTE s3;
--error ER_DBACCESS_DENIED_ERROR
CALL p3;
---echo
---echo # Connection: default
--connection default
--disconnect bug57952_con1
DROP DATABASE mysqltest1;
@@ -1410,14 +1378,10 @@ grant execute on procedure mysqltest1.p1 to mysqluser1@localhost;
--echo # in privilege tables and in in-memory structures.
show grants for mysqluser1@localhost;
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
---echo #
---echo # Create connection 'bug_36544_con1' as 'mysqluser1@localhost'.
--connect (bug36544_con1,localhost,mysqluser1,,)
call mysqltest1.p1();
select mysqltest1.f1();
---echo #
---echo # Switch to connection 'default'.
--connection default
drop user mysqluser1@localhost;
@@ -1425,7 +1389,6 @@ drop user mysqluser1@localhost;
--echo # Test that dropping of user is properly reflected in
--echo # both privilege tables and in in-memory structures.
--echo #
---echo # Switch to connection 'bug36544_con1'.
--connection bug36544_con1
--echo # The connection cold be alive but should not be able to
--echo # access to any of the stored routines.
@@ -1435,8 +1398,6 @@ call mysqltest1.p1();
select mysqltest1.f1();
--disconnect bug36544_con1
---echo #
---echo # Switch to connection 'default'.
--connection default
--echo #
--echo # Now create user with the same name and check that he
@@ -1444,16 +1405,12 @@ select mysqltest1.f1();
create user mysqluser1@localhost;
show grants for mysqluser1@localhost;
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
---echo #
---echo # Create connection 'bug_36544_con2' as 'mysqluser1@localhost'.
--connect (bug36544_con2,localhost,mysqluser1,,)
--echo # Newly created user should not be able to access any of the routines.
--error ER_PROCACCESS_DENIED_ERROR
call mysqltest1.p1();
--error ER_PROCACCESS_DENIED_ERROR
select mysqltest1.f1();
---echo #
---echo # Switch to connection 'default'.
--connection default
--echo #
@@ -1482,23 +1439,18 @@ grant select on mysqltest1.t11 to mysqluser1@localhost;
show grants for mysqluser1@localhost;
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
---echo #
---echo # Switch to connection 'bug36544_con2'.
--connection bug36544_con2
call mysqltest1.p1();
select mysqltest1.f1();
select * from mysqltest1.t11;
select * from mysqltest1.t22;
---echo #
---echo # Switch to connection 'default'.
--connection default
rename user mysqluser1@localhost to mysqluser10@localhost;
--echo #
--echo # Test that there are no privileges left for mysqluser1.
--echo #
---echo # Switch to connection 'bug36544_con2'.
--connection bug36544_con2
--echo # The connection cold be alive but should not be able to
--echo # access to any of the stored routines or tables.
@@ -1512,8 +1464,6 @@ select * from mysqltest1.t11;
select * from mysqltest1.t22;
--disconnect bug36544_con2
---echo #
---echo # Switch to connection 'default'.
--connection default
--echo #
--echo # Now create user with the old name and check that he
@@ -1522,8 +1472,6 @@ create user mysqluser1@localhost;
show grants for mysqluser1@localhost;
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser1' and host='localhost';
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser1' and host='localhost';
---echo #
---echo # Create connection 'bug_36544_con3' as 'mysqluser1@localhost'.
--connect (bug36544_con3,localhost,mysqluser1,,)
--echo # Newly created user should not be able to access to any of the
--echo # stored routines or tables.
@@ -1537,8 +1485,6 @@ select * from mysqltest1.t11;
select * from mysqltest1.t22;
--disconnect bug36544_con3
---echo #
---echo # Switch to connection 'default'.
--connection default
--echo #
--echo # Now check that privileges became associated with a new user
@@ -1547,8 +1493,6 @@ select * from mysqltest1.t22;
show grants for mysqluser10@localhost;
select db, routine_name, routine_type, proc_priv from mysql.procs_priv where user='mysqluser10' and host='localhost';
select db, table_name, table_priv from mysql.tables_priv where user='mysqluser10' and host='localhost';
---echo #
---echo # Create connection 'bug_36544_con4' as 'mysqluser10@localhost'.
--connect (bug36544_con4,localhost,mysqluser10,,)
call mysqltest1.p1();
select mysqltest1.f1();
@@ -1556,8 +1500,6 @@ select * from mysqltest1.t11;
select * from mysqltest1.t22;
--disconnect bug36544_con4
---echo #
---echo # Switch to connection 'default'.
--connection default
--echo #
--echo # Clean-up.
@@ -1905,8 +1847,6 @@ GRANT USAGE ON *.* TO mysqltest_u1@localhost;
--echo
SHOW GRANTS FOR mysqltest_u1@localhost;
---echo
---echo # connection: con1 (mysqltest_u1@mysqltest_db1)
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
--connection con1
@@ -1914,8 +1854,6 @@ SHOW GRANTS FOR mysqltest_u1@localhost;
--error ER_TABLEACCESS_DENIED_ERROR
SHOW CREATE TABLE t1;
---echo
---echo # connection: default
--connection default
--disconnect con1
@@ -2191,7 +2129,6 @@ DROP DATABASE IF EXISTS no_such_db;
CREATE DATABASE secret;
GRANT USAGE ON *.* TO untrusted@localhost;
---echo # Connection con1
connect (con1, localhost, untrusted);
SHOW GRANTS;
SHOW DATABASES;
@@ -2204,7 +2141,6 @@ CREATE PROCEDURE no_such_db.foo() BEGIN END;
--error ER_DBACCESS_DENIED_ERROR
CREATE PROCEDURE secret.peek_at_secret() BEGIN END;
---echo # Connection default
--connection default
disconnect con1;
DROP USER untrusted@localhost;
diff --git a/mysql-test/t/grant2.test b/mysql-test/t/grant2.test
index a40fd2afb18..5e8a130feea 100644
--- a/mysql-test/t/grant2.test
+++ b/mysql-test/t/grant2.test
@@ -744,8 +744,6 @@ CREATE TABLE mysqltest_db2.t2_1(a INT);
--echo # sql_command enum).
--echo ###########################################################################
---echo
---echo # -- connect con1, mysqltest_u1@localhost, mysqltest_db1
--connect (con1,localhost,mysqltest_u1,,mysqltest_db1)
--echo #
@@ -931,8 +929,6 @@ DROP TEMPORARY TABLE t1;
--echo # table once it is created.
--echo ###########################################################################
---echo
---echo # -- connect con2, mysqltest_u2@localhost, mysqltest_db1
--connect (con2,localhost,mysqltest_u2,,mysqltest_db1)
--error ER_DBACCESS_DENIED_ERROR
@@ -957,8 +953,6 @@ DROP TEMPORARY TABLE t4;
--echo # context, even by user without any privileges on tables.
--echo ###########################################################################
---echo
---echo # -- connect con3, mysqltest_u4@localhost, mysqltest_db1
--connect (con3,localhost,mysqltest_u4,,mysqltest_db1)
CALL p1();
@@ -975,8 +969,6 @@ DROP TEMPORARY TABLE t4;
--echo # a temporary table into the underlying-table-list.
--echo ###########################################################################
---echo
---echo # -- connect con4, mysqltest_u5@localhost, mysqltest_db1
--connect (con4,localhost,mysqltest_u5,,mysqltest_db1)
CREATE TEMPORARY TABLE t7(a INT);
@@ -1004,21 +996,12 @@ DROP TEMPORARY TABLE t9;
--echo # That's all. Cleanup.
--echo ###########################################################################
---echo
---echo # -- connection: default
--connection default
---echo # -- disconnect con1
--echo # All remaining temporary tables are automatically dropped.
--disconnect con1
-
---echo # -- disconnect con2
--disconnect con2
-
---echo # -- disconnect con3
--disconnect con3
-
---echo # -- disconnect con4
--disconnect con4
SET GLOBAL keycache1.key_buffer_size = 0;
diff --git a/mysql-test/t/grant4.test b/mysql-test/t/grant4.test
index a3578c9b85a..2715b7c7145 100644
--- a/mysql-test/t/grant4.test
+++ b/mysql-test/t/grant4.test
@@ -183,7 +183,6 @@ flush table mysqltest_db1.t1;
--remove_file $MYSQLD_DATADIR/mysqltest_db1/t1.MYI
--copy_file std_data/corrupt_t1.MYI $MYSQLD_DATADIR/mysqltest_db1/t1.MYI
---echo # Switching to connection 'con1'.
connection con1;
check table mysqltest_db1.t1;
--echo # The below statement should fail before repairing t1.
@@ -199,7 +198,6 @@ repair table mysqltest_db1.t1;
--echo # Clean-up.
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Switching to connection 'default'.
connection default;
drop database mysqltest_db1;
drop user mysqltest_u1@localhost;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f1e78441852..13f368b6dbe 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -1489,16 +1489,13 @@ drop tables if exists t1, t2, t3;
create table t1 (i int);
create table t2 (j int primary key auto_increment);
connect (con3726_1,localhost,root,,test);
---echo # Switching to connection 'con3726_1'
connection con3726_1;
lock table t2 read;
connect (con3726_2,localhost,root,,test);
---echo # Switching to connection 'con3726_2'
connection con3726_2;
--echo # RENAME below will be blocked by 'lock table t2 read' above but
--echo # will add two pending requests for exclusive metadata locks.
--send rename table t2 to t3
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -1510,13 +1507,10 @@ select table_name, column_name, data_type from information_schema.columns
where table_schema = 'test' and table_name in ('t1', 't2');
select table_name, auto_increment from information_schema.tables
where table_schema = 'test' and table_name in ('t1', 't2');
---echo # Switching to connection 'con3726_1'
connection con3726_1;
unlock tables;
---echo # Switching to connection 'con3726_2'
connection con3726_2;
--reap
---echo # Switching to connection 'default'
connection default;
disconnect con3726_1;
disconnect con3726_2;
@@ -1604,10 +1598,8 @@ create view v1 as select t1.a, t1.b from t1;
alter table t1 change b c int;
lock table t1 read;
connect(con1, localhost, root,,);
---echo # --> connection con1
connection con1;
send flush tables;
---echo # --> connection default
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -1623,13 +1615,11 @@ unlock tables;
--echo # Cleanup.
--echo #
---echo # --> connection con1
connection con1;
--echo # Reaping 'flush tables'
reap;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # --> connection default
connection default;
drop table t1;
drop view v1;
@@ -1663,17 +1653,11 @@ create table t2 (k int);
--echo # blocked.
lock tables t2 read;
---echo #
---echo # Switching to connection 'con12828477_1'.
---echo #
connect (con12828477_1, localhost, root,,mysqltest);
--echo # The below RENAME should wait on 't2' while
--echo # keeping X lock on 't1'.
--send rename table t1 to t3, t2 to t1, t3 to t2
---echo #
---echo # Switching to connection 'con12828477_2'.
---echo #
connect (con12828477_2, localhost, root,,mysqltest);
--echo # Wait while the above RENAME is blocked.
let $wait_condition=
@@ -1686,9 +1670,6 @@ let $wait_condition=
--echo # blocked on 't1' because of RENAME.
--send select table_name, auto_increment from information_schema.tables where table_schema='mysqltest'
---echo #
---echo # Switching to connection 'con12828477_3'.
---echo #
connect (con12828477_3, localhost, root,,mysqltest);
--echo # Wait while the above SELECT is blocked.
let $wait_condition=
@@ -1701,31 +1682,19 @@ let $wait_condition=
--echo # Check that it holds no lock on 't0' so it can be renamed.
rename table t0 to t4;
---echo #
---echo # Switching to connection 'default'.
---echo #
connection default;
--echo #
--echo # Unblock the first RENAME.
unlock tables;
---echo #
---echo # Switching to connection 'con12828477_1'.
---echo #
connection con12828477_1;
--echo # Reap the first RENAME
--reap
---echo #
---echo # Switching to connection 'con12828477_2'.
---echo #
connection con12828477_2;
--echo # Reap SELECT to I_S.
--reap
---echo #
---echo # Switching to connection 'default'.
---echo #
connection default;
--echo #
@@ -1739,17 +1708,11 @@ rename table t4 to t0;
--echo # blocked.
lock tables t2 read;
---echo #
---echo # Switching to connection 'con12828477_1'.
---echo #
connection con12828477_1;
--echo # The below RENAME should wait on 't2' while
--echo # keeping X lock on 't1'.
--send rename table t1 to t3, t2 to t1, t3 to t2
---echo #
---echo # Switching to connection 'con12828477_2'.
---echo #
connection con12828477_2;
--echo # Wait while the above RENAME is blocked.
let $wait_condition=
@@ -1762,9 +1725,6 @@ let $wait_condition=
--echo # blocked on 't1' because of RENAME.
--send select event_object_table, trigger_name from information_schema.triggers where event_object_schema='mysqltest'
---echo #
---echo # Switching to connection 'con12828477_3'.
---echo #
connection con12828477_3;
--echo # Wait while the above SELECT is blocked.
let $wait_condition=
@@ -1777,31 +1737,19 @@ let $wait_condition=
--echo # Check that it holds no lock on 't0' so it can be renamed.
rename table t0 to t4;
---echo #
---echo # Switching to connection 'default'.
---echo #
connection default;
--echo #
--echo # Unblock the first RENAME.
unlock tables;
---echo #
---echo # Switching to connection 'con12828477_1'.
---echo #
connection con12828477_1;
--echo # Reap the first RENAME
--reap
---echo #
---echo # Switching to connection 'con12828477_2'.
---echo #
connection con12828477_2;
--echo # Reap SELECT to I_S.
--reap
---echo #
---echo # Switching to connection 'default'.
---echo #
connection default;
disconnect con12828477_1;
disconnect con12828477_2;
diff --git a/mysql-test/t/innodb_mysql_lock.test b/mysql-test/t/innodb_mysql_lock.test
index b3c52a1b1cf..cb57c092e40 100644
--- a/mysql-test/t/innodb_mysql_lock.test
+++ b/mysql-test/t/innodb_mysql_lock.test
@@ -19,24 +19,20 @@ connect (con1,localhost,root,,);
connect (con2,localhost,root,,);
connect (con3,localhost,root,,);
---echo # Connection 1
connection con1;
set @@autocommit=0;
CREATE TABLE t1(s1 INT UNIQUE) ENGINE=innodb;
INSERT INTO t1 VALUES (1);
---echo # Connection 2
connection con2;
set @@autocommit=0;
INSERT INTO t1 VALUES (2);
--send INSERT INTO t1 VALUES (1)
---echo # Connection 3
connection con3;
set @@autocommit=0;
--send DROP TABLE t1
---echo # Connection 1
connection con1;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -85,7 +81,6 @@ begin;
update t1 set c3=c3+1 where c2=3;
--echo #
---echo # Switching to connection 'con37346'.
connect (con37346,localhost,root,,test,,);
connection con37346;
--echo # The below ALTER TABLE statement should wait till transaction
@@ -95,7 +90,6 @@ connection con37346;
--send alter table t1 add column c4 int;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until the above ALTER TABLE gets blocked because this
--echo # connection holds SW metadata lock on table to be altered.
@@ -113,13 +107,11 @@ update t1 set c3=c3+1 where c2=4;
commit;
--echo #
---echo # Switching to connection 'con37346'.
connection con37346;
--echo # Reaping ALTER TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
disconnect con37346;
drop table t1;
@@ -143,16 +135,13 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (i INT) engine= innodb;
---echo # Connection 2
--echo # Get user-level lock
connection con2;
SELECT get_lock('bug42147_lock', 60);
---echo # Connection 1
connection default;
--send INSERT INTO t1 SELECT get_lock('bug42147_lock', 60)
---echo # Connection 2
connection con2;
let $wait_condition=
SELECT COUNT(*) > 0 FROM information_schema.processlist
@@ -162,15 +151,12 @@ let $wait_condition=
LOCK TABLES t1 READ;
SELECT release_lock('bug42147_lock');
---echo # Connection 1
connection default;
--reap
---echo # Connection 2
connection con2;
UNLOCK TABLES;
---echo # Connection 1
connection default;
disconnect con2;
DROP TABLE t1;
@@ -187,18 +173,15 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) engine=innodb;
INSERT INTO t1 VALUES (1), (2), (3);
---echo # Connection con1
connect (con1, localhost, root);
START TRANSACTION WITH CONSISTENT SNAPSHOT;
SELECT * FROM t1;
---echo # Connection default
connection default;
--echo # This should block
--echo # Sending:
--send OPTIMIZE TABLE t1
---echo # Connection con1
connection con1;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for table metadata lock' AND info='OPTIMIZE TABLE t1';
@@ -206,7 +189,6 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
SELECT * FROM t1;
COMMIT;
---echo # Connection default
connection default;
--echo # Reaping OPTIMIZE TABLE t1
--reap
@@ -230,18 +212,15 @@ CREATE VIEW v1 AS SELECT 1 FROM t1;
connect (con2, localhost, root);
connect (con3, localhost, root);
---echo # Connection con3
connection con3;
LOCK TABLE t1 WRITE;
---echo # Connection default
connection default;
START TRANSACTION;
# This should block due to t1 being locked.
--echo # Sending:
--send SELECT * FROM v1
---echo # Connection con2
connection con2;
--echo # Waiting for 'SELECT * FROM v1' to sync in.
let $wait_condition=
@@ -252,7 +231,6 @@ let $wait_condition=
--echo # Sending:
--send ALTER VIEW v1 AS SELECT 2 FROM t2
---echo # Connection con3
connection con3;
--echo # Waiting for 'ALTER VIEW v1 AS SELECT 2 FROM t2' to sync in.
let $wait_condition=
@@ -263,19 +241,16 @@ let $wait_condition=
# Unlock t1 allowing SELECT * FROM v1 to proceed.
UNLOCK TABLES;
---echo # Connection default;
connection default;
--echo # Reaping: SELECT * FROM v1
--reap
SELECT * FROM v1;
COMMIT;
---echo # Connection con2
connection con2;
--echo # Reaping: ALTER VIEW v1 AS SELECT 2 FROM t2
--reap
---echo # Connection default
connection default;
DROP TABLE t1, t2;
DROP VIEW v1;
@@ -294,14 +269,12 @@ DROP TABLE IF EXISTS t1;
--connect (con1,localhost,root)
---echo # Connection default
connection default;
CREATE TABLE t1 (id INT PRIMARY KEY, value INT) ENGINE = InnoDB;
INSERT INTO t1 VALUES (1, 12345);
START TRANSACTION;
SELECT * FROM t1;
---echo # Connection con1
--connection con1
SET lock_wait_timeout=1;
# Test with two timeouts, as the first version of this patch
@@ -311,7 +284,6 @@ ALTER TABLE t1 ADD INDEX idx(value);
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 ADD INDEX idx(value);
---echo # Connection default
--connection default
SELECT * FROM t1;
COMMIT;
diff --git a/mysql-test/t/innodb_mysql_lock2.test b/mysql-test/t/innodb_mysql_lock2.test
index 640f9652462..f319fe23568 100644
--- a/mysql-test/t/innodb_mysql_lock2.test
+++ b/mysql-test/t/innodb_mysql_lock2.test
@@ -789,12 +789,10 @@ begin;
--echo # Acquire SR metadata lock on t1 and LOCK_S row-locks on its rows.
insert into t2 select count(*) from t1;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Sending:
--send alter table t1 add column j int
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER is blocked because it tries to upgrade SNW
--echo # metadata lock to X lock.
@@ -817,12 +815,10 @@ insert into t1 values (6);
--echo # Unblock ALTER TABLE.
commit;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Reaping ALTER TABLE.
--reap
---echo # Switching to connection 'default'.
connection default;
--echo #
@@ -838,12 +834,10 @@ begin;
--echo # Acquire SR metadata lock on t1.
select * from t1;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Sending:
--send alter table t1 rebuild partition p0
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER is blocked because of active SR lock.
let $wait_condition=
@@ -859,12 +853,10 @@ insert into t2 select count(*) from t1;
--echo # Unblock ALTER TABLE.
commit;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Reaping ALTER TABLE.
--reap
---echo # Switching to connection 'default'.
connection default;
disconnect con1;
--echo # Clean-up.
diff --git a/mysql-test/t/innodb_mysql_sync.test b/mysql-test/t/innodb_mysql_sync.test
index 31365cb8db8..66935f811d7 100644
--- a/mysql-test/t/innodb_mysql_sync.test
+++ b/mysql-test/t/innodb_mysql_sync.test
@@ -22,20 +22,17 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT) engine=innodb;
connect (con2, localhost, root);
---echo # Connection 1
--echo # Start optimizing table
connection default;
SET DEBUG_SYNC='ha_admin_try_alter SIGNAL optimize_started WAIT_FOR table_altered';
--send OPTIMIZE TABLE t1
---echo # Connection 2
--echo # Change table to engine=memory
connection con2;
SET DEBUG_SYNC='now WAIT_FOR optimize_started';
ALTER TABLE t1 engine=memory;
SET DEBUG_SYNC='now SIGNAL table_altered';
---echo # Connection 1
--echo # Complete optimization
connection default;
--reap
@@ -59,24 +56,20 @@ connection default;
CREATE TABLE t1(a INT) ENGINE= InnoDB;
---echo # Connection con1
connection con1;
SET DEBUG_SYNC= "ha_admin_open_ltable SIGNAL opening WAIT_FOR dropped";
--echo # Sending:
--send OPTIMIZE TABLE t1
---echo # Connection default
connection default;
SET DEBUG_SYNC= "now WAIT_FOR opening";
DROP TABLE t1;
SET DEBUG_SYNC= "now SIGNAL dropped";
---echo # Connection con1
connection con1;
--echo # Reaping: OPTIMIZE TABLE t1
--reap
---echo # Connection default
connection default;
disconnect con1;
SET DEBUG_SYNC= "RESET";
@@ -123,26 +116,22 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1), (2);
---echo # Connection con1
connect (con1,localhost,root);
let $ID= `SELECT connection_id()`;
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL waiting WAIT_FOR killed';
--echo # Sending:
--send OPTIMIZE TABLE t1
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR waiting';
--replace_result $ID ID
eval KILL QUERY $ID;
SET DEBUG_SYNC= 'now SIGNAL killed';
---echo # Connection con1
connection con1;
--echo # Reaping: OPTIMIZE TABLE t1
--reap
---echo # Connection default
connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
@@ -164,7 +153,6 @@ connect(con2,localhost,root);
--echo # Test 1: Secondary index, should not block reads (original test case).
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1(id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, value INT) engine=innodb;
@@ -173,7 +161,6 @@ SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR
--echo # Sending:
--send ALTER TABLE db1.t1 ADD INDEX(value)
---echo # Connection con1
connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
# Neither of these two statements should be blocked
@@ -181,7 +168,6 @@ USE db1;
SELECT * FROM t1;
SET DEBUG_SYNC= "now SIGNAL query";
---echo # Connection default
connection default;
--echo # Reaping: ALTER TABLE db1.t1 ADD INDEX(value)
--reap
@@ -194,7 +180,6 @@ SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR
--echo # Sending:
--send ALTER TABLE t1 ADD UNIQUE INDEX(a), LOCK=SHARED
---echo # Connection con1
connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
USE test;
@@ -202,7 +187,6 @@ SELECT * FROM t1;
--echo # Sending:
--send UPDATE t1 SET a=NULL
---echo # Connection con2
connection con2;
--echo # Waiting for SELECT to be blocked by the metadata lock on t1
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -211,33 +195,28 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= "now SIGNAL query";
---echo # Connection default
connection default;
--echo # Reaping: ALTER TABLE t1 ADD UNIQUE INDEX(a)
--reap
---echo # Connection con1
connection con1;
--echo # Reaping: UPDATE t1 SET a=NULL
--reap
--echo # Test 3: Primary index (explicit), should block writes.
---echo # Connection default
connection default;
ALTER TABLE t1 DROP INDEX a;
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
--echo # Sending:
--send ALTER TABLE t1 ADD PRIMARY KEY (a), LOCK=SHARED
---echo # Connection con1
connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
--echo # Sending:
--send UPDATE t1 SET a=NULL
---echo # Connection con2
connection con2;
--echo # Waiting for SELECT to be blocked by the metadata lock on t1
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -246,31 +225,26 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= "now SIGNAL query";
---echo # Connection default
connection default;
--echo # Reaping: ALTER TABLE t1 ADD PRIMARY KEY (a)
--reap
---echo # Connection con1
connection con1;
--echo # Reaping: UPDATE t1 SET a=NULL
--reap
--echo # Test 4: Secondary unique index, should not block reads.
---echo # Connection default
connection default;
SET DEBUG_SYNC= "alter_table_inplace_after_lock_downgrade SIGNAL manage WAIT_FOR query";
--echo # Sending:
--send ALTER TABLE t1 ADD UNIQUE (b)
---echo # Connection con1
connection con1;
SET DEBUG_SYNC= "now WAIT_FOR manage";
SELECT * FROM t1;
SET DEBUG_SYNC= "now SIGNAL query";
---echo # Connection default
connection default;
--echo # Reaping: ALTER TABLE t1 ADD UNIQUE (b)
--reap
@@ -293,14 +267,12 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT NOT NULL, b INT NOT NULL) engine=innodb;
INSERT INTO t1 VALUES (1, 12345), (2, 23456);
---echo # Connection con1
--connect (con1,localhost,root)
SET SESSION debug_dbug= "+d,alter_table_rollback_new_index";
--error ER_UNKNOWN_ERROR
ALTER TABLE t1 ADD PRIMARY KEY(a);
SELECT * FROM t1;
---echo # Connection default
--connection default
SELECT * FROM t1;
DROP TABLE t1;
@@ -322,20 +294,17 @@ CREATE DATABASE db1;
connect(con1, localhost, root);
connect(con2, localhost, root);
---echo # Connection con1
connection con1;
SET DEBUG_SYNC= 'after_innobase_rename_table SIGNAL locked WAIT_FOR continue';
--echo # Sending:
--send ALTER TABLE t1 RENAME db1.t1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # DROP DATABASE db1 should now be blocked by ALTER TABLE
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection default
connection default;
--echo # Check that DROP DATABASE is blocked by IX lock on db1
let $wait_condition=
@@ -346,17 +315,14 @@ let $wait_condition=
--echo # Resume ALTER TABLE
SET DEBUG_SYNC= 'now SIGNAL continue';
---echo # Connection con1
connection con1;
--echo # Reaping: ALTER TABLE t1 RENAME db1.t1;
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection default;
connection default;
SET DEBUG_SYNC= 'RESET';
disconnect con1;
@@ -384,7 +350,6 @@ SET SESSION lock_wait_timeout= 1;
--echo # 1: In-place + writes blocked.
--echo #
---echo # Connection default
--connection default
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
@@ -393,7 +358,6 @@ SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue4
--echo # Sending:
--send ALTER TABLE t1 ADD INDEX i1(b), ALGORITHM= INPLACE, LOCK= SHARED
---echo # Connection con1;
--connection con1
SET DEBUG_SYNC= 'now WAIT_FOR opened';
--echo # At this point, neither reads nor writes should be blocked.
@@ -425,7 +389,6 @@ SELECT * FROM t1;
INSERT INTO t1 VALUES (6,6);
SET DEBUG_SYNC= 'now SIGNAL continue4';
---echo # Connection default
--connection default
--echo # Reaping ALTER TABLE ...
--reap
@@ -442,7 +405,6 @@ SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue3
--echo # Sending:
--send ALTER TABLE t1 ADD INDEX i2(b), ALGORITHM= COPY, LOCK= SHARED
---echo # Connection con1;
--connection con1
SET DEBUG_SYNC= 'now WAIT_FOR opened';
--echo # At this point, neither reads nor writes should be blocked.
@@ -465,7 +427,6 @@ SELECT * FROM t1 limit 1;
INSERT INTO t1 VALUES (5,5);
SET DEBUG_SYNC= 'now SIGNAL continue3';
---echo # Connection default
--connection default
--echo # Reaping ALTER TABLE ...
--reap
@@ -479,7 +440,6 @@ DELETE FROM t1 WHERE a= 3;
--echo # TODO: Enable this test once WL#5526 is pushed
--disable_parsing
---echo # Connection default
--connection default
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
@@ -489,7 +449,6 @@ SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue5
--echo # Sending:
--send ALTER TABLE t1 ADD INDEX i3(b), ALGORITHM= INPLACE, LOCK= NONE
---echo # Connection con1;
--connection con1
SET DEBUG_SYNC= 'now WAIT_FOR opened';
--echo # At this point, neither reads nor writes should be blocked.
@@ -526,7 +485,6 @@ SELECT * FROM t1;
INSERT INTO t1 VALUES (7,7);
SET DEBUG_SYNC= 'now SIGNAL continue5';
---echo # Connection default
--connection default
--echo # Reaping ALTER TABLE ...
--reap
@@ -540,7 +498,6 @@ DELETE FROM t1 WHERE a= 3 OR a= 4;
--echo # 4: In-place + reads and writes blocked.
--echo #
---echo # Connection default
--connection default
SET DEBUG_SYNC= 'alter_opened_table SIGNAL opened WAIT_FOR continue1';
SET DEBUG_SYNC= 'alter_table_inplace_after_lock_upgrade SIGNAL upgraded WAIT_FOR continue2';
@@ -549,7 +506,6 @@ SET DEBUG_SYNC= 'alter_table_before_main_binlog SIGNAL binlog WAIT_FOR continue4
--echo # Sending:
--send ALTER TABLE t1 ADD INDEX i4(b), ALGORITHM= INPLACE, LOCK= EXCLUSIVE
---echo # Connection con1;
--connection con1
SET DEBUG_SYNC= 'now WAIT_FOR opened';
--echo # At this point, neither reads nor writes should be blocked.
@@ -581,7 +537,6 @@ SELECT * FROM t1;
INSERT INTO t1 VALUES (6,6);
SET DEBUG_SYNC= 'now SIGNAL continue4';
---echo # Connection default
--connection default
--echo # Reaping ALTER TABLE ...
--reap
@@ -606,7 +561,6 @@ INSERT INTO t1 VALUES (155, 45, 55);
--echo #Concurrent INSERT, UPDATE, SELECT and DELETE is supported
--echo #during OPTIMIZE TABLE operation for INNODB tables.
---enable_connect_log
--connection default
--echo #OPTIMIZE TABLE operation.
--send OPTIMIZE TABLE t1
@@ -785,7 +739,6 @@ SET DEBUG_SYNC= 'now WAIT_FOR rebuild';
--connection default
--reap
---disable_connect_log
--disconnect con1
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test
index aaf931a2e7f..b6000ffced1 100644
--- a/mysql-test/t/kill.test
+++ b/mysql-test/t/kill.test
@@ -345,8 +345,6 @@ SET DEBUG_SYNC = 'RESET';
--echo # depending on platform.
--echo #
---echo
---echo # Connection: con1.
--connection con1
let $ID= `SELECT @id := CONNECTION_ID()`;
SET DEBUG_SYNC= 'thread_end SIGNAL con1_end';
@@ -385,14 +383,11 @@ connect (dml, localhost, root, , );
connect (ddl, localhost, root, , );
--echo # Test for RENAME TABLE
---echo # Switching to connection 'blocker'
connection blocker;
lock table t1 read;
---echo # Switching to connection 'ddl'
connection ddl;
let $ID= `select connection_id()`;
--send rename table t1 to t2
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -401,14 +396,12 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--echo # Test for DROP TABLE
--send drop table t1
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -417,14 +410,12 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--echo # Test for CREATE TRIGGER
--send create trigger t1_bi before insert on t1 for each row set @a:=1
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -433,7 +424,6 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
@@ -443,7 +433,6 @@ connection ddl;
--echo #
--echo # Full-blown ALTER which should copy table
--send alter table t1 add column j int
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -452,14 +441,12 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--echo # Two kinds of simple ALTER
--send alter table t1 rename to t2
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -468,12 +455,10 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--send alter table t1 disable keys
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -482,13 +467,11 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--echo # Fast ALTER
--send alter table t1 alter column i set default 100
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -497,20 +480,16 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--echo # Special case which is triggered only for MERGE tables.
---echo # Switching to connection 'blocker'
connection blocker;
unlock tables;
create table t2 (i int primary key) engine=merge union=(t1);
lock tables t2 read;
---echo # Switching to connection 'ddl'
connection ddl;
--send alter table t2 alter column i set default 100
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -519,21 +498,17 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'ddl'
connection ddl;
--error ER_QUERY_INTERRUPTED
--reap
--echo # Test for DML waiting for meta-data lock
---echo # Switching to connection 'blocker'
connection blocker;
unlock tables;
lock tables t1 read;
---echo # Switching to connection 'ddl'
connection ddl;
# Let us add pending exclusive metadata lock on t2
--send truncate table t1
---echo # Switching to connection 'dml'
connection dml;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -542,7 +517,6 @@ let $wait_condition=
--source include/wait_condition.inc
let $ID2= `select connection_id()`;
--send insert into t1 values (1)
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -551,26 +525,20 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID2 ID2
eval kill query $ID2;
---echo # Switching to connection 'dml'
connection dml;
--error ER_QUERY_INTERRUPTED
--reap
---echo # Switching to connection 'blocker'
connection blocker;
unlock tables;
---echo # Switching to connection 'ddl'
connection ddl;
--reap
--echo # Test for DML waiting for tables to be flushed
---echo # Switching to connection 'blocker'
connection blocker;
lock tables t1 read;
---echo # Switching to connection 'ddl'
connection ddl;
--echo # Let us mark locked table t1 as old
--send flush tables
---echo # Switching to connection 'dml'
connection dml;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -578,7 +546,6 @@ let $wait_condition=
info = "flush tables";
--source include/wait_condition.inc
--send select * from t1
---echo # Switching to connection 'default'
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -587,19 +554,15 @@ let $wait_condition=
--source include/wait_condition.inc
--replace_result $ID2 ID2
eval kill query $ID2;
---echo # Switching to connection 'dml'
connection dml;
--error ER_QUERY_INTERRUPTED
--reap
---echo # Switching to connection 'blocker'
connection blocker;
unlock tables;
---echo # Switching to connection 'ddl'
connection ddl;
--reap
--echo # Cleanup.
---echo # Switching to connection 'default'
connection default;
drop table t1;
drop table t2;
diff --git a/mysql-test/t/kill_processlist-6619.test b/mysql-test/t/kill_processlist-6619.test
index 95af83be56d..df5f410208b 100644
--- a/mysql-test/t/kill_processlist-6619.test
+++ b/mysql-test/t/kill_processlist-6619.test
@@ -4,7 +4,6 @@
--source include/not_embedded.inc
--source include/have_debug_sync.inc
---enable_connect_log
--connect (con1,localhost,root,,)
--let $con_id = `SELECT CONNECTION_ID()`
--replace_column 1 # 3 # 6 # 7 #
diff --git a/mysql-test/t/kill_query-6728.test b/mysql-test/t/kill_query-6728.test
index 485256a65b6..a04c51a88dc 100644
--- a/mysql-test/t/kill_query-6728.test
+++ b/mysql-test/t/kill_query-6728.test
@@ -1,7 +1,6 @@
#
# MDEV-6728 KILL QUERY executed on an idle connection can interrupt the next query
#
---enable_connect_log
--connect (con1,localhost,root,,)
let $id=`select connection_id()`;
diff --git a/mysql-test/t/lock.test b/mysql-test/t/lock.test
index 78f0e2ecf8d..23eb04d7826 100644
--- a/mysql-test/t/lock.test
+++ b/mysql-test/t/lock.test
@@ -333,7 +333,6 @@ connect(con1,localhost,root,,);
set autocommit= 0;
insert into t1 values (1);
lock table t1 write;
---echo # Disconnect
--echo # Ensure that metadata locks will be released if there is an open
--echo # transaction (autocommit=off) in conjunction with lock tables.
disconnect con1;
@@ -349,7 +348,6 @@ create table t1 (a int);
connect(con1,localhost,root,,);
begin;
insert into t1 values (1);
---echo # Disconnect
--echo # Ensure that metadata locks held by the transaction are released.
disconnect con1;
connection default;
@@ -556,12 +554,10 @@ connect (con2, localhost, root);
CREATE TABLE t1 (id INT);
CREATE TABLE t2 (id INT);
---echo # Connection default
connection default;
LOCK TABLE t1 WRITE;
ANALYZE TABLE t1;
---echo # Connection con2
connection con2;
LOCK TABLE t2 WRITE;
--echo # This used to hang until the first connection
@@ -570,7 +566,6 @@ FLUSH TABLE t2;
UNLOCK TABLES;
---echo # Connection default
connection default;
UNLOCK TABLES;
DROP TABLE t1, t2;
diff --git a/mysql-test/t/lock_multi.test b/mysql-test/t/lock_multi.test
index efd0fe5d630..51cc4a50233 100644
--- a/mysql-test/t/lock_multi.test
+++ b/mysql-test/t/lock_multi.test
@@ -371,13 +371,10 @@ create table t1 (a int);
create table t2 like t1;
connection con1;
---echo # con1
lock tables t1 write;
connection con2;
---echo # con2
send flush tables with read lock;
connection con5;
---echo # con5
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock" and
@@ -385,7 +382,6 @@ let $wait_condition=
--source include/wait_condition.inc
--echo # global read lock is taken
connection con3;
---echo # con3
send select * from t2 for update;
connection con5;
let $wait_condition=
@@ -395,7 +391,6 @@ let $wait_condition=
--source include/wait_condition.inc
--echo # waiting for release of read lock
connection con4;
---echo # con4
--echo # would hang and later cause a deadlock
flush tables t2;
connection con1;
@@ -431,13 +426,10 @@ create table t2 like t1;
--echo #
connection default;
---echo # default
flush tables with read lock;
connection con1;
---echo # con1
send update t2 set a = 1;
connection default;
---echo # default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock" and
@@ -445,13 +437,10 @@ let $wait_condition=
--source include/wait_condition.inc
--echo # statement is waiting for release of read lock
connection con2;
---echo # con2
flush table t2;
connection default;
---echo # default
unlock tables;
connection con1;
---echo # con1
--reap
--echo #
@@ -459,13 +448,10 @@ connection con1;
--echo #
connection default;
---echo # default
flush tables with read lock;
connection con1;
---echo # con1
send lock tables t2 write;
connection default;
---echo # default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock" and
@@ -473,13 +459,10 @@ let $wait_condition=
--source include/wait_condition.inc
--echo # statement is waiting for release of read lock
connection con2;
---echo # con2
flush table t2;
connection default;
---echo # default
unlock tables;
connection con1;
---echo # con1
--reap
unlock tables;
@@ -553,13 +536,10 @@ drop table if exists t1;
create table t1 (i int);
connect (flush,localhost,root,,test,,);
connection default;
---echo connection: default
lock tables t1 write;
connection flush;
---echo connection: flush
--send flush tables with read lock;
connection default;
---echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock" and
@@ -568,14 +548,12 @@ let $wait_condition=
alter table t1 add column j int;
connect (insert,localhost,root,,test,,);
connection insert;
---echo connection: insert
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock" and
info = "flush tables with read lock";
--source include/wait_condition.inc
--send insert into t1 values (1,2);
---echo connection: default
connection default;
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -584,7 +562,6 @@ let $wait_condition=
--source include/wait_condition.inc
unlock tables;
connection flush;
---echo connection: flush
--reap
let $wait_condition=
select count(*) = 1 from information_schema.processlist
@@ -615,13 +592,10 @@ drop table if exists t1;
create table t1 (i int);
connect (flush,localhost,root,,test,,);
connection default;
---echo connection: default
lock tables t1 write;
connection flush;
---echo connection: flush
--send flush tables with read lock;
connection default;
---echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock";
@@ -684,13 +658,10 @@ drop table if exists t1;
create table t1 (i int);
connect (flush,localhost,root,,test,,);
connection default;
---echo connection: default
lock tables t1 write;
connection flush;
---echo connection: flush
--send flush tables with read lock;
connection default;
---echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock";
@@ -718,8 +689,6 @@ insert into t1 values (1,1,0),(2,2,0),(3,3,0),(4,4,0),(5,5,0);
begin;
update t1 set c3=c3+1 where c2=3;
---echo #
---echo # Switching to connection 'con46272'.
connect (con46272,localhost,root,,test,,);
connection con46272;
--echo # The below ALTER TABLE statement should wait till transaction
@@ -728,8 +697,6 @@ connection con46272;
--echo # Sending:
--send alter table t1 add column c4 int;
---echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until the above ALTER TABLE gets blocked because this
--echo # connection holds SW metadata lock on table to be altered.
@@ -746,14 +713,10 @@ update t1 set c3=c3+1 where c2=4;
--echo # Unblock ALTER TABLE by committing transaction.
commit;
---echo #
---echo # Switching to connection 'con46272'.
connection con46272;
--echo # Reaping ALTER TABLE.
--reap
---echo #
---echo # Switching to connection 'default'.
connection default;
disconnect con46272;
drop table t1;
@@ -794,14 +757,12 @@ DROP VIEW v1;
CREATE TABLE t1 ( f1 integer );
CREATE VIEW v1 AS SELECT f1 FROM t1 ;
---echo # Connection 2
connect (con2,localhost,root);
LOCK TABLES t1 WRITE, v1 READ;
FLUSH TABLE t1;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection 1
connection default;
LOCK TABLES t1 WRITE;
FLUSH TABLE t1; # Assertion happened here
@@ -826,12 +787,10 @@ create view v1 as select i from t1;
begin;
select * from t1;
---echo # Switching to connection 'con50913'.
connection con50913;
--echo # Sending:
--send alter table t1 add column j int
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE gets blocked.
let $wait_condition=
@@ -847,22 +806,18 @@ delete a from t1 as a where i = 1;
--echo # Unblock ALTER TABLE.
commit;
---echo # Switching to connection 'con50913'.
connection con50913;
--echo # Reaping ALTER TABLE;
--reap
---echo # Switching to connection 'default'.
connection default;
begin;
select * from v1;
---echo # Switching to connection 'con50913'.
connection con50913;
--echo # Sending:
--send alter table t1 drop column j
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE gets blocked.
let $wait_condition=
@@ -878,12 +833,10 @@ insert into v1 values (1);
--echo # Unblock ALTER TABLE.
commit;
---echo # Switching to connection 'con50913'.
connection con50913;
--echo # Reaping ALTER TABLE;
--reap
---echo # Switching to connection 'default'.
connection default;
disconnect con50913;
drop view v1;
@@ -910,17 +863,14 @@ SET SESSION lock_wait_timeout= 1;
--echo # Test 1: acquire exclusive lock
--echo #
---echo # Connection default
connection default;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
---echo # Connection 2
connection con2;
--error ER_LOCK_WAIT_TIMEOUT
DROP TABLE t1;
---echo # Connection default
connection default;
COMMIT;
@@ -928,17 +878,14 @@ COMMIT;
--echo # Test 2: upgrade shared lock
--echo #
---echo # Connection default
connection default;
START TRANSACTION;
SELECT * FROM t1;
---echo # Connection 2
connection con2;
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 RENAME TO t2;
---echo # Connection default
connection default;
COMMIT;
@@ -946,16 +893,13 @@ COMMIT;
--echo # Test 3: acquire shared lock
--echo #
---echo # Connection default
connection default;
LOCK TABLE t1 WRITE;
---echo # Connection 2
connection con2;
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1(id) VALUES (2);
---echo # Connection default
connection default;
UNLOCK TABLES;
@@ -963,16 +907,13 @@ UNLOCK TABLES;
--echo # Test 4: table level locks
--echo #
---echo # Connection default
connection default;
LOCK TABLE t1 READ;
---echo # Connection 2
connection con2;
--error ER_LOCK_WAIT_TIMEOUT
INSERT INTO t1(id) VALUES(4);
---echo # Connection default
connection default;
UNLOCK TABLES;
@@ -982,16 +923,13 @@ UNLOCK TABLES;
connect(con3, localhost, root);
---echo # Connection default
connection default;
LOCK TABLE t1 READ;
---echo # Connection con3
connection con3;
--echo # Sending:
--send FLUSH TABLES
---echo # Connection con2
connection con2;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -1000,11 +938,9 @@ let $wait_condition=
--error ER_LOCK_WAIT_TIMEOUT
SELECT * FROM t1;
---echo # Connection default
connection default;
UNLOCK TABLES;
---echo # Connection con3
connection con3;
--echo # Reaping: FLUSH TABLES
--reap
@@ -1013,17 +949,14 @@ connection con3;
--echo # Test 6: Timeouts in I_S queries
--echo #
---echo # Connection default
connection default;
CREATE TABLE t2 (id INT);
LOCK TABLE t2 WRITE;
---echo # Connection con3
connection con3;
--echo # Sending:
--send DROP TABLE t1, t2
---echo # Connection con2
connection con2;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -1036,16 +969,13 @@ let $wait_condition=
SELECT table_name, table_comment FROM information_schema.tables
WHERE table_schema= 'test' AND table_name= 't1';
---echo # Connection default
connection default;
UNLOCK TABLES;
---echo # Connection con3
connection con3;
--echo # Reaping: DROP TABLE t1, t2
--reap
---echo # Connection default
connection default;
--echo # Cleanup
disconnect con2;
@@ -1064,12 +994,10 @@ connect (con2, localhost, root, , );
connection default;
create table t3 (i int);
---echo # Switching to connection 'con1'
connection con1;
--echo # Lock 't3' so upcoming RENAME is blocked.
lock table t3 read;
---echo # Switching to connection 'con2'
connection con2;
--echo # Remember ID for this connection.
let $ID= `select connection_id()`;
@@ -1078,7 +1006,6 @@ let $ID= `select connection_id()`;
--echo # Sending:
--send rename tables t1 to t2, t2 to t3;
---echo # Switching to connection 'default'
connection default;
--echo # Wait until RENAME TABLE is blocked on table 't3'.
let $wait_condition=
@@ -1090,17 +1017,14 @@ let $wait_condition=
--replace_result $ID ID
eval kill query $ID;
---echo # Switching to connection 'con2'
connection con2;
--echo # RENAME TABLE should be aborted but should not crash.
--error ER_QUERY_INTERRUPTED
--reap
---echo # Switching to connection 'con1'
connection con1;
unlock tables;
---echo # Switching to connection 'default'
connection default;
disconnect con1;
disconnect con2;
@@ -1120,13 +1044,11 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (id INT);
LOCK TABLE t1 WRITE;
---echo # Connection con1
connect (con1, localhost, root);
CREATE TEMPORARY TABLE t1 (id INT);
# This alter should not block and timeout.
ALTER TABLE t1 ADD COLUMN j INT;
---echo # Connection default
connection default;
disconnect con1;
UNLOCK TABLES;
diff --git a/mysql-test/t/lock_sync.test b/mysql-test/t/lock_sync.test
index ef79cc2c0f4..c090e3a1d93 100644
--- a/mysql-test/t/lock_sync.test
+++ b/mysql-test/t/lock_sync.test
@@ -231,7 +231,6 @@ let $con_aux1= con1;
let $con_aux2= con2;
let $table= t1;
---echo # Switch to connection 'con1'.
connection con1;
--echo # Cache all functions used in the tests below so statements
--echo # calling them won't need to open and lock mysql.proc table
@@ -259,7 +258,6 @@ show create function f15;
show create function f16;
show create function f17;
--enable_result_log
---echo # Switch back to connection 'default'.
connection default;
--echo #
@@ -301,13 +299,11 @@ let $restore_table= t2;
--echo # target table and thus does not take any lock on it.
--echo # We check this for completeness of coverage.
lock table t1 write;
---echo # Switching to connection 'con1'.
connection con1;
--echo # This statement should not be blocked.
--disable_result_log
describe t1;
--enable_result_log
---echo # Switching to connection 'default'.
connection default;
unlock tables;
@@ -316,7 +312,6 @@ unlock tables;
--echo #
--echo # The above is true for SHOW statements as well.
lock table t1 write;
---echo # Switching to connection 'con1'.
connection con1;
--echo # These statements should not be blocked.
# The below test for SHOW CREATE TABLE is disabled until bug 52593
@@ -328,7 +323,6 @@ show create table t1;
--disable_result_log
show keys from t1;
--enable_result_log
---echo # Switching to connection 'default'.
connection default;
unlock tables;
@@ -917,12 +911,10 @@ insert into t1 values (1);
--echo # the first statement after it acquires TL_WRITE_ALLOW_WRITE lock.
select get_lock("lock_bug45143_wait", 0);
---echo # Switch to connection 'con_bug45143_1'.
connection con_bug45143_1;
--echo # Sending:
--send insert into t1 values (get_lock("lock_bug45143_wait", 100));
---echo # Switch to connection 'con_bug45143_2'.
connection con_bug45143_2;
--echo # Wait until the above INSERT takes TL_WRITE_ALLOW_WRITE lock on 't1'
--echo # and then gets blocked on user lock 'lock_bug45143_wait'.
@@ -936,7 +928,6 @@ set debug_sync='thr_multi_lock_after_thr_lock SIGNAL parked WAIT_FOR go';
--echo # Sending:
--send select count(*) > 0 from t1 as a, t1 as b for update;
---echo # Switch to connection 'con_bug45143_3'.
connection con_bug45143_3;
--echo # Wait until the above SELECT ... FOR UPDATE is blocked after
--echo # acquiring lock for the the first instance of 't1'.
@@ -944,7 +935,6 @@ set debug_sync= 'now WAIT_FOR parked';
--echo # Send LOCK TABLE statement which will try to get TL_WRITE lock on 't1':
--send lock table v1 write;
---echo # Switch to connection 'default'.
connection default;
--echo # Wait until this LOCK TABLES statement starts waiting for table lock.
let $wait_condition= select count(*)= 1 from information_schema.processlist
@@ -958,17 +948,14 @@ let $wait_condition= select count(*)= 1 from information_schema.processlist
--echo # on this table and also there is a thread waiting for a TL_WRITE on it.
set debug_sync= 'now SIGNAL go';
---echo # Switch to connection 'con_bug45143_2'.
connection con_bug45143_2;
--echo # Reap SELECT ... FOR UPDATE
--reap
---echo # Switch to connection 'default'.
connection default;
--echo # Resume execution of the INSERT statement.
select release_lock("lock_bug45143_wait");
---echo # Switch to connection 'con_bug45143_1'.
connection con_bug45143_1;
--echo # Reap INSERT statement.
--echo # In Statement and Mixed replication mode we get here "Unsafe
@@ -979,13 +966,11 @@ connection con_bug45143_1;
--enable_warnings
---echo # Switch to connection 'con_bug45143_3'.
connection con_bug45143_3;
--echo # Reap LOCK TABLES statement.
--reap
unlock tables;
---echo # Switch to connection 'default'.
connection default;
--echo # Do clean-up.
disconnect con_bug45143_1;
@@ -1008,17 +993,14 @@ DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1(id INT);
CREATE TABLE t2(id INT);
---echo # Connection con2
connect (con2, localhost, root);
START TRANSACTION;
SELECT * FROM t1;
---echo # Connection default
connection default;
--echo # Sending:
--send ALTER TABLE t1 ADD COLUMN j INT
---echo # Connection con2
connection con2;
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -1031,7 +1013,6 @@ INSERT INTO t2 SELECT * FROM t1;
COMMIT;
---echo # Connection default
connection default;
--echo # Reaping ALTER TABLE t1 ADD COLUMN j INT
--reap
@@ -1047,27 +1028,23 @@ disconnect con2;
CREATE EVENT e1 ON SCHEDULE EVERY 5 HOUR DO SELECT 1;
CREATE EVENT e2 ON SCHEDULE EVERY 5 HOUR DO SELECT 2;
---echo # Connection con1
connect(con1, localhost, root);
SET DEBUG_SYNC="before_lock_tables_takes_lock SIGNAL drop WAIT_FOR query";
--echo # Sending:
--send DROP EVENT e1;
---echo # Connection default
connection default;
SET DEBUG_SYNC="now WAIT_FOR drop";
SELECT name FROM mysql.event, INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE definer = VARIABLE_VALUE;
SET DEBUG_SYNC="now SIGNAL query";
---echo # Connection con1
connection con1;
--echo # Reaping: DROP EVENT t1
--reap
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
DROP EVENT e2;
SET DEBUG_SYNC="RESET";
@@ -1088,26 +1065,22 @@ INSERT INTO t1 VALUES (1), (2);
connect (con1, localhost, root);
connect (con2, localhost, root);
---echo # Connection con1
connection con1;
SET SESSION lock_wait_timeout= 1;
SET DEBUG_SYNC= 'ha_admin_open_ltable SIGNAL opti_recreate WAIT_FOR opti_analyze';
--echo # Sending:
--send OPTIMIZE TABLE t1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR opti_recreate';
SET DEBUG_SYNC= 'after_lock_tables_takes_lock SIGNAL thrlock WAIT_FOR release_thrlock';
--echo # Sending:
--send INSERT INTO t1 VALUES (3)
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR thrlock';
SET DEBUG_SYNC= 'now SIGNAL opti_analyze';
---echo # Connection con1
connection con1;
--echo # Reaping: OPTIMIZE TABLE t1
--reap
@@ -1115,14 +1088,12 @@ SET DEBUG_SYNC= 'now SIGNAL release_thrlock';
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection con2
connection con2;
--echo # Reaping: INSERT INTO t1 VALUES (3)
--reap
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
DROP TABLE t1;
SET DEBUG_SYNC= 'RESET';
@@ -1144,7 +1115,6 @@ CREATE VIEW v1 AS SELECT * FROM t1 WHERE f1() = 1;
DROP FUNCTION f1;
connect(con2, localhost, root);
---echo # Connection con1
connect (con1, localhost, root);
# Need to trigger this sync point at least twice in order to
# get valgrind test failures without the patch
@@ -1152,7 +1122,6 @@ SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR
--echo # Sending:
--send SHOW CREATE VIEW v1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
SET DEBUG_SYNC= 'now SIGNAL dropped';
@@ -1160,7 +1129,6 @@ SET DEBUG_SYNC= 'now WAIT_FOR opened';
--echo # Sending:
--send FLUSH TABLES
---echo # Connection default
connection default;
--echo # Waiting for FLUSH TABLES to be blocked.
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
@@ -1168,17 +1136,14 @@ let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL dropped';
---echo # Connection con1
connection con1;
--echo # Reaping: SHOW CREATE VIEW v1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: FLUSH TABLES
--reap
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'RESET';
DROP VIEW v1;
diff --git a/mysql-test/t/log_state.test b/mysql-test/t/log_state.test
index 12c7a7fd92b..68e06dfa042 100644
--- a/mysql-test/t/log_state.test
+++ b/mysql-test/t/log_state.test
@@ -33,9 +33,7 @@ flush logs;
show global variables
where Variable_name = 'general_log' or Variable_name = 'slow_query_log';
---echo # Establish connection con1 (user=root)
connect (con1,localhost,root,,);
---echo # Switch to connection con1
connection con1;
# Please increase @long_query_time if the corresponding selects show an
# additional unexpected entry like
@@ -48,12 +46,10 @@ set session long_query_time = @long_query_time;
select sleep(@long_query_time + 1);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME 12 THREAD_ID
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
---echo # Switch to connection default
connection default;
set global slow_query_log= ON;
set local slow_query_log= ON;
---echo # Switch to connection con1
connection con1;
set session long_query_time = @long_query_time;
select sleep(@long_query_time + 1);
@@ -64,7 +60,6 @@ select sleep(@long_query_time + 2);
--replace_column 1 TIMESTAMP 2 USER_HOST 3 QUERY_TIME 12 THREAD_ID
select * from mysql.slow_log where sql_text NOT LIKE '%slow_log%';
---echo # Switch to connection default
connection default;
show global variables
where Variable_name = 'general_log' or Variable_name = 'slow_query_log';
@@ -328,7 +323,6 @@ SET GLOBAL general_log_file = @old_general_log_file;
# Cleanup
#
# Disconnect must be done last to avoid delayed 'Quit' message in general log
---echo # Close connection con1
disconnect con1;
# set back the saved default values
connection default;
diff --git a/mysql-test/t/mdl_sync.test b/mysql-test/t/mdl_sync.test
index 8e809788a08..0b6d6f58013 100644
--- a/mysql-test/t/mdl_sync.test
+++ b/mysql-test/t/mdl_sync.test
@@ -101,7 +101,6 @@ create table t1 (c1 int);
--echo #
handler t1 open;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that S, SH, SR and SW locks are compatible with it.
handler t1 open t;
@@ -128,7 +127,6 @@ unlock tables;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME is blocked because of S lock.
let $wait_condition=
@@ -137,29 +135,24 @@ let $wait_condition=
info = "rename table t1 to t2";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Unblock RENAME TABLE.
handler t1 close;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE.
--reap
--echo # Restore the original state of the things.
rename table t2 to t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
handler t1 open;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that upgrade from SNW to X is blocked by presence of S lock.
--echo # Sending:
--send alter table t1 add column c2 int;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER TABLE is blocked because of S lock.
let $wait_condition=
@@ -168,30 +161,25 @@ let $wait_condition=
info = "alter table t1 add column c2 int";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Unblock ALTER TABLE.
handler t1 close;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--reap
--echo # Restore the original state of the things.
alter table t1 drop column c2;
--echo #
---echo # Switching to connection 'default'.
connection default;
handler t1 open;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that upgrade from SNRW to X is blocked by presence of S lock.
lock table t1 write;
--echo # Sending:
--send alter table t1 add column c2 int;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above upgrade of SNRW to X in ALTER TABLE is blocked
--echo # because of S lock.
@@ -201,12 +189,10 @@ let $wait_condition=
info = "alter table t1 add column c2 int";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Unblock ALTER TABLE.
handler t1 close;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--reap
@@ -214,7 +200,6 @@ connection mdl_con1;
alter table t1 drop column c2;
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # 2) Acquire SH (shared high-priority) lock on the table.
@@ -225,7 +210,6 @@ set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that S, SH, SR and SW locks are compatible with it.
@@ -253,7 +237,6 @@ unlock tables;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME is blocked because of SH lock.
let $wait_condition=
@@ -264,32 +247,27 @@ let $wait_condition=
--echo # Unblock RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SELECT ... FROM I_S.
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE.
--reap
--echo # Restore the original state of the things.
rename table t2 to t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that upgrade from SNW to X is blocked by presence of SH lock.
--echo # Sending:
--send alter table t1 add column c2 int;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER TABLE is blocked because of SH lock.
let $wait_condition=
@@ -300,24 +278,20 @@ let $wait_condition=
--echo # Unblock RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SELECT ... FROM I_S.
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--reap
--echo # Restore the original state of the things.
alter table t1 drop column c2;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
--send select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t1';
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that upgrade from SNRW to X is blocked by presence of S lock.
@@ -325,7 +299,6 @@ lock table t1 write;
--echo # Sending:
--send alter table t1 add column c2 int;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above upgrade of SNRW to X in ALTER TABLE is blocked
--echo # because of S lock.
@@ -337,12 +310,10 @@ let $wait_condition=
--echo # Unblock RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SELECT ... FROM I_S.
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--reap
@@ -350,7 +321,6 @@ connection mdl_con1;
alter table t1 drop column c2;
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo #
@@ -360,7 +330,6 @@ connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that S, SH, SR and SW locks are compatible with it.
handler t1 open;
@@ -383,7 +352,6 @@ alter table t1 add primary key (c1);
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above LOCK TABLES is blocked because of SR lock.
let $wait_condition=
@@ -394,25 +362,21 @@ let $wait_condition=
--echo # Unblock LOCK TABLES.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLES.
--reap
delete from t1 limit 1;
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that X lock is incompatible with SR lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME is blocked because of SR lock.
let $wait_condition=
@@ -421,30 +385,25 @@ let $wait_condition=
info = "rename table t1 to t2";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE.
--reap
--echo # Restore the original state of the things.
rename table t2 to t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that upgrade from SNW to X is blocked by presence of SR lock.
--echo # Sending:
--send alter table t1 add column c2 int;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER TABLE is blocked because of SR lock.
let $wait_condition=
@@ -453,12 +412,10 @@ let $wait_condition=
info = "alter table t1 add column c2 int";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--reap
@@ -469,7 +426,6 @@ alter table t1 drop column c2;
--echo # by presence of SR lock because SNRW is incompatible with SR anyway.
--echo #
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo #
@@ -479,7 +435,6 @@ connection default;
begin;
insert into t1 values (1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that S, SH, SR and SW locks are compatible with it.
handler t1 open;
@@ -503,7 +458,6 @@ alter table t1 add index (not_exist);
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above ALTER TABLE is blocked because of SW lock.
let $wait_condition=
@@ -514,24 +468,20 @@ let $wait_condition=
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
begin;
insert into t1 values (1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that SNRW lock is not compatible with SW lock.
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above LOCK TABLES is blocked because of SW lock.
let $wait_condition=
@@ -542,25 +492,21 @@ let $wait_condition=
--echo # Unblock LOCK TABLES.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLES.
--reap
delete from t1 limit 2;
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
begin;
insert into t1 values (1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that X lock is incompatible with SW lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME is blocked because of SW lock.
let $wait_condition=
@@ -569,12 +515,10 @@ let $wait_condition=
info = "rename table t1 to t2";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE.
--reap
@@ -586,7 +530,6 @@ rename table t2 to t1;
--echo # with SW anyway.
--echo #
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo #
@@ -597,7 +540,6 @@ set debug_sync= 'alter_opened_table SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that S, SH, SR and SW locks are compatible with it.
@@ -611,7 +553,6 @@ delete from t1 limit 1;
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER is blocked because of SU lock.
let $wait_condition=
@@ -622,32 +563,27 @@ let $wait_condition=
--echo # Unblock ALTERs.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping first ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping another ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'alter_opened_table SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that SNRW lock is incompatible with SU lock.
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above LOCK TABLES is blocked because of SU lock.
let $wait_condition=
@@ -658,33 +594,28 @@ let $wait_condition=
--echo # Unblock ALTER and thus LOCK TABLES.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLES
--reap
insert into t1 values (1);
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'alter_opened_table SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that X lock is incompatible with SU lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME is blocked because of SU lock.
let $wait_condition=
@@ -695,7 +626,6 @@ let $wait_condition=
--echo # Unblock ALTER and thus RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Now we have ALTER TABLE with SU->SNW and RENAME TABLE with pending
--echo # X-lock. In this case ALTER TABLE should be chosen as victim.
@@ -703,7 +633,6 @@ connection default;
--error ER_LOCK_DEADLOCK
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE
--reap
@@ -714,7 +643,6 @@ rename table t2 to t1;
--echo # blocked by presence of another SU lock because SNW/SNRW is
--echo # incompatible with SU anyway.
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo #
@@ -725,7 +653,6 @@ set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR fini
--echo # Sending:
--send alter table t1 add primary key (c1), lock=shared, algorithm=copy;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that S, SH and SR locks are compatible with it.
@@ -738,7 +665,6 @@ select count(*) from t1;
--echo # Sending:
--send delete from t1 limit 2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above DELETE is blocked because of SNW lock.
let $wait_condition=
@@ -749,31 +675,26 @@ let $wait_condition=
--echo # Unblock ALTER and thus DELETE.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping DELETE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1), lock=shared, algorithm=copy;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that SU lock is incompatible with SNW lock.
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER is blocked because of SNW lock.
let $wait_condition=
@@ -784,13 +705,11 @@ let $wait_condition=
--echo # Unblock ALTERs.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping first ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping another ALTER TABLE.
--error ER_DUP_ENTRY
@@ -800,20 +719,17 @@ connection mdl_con1;
--echo # SNW is only used by ALTER TABLE after upgrading from SU
--echo # and SU is also incompatible with SNW.
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1), lock=shared, algorithm=copy;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that SNRW lock is incompatible with SNW lock.
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above LOCK TABLES is blocked because of SNW lock.
let $wait_condition=
@@ -824,33 +740,28 @@ let $wait_condition=
--echo # Unblock ALTER and thus LOCK TABLES.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLES
--reap
insert into t1 values (1);
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1), algorithm=copy, lock=shared;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
set debug_sync= 'now WAIT_FOR locked';
--echo # Check that X lock is incompatible with SNW lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME is blocked because of SNW lock.
let $wait_condition=
@@ -861,13 +772,11 @@ let $wait_condition=
--echo # Unblock ALTER and thus RENAME TABLE.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE
--reap
@@ -878,7 +787,6 @@ rename table t2 to t1;
--echo # blocked by presence of another SNW lock because SNW/SNRW is
--echo # incompatible with SNW anyway.
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo #
@@ -887,7 +795,6 @@ connection default;
--echo #
lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that S and SH locks are compatible with it.
handler t1 open;
@@ -898,7 +805,6 @@ select column_name from information_schema.columns where
--echo # Sending:
--send select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above SELECT is blocked because of SNRW lock.
let $wait_condition=
@@ -909,22 +815,18 @@ let $wait_condition=
--echo # Unblock SELECT.
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping SELECT.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that SW lock is incompatible with SNRW lock.
--echo # Sending:
--send delete from t1 limit 1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above DELETE is blocked because of SNRW lock.
let $wait_condition=
@@ -935,22 +837,18 @@ let $wait_condition=
--echo # Unblock DELETE.
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping DELETE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that SU lock is incompatible with SNRW lock.
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above ALTER is blocked because of SNRW lock.
let $wait_condition=
@@ -961,7 +859,6 @@ let $wait_condition=
--echo # Unblock ALTER.
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
@@ -971,17 +868,14 @@ connection mdl_con1;
--echo # SNW is only used by ALTER TABLE after upgrading from SU
--echo # and SU is also incompatible with SNRW.
--echo #
---echo # Switching to connection 'default'.
connection default;
lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that SNRW lock is incompatible with SNRW lock.
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above LOCK TABLES is blocked because of SNRW lock.
let $wait_condition=
@@ -992,24 +886,20 @@ let $wait_condition=
--echo # Unblock waiting LOCK TABLES.
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLES
--reap
insert into t1 values (1);
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that X lock is incompatible with SNRW lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Check that the above RENAME is blocked because of SNRW lock.
let $wait_condition=
@@ -1020,7 +910,6 @@ let $wait_condition=
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME TABLE
--reap
@@ -1031,7 +920,6 @@ rename table t2 to t1;
--echo # blocked by presence of another SNRW lock because SNW/SNRW is
--echo # incompatible with SNRW anyway.
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo #
@@ -1040,18 +928,15 @@ connection default;
--echo #
create table t2 (c1 int);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Take a lock on t2, so RENAME TABLE t1 TO t2 will get blocked
--echo # after acquiring X lock on t1.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1063,7 +948,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send handler t1 open;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above HANDLER statement is blocked because of X lock.
let $wait_condition=
@@ -1074,29 +958,24 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping HANDLER.
--reap
handler t1 close;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Prepare for blocking RENAME TABLE.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1108,7 +987,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send select column_name from information_schema.columns where table_schema='test' and table_name='t1';
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above SELECT ... FROM I_S ... statement is blocked
--echo # because of X lock.
@@ -1120,28 +998,23 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping SELECT ... FROM I_S.
--reap
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Prepare for blocking RENAME TABLE.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1153,7 +1026,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above SELECT statement is blocked
--echo # because of X lock.
@@ -1165,28 +1037,23 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping SELECT.
--reap
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Prepare for blocking RENAME TABLE.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1198,7 +1065,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send delete from t1 limit 1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above DELETE statement is blocked
--echo # because of X lock.
@@ -1210,28 +1076,23 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping DELETE.
--reap
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Prepare for blocking RENAME TABLE.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1243,7 +1104,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER statement is blocked
--echo # because of X lock.
@@ -1255,13 +1115,11 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER.
--error ER_DUP_ENTRY
@@ -1271,17 +1129,14 @@ connection mdl_con1;
--echo # SNW is only used by ALTER TABLE after upgrading from SU
--echo # and SU is also incompatible with X.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Prepare for blocking RENAME TABLE.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1293,7 +1148,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above LOCK TABLE statement is blocked
--echo # because of X lock.
@@ -1305,29 +1159,24 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLE.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Prepare for blocking RENAME TABLE.
lock tables t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME has acquired X lock on t1 and is waiting for t2.
let $wait_condition=
@@ -1339,7 +1188,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send rename table t1 to t3;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above RENAME statement is blocked
--echo # because of X lock.
@@ -1351,13 +1199,11 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping RENAME.
--reap
@@ -1373,7 +1219,6 @@ rename table t3 to t1;
--echo #
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo #
--echo # 1) Check compatibility for pending SNW lock.
@@ -1382,13 +1227,11 @@ connection mdl_con2;
begin;
insert into t1 values (1);
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending SNW lock.
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that ALTER TABLE is waiting with pending SNW lock.
let $wait_condition=
@@ -1406,7 +1249,6 @@ select count(*) from t1;
--echo # Sending:
--send delete from t1 limit 1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above DELETE is blocked because of pending SNW lock.
let $wait_condition=
@@ -1417,13 +1259,11 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping DELETE.
--reap
@@ -1432,7 +1272,6 @@ connection mdl_con1;
--echo # they will also be blocked by active SW lock.
--echo #
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo #
--echo # 2) Check compatibility for pending SNRW lock.
@@ -1441,13 +1280,11 @@ connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending SNRW lock.
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that LOCK TABLE is waiting with pending SNRW lock.
let $wait_condition=
@@ -1464,7 +1301,6 @@ select column_name from information_schema.columns where
--echo # Sending:
--send select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above SELECT is blocked because of pending SNRW lock.
let $wait_condition=
@@ -1475,29 +1311,24 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock LOCK TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping LOCK TABLE.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping SELECT.
--reap
--echo # Restore pending SNRW lock.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that LOCK TABLE is waiting with pending SNRW lock.
let $wait_condition=
@@ -1509,7 +1340,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send insert into t1 values (1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above INSERT is blocked because of pending SNRW lock.
let $wait_condition=
@@ -1520,29 +1350,24 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock LOCK TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping LOCK TABLE.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping INSERT.
--reap
--echo # Restore pending SNRW lock.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that LOCK TABLE is waiting with pending SNRW lock.
let $wait_condition=
@@ -1555,12 +1380,10 @@ where state = "Waiting for table metadata lock" and
--error ER_DUP_ENTRY
alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Unblock LOCK TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping LOCK TABLE.
--reap
@@ -1570,7 +1393,6 @@ unlock tables;
--echo # they will also be blocked by active SR lock.
--echo #
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo #
--echo # 3) Check compatibility for pending X lock.
@@ -1579,13 +1401,11 @@ connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending X lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME TABLE is waiting with pending X lock.
let $wait_condition=
@@ -1600,7 +1420,6 @@ select column_name from information_schema.columns where
--echo # Sending:
--send handler t1 open;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above HANDLER OPEN is blocked because of pending X lock.
let $wait_condition=
@@ -1611,31 +1430,26 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping HANDLER t1 OPEN.
--reap
handler t1 close;
--echo # Restore pending X lock.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending X lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME TABLE is waiting with pending X lock.
let $wait_condition=
@@ -1647,7 +1461,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above SELECT is blocked because of pending X lock.
let $wait_condition=
@@ -1658,30 +1471,25 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping SELECT.
--reap
--echo # Restore pending X lock.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending X lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME TABLE is waiting with pending X lock.
let $wait_condition=
@@ -1693,7 +1501,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send delete from t1 limit 1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above DELETE is blocked because of pending X lock.
let $wait_condition=
@@ -1704,30 +1511,25 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping DELETE.
--reap
--echo # Restore pending X lock.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending X lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME TABLE is waiting with pending X lock.
let $wait_condition=
@@ -1739,7 +1541,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above ALTER TABLE is blocked because of pending X lock.
let $wait_condition=
@@ -1750,30 +1551,25 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo # Restore pending X lock.
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
handler t1 open;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Add pending X lock.
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that RENAME TABLE is waiting with pending X lock.
let $wait_condition=
@@ -1785,7 +1581,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'mdl_con3'.
connection mdl_con3;
--echo # Check that the above LOCK TABLES is blocked because of pending X lock.
let $wait_condition=
@@ -1794,24 +1589,20 @@ where state = "Waiting for table metadata lock" and
info = "lock table t1 write";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Unblock RENAME TABLE.
handler t1 close;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reaping LOCK TABLES.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
@@ -1833,7 +1624,6 @@ connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create an active SNW lock on t2.
--echo # We have to use DEBUG_SYNC facility as otherwise SNW lock
@@ -1843,7 +1633,6 @@ set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR fini
--echo # Sending:
--send alter table t2 add primary key (c1), algorithm=copy, lock=shared;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'now WAIT_FOR locked';
--echo # SR lock should be acquired without any waiting.
@@ -1855,7 +1644,6 @@ select count(*) from t1;
--echo # Sending:
--send insert into t2 values (1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above INSERT is blocked.
let $wait_condition=
@@ -1866,13 +1654,11 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock ALTER TABLE and thus INSERT.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
--reap
@@ -1887,14 +1673,12 @@ commit;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create an active SNW lock on t1.
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL locked WAIT_FOR finish';
--echo # Sending:
--send alter table t1 add primary key (c1), algorithm=copy, lock=shared;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'now WAIT_FOR locked';
--echo # We should still be able to get SR lock without waiting.
@@ -1905,7 +1689,6 @@ select count(*) from t1;
--echo # Sending:
--send insert into t1 values (1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above INSERT is blocked.
let $wait_condition=
@@ -1916,13 +1699,11 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock ALTER TABLE and thus INSERT.
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
--reap
@@ -1935,13 +1716,11 @@ commit;
begin;
insert into t1 values (1);
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create pending SNW lock on t1.
--echo # Sending:
--send alter table t1 add primary key (c1);
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE starts waiting for SNW lock.
let $wait_condition=
@@ -1955,13 +1734,11 @@ delete from t1 limit 1;
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap ALTER TABLE.
--error ER_DUP_ENTRY
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # 2) Now similar tests for active SNW lock which is being upgraded
@@ -1972,20 +1749,17 @@ connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Start transaction which will prevent SNW -> X upgrade from
--echo # completing immediately.
begin;
select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create SNW lock pending upgrade to X on t2.
--echo # Sending:
--send alter table t2 add column c2 int;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE starts waiting X lock.
let $wait_condition=
@@ -1997,7 +1771,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above SELECT is blocked.
let $wait_condition=
@@ -2008,12 +1781,10 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap ALTER TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap SELECT.
--reap
@@ -2022,20 +1793,17 @@ commit;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Start transaction which will prevent SNW -> X upgrade from
--echo # completing immediately.
begin;
select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create SNW lock pending upgrade to X on t2.
--echo # Sending:
--send alter table t2 drop column c2;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE starts waiting X lock.
let $wait_condition=
@@ -2047,7 +1815,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send insert into t2 values (1);
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above INSERT is blocked.
let $wait_condition=
@@ -2058,12 +1825,10 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap ALTER TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
--reap
@@ -2075,13 +1840,11 @@ commit;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create SNW lock pending upgrade to X.
--echo # Sending:
--send alter table t1 add column c2 int;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE starts waiting X lock.
let $wait_condition=
@@ -2098,12 +1861,10 @@ delete from t1 limit 1;
--echo # Unblock ALTER TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap ALTER TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # 3) Check how various locks used within transactional context
@@ -2114,18 +1875,15 @@ connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
lock table t2 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Attempt to acquire SR should be blocked. It should
--echo # not cause errors as it does not creates deadlock.
--echo # Sending:
--send select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that the above SELECT is blocked
let $wait_condition=
@@ -2136,7 +1894,6 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock SELECT.
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap SELECT.
--reap
@@ -2145,18 +1902,15 @@ commit;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
lock table t2 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Again attempt to acquire SW should be blocked and should
--echo # not cause any errors.
--echo # Sending:
--send delete from t2 limit 1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Check that the above DELETE is blocked
let $wait_condition=
@@ -2167,7 +1921,6 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock DELETE.
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap DELETE.
--reap
@@ -2182,12 +1935,10 @@ commit;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until LOCK TABLE is blocked creating pending request for X lock.
let $wait_condition=
@@ -2204,13 +1955,11 @@ delete from t1 limit 1;
--echo # Unblock LOCK TABLES.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap LOCK TABLES.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # **) Now case when transaction has a SW lock.
@@ -2218,12 +1967,10 @@ connection default;
begin;
delete from t1 limit 1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Sending:
--send lock table t1 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until LOCK TABLE is blocked creating pending request for X lock.
let $wait_condition=
@@ -2238,13 +1985,11 @@ insert into t1 values (1, 1);
--echo # Unblock LOCK TABLES.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap LOCK TABLES.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # 4) Check how various locks used within transactional context
@@ -2255,20 +2000,17 @@ connection default;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Start transaction which will prevent X lock from going away
--echo # immediately.
begin;
select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create pending X lock on t2.
--echo # Sending:
--send rename table t2 to t3;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until RENAME TABLE starts waiting with pending X lock.
let $wait_condition=
@@ -2280,7 +2022,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above SELECT is blocked.
let $wait_condition=
@@ -2291,12 +2032,10 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap RENAME TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap SELECT.
--error ER_NO_SUCH_TABLE
@@ -2307,20 +2046,17 @@ rename table t3 to t2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Start transaction which will prevent X lock from going away
--echo # immediately.
begin;
select count(*) from t2;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Create pending X lock on t2.
--echo # Sending:
--send rename table t2 to t3;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until RENAME TABLE starts waiting with pending X lock.
let $wait_condition=
@@ -2332,7 +2068,6 @@ where state = "Waiting for table metadata lock" and
--echo # Sending:
--send delete from t2 limit 1;
--echo #
---echo # Switching to connection 'mdl_con2'.
connection mdl_con2;
--echo # Check that the above DELETE is blocked.
let $wait_condition=
@@ -2343,12 +2078,10 @@ where state = "Waiting for table metadata lock" and
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap RENAME TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap DELETE.
--error ER_NO_SUCH_TABLE
@@ -2365,12 +2098,10 @@ rename table t3 to t2;
begin;
select count(*) from t1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until RENAME TABLE is blocked creating pending request for X lock.
let $wait_condition=
@@ -2387,13 +2118,11 @@ delete from t1 limit 1;
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # **) The second case is when transaction has a SW lock.
@@ -2401,12 +2130,10 @@ connection default;
begin;
delete from t1 limit 1;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Sending:
--send rename table t1 to t2;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until RENAME TABLE is blocked creating pending request for X lock.
let $wait_condition=
@@ -2421,13 +2148,11 @@ insert into t1 values (1, 1);
--echo # Unblock RENAME TABLE.
commit;
--echo #
---echo # Switching to connection 'mdl_con1'.
connection mdl_con1;
--echo # Reap RENAME TABLE.
--error ER_TABLE_EXISTS_ERROR
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Clean-up.
@@ -2460,14 +2185,12 @@ insert into t1 values (1);
--echo #
handler t1 open;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
lock table t1 write;
--echo # Upgrade SNRW to X lock.
--echo # Sending:
--send alter table t1 add column j int;
--echo #
---echo # Switching to connection 'handler_con2'.
connection handler_con2;
--echo # Wait until ALTER is blocked during upgrade.
let $wait_condition=
@@ -2476,18 +2199,15 @@ let $wait_condition=
info = "alter table t1 add column j int";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # The below statement should not cause deadlock.
--send handler t1 read first;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Reap ALTER TABLE.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap HANDLER READ.
--reap
@@ -2500,18 +2220,15 @@ handler t1 close;
--echo #
handler t1 open;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
lock table t1 write, t2 read;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Execute statement which will be blocked on table-level lock
--echo # owned by connection 'handler_con1'.
--echo # Sending:
--send insert into t2 values (1);
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Wait until INSERT is blocked on table-level lock.
let $wait_condition=
@@ -2522,7 +2239,6 @@ let $wait_condition=
--echo # Sending 'alter table t1 drop column j'. It should not cause
--echo # deadlock.
send alter table t1 drop column j;
---echo # Switching to connection 'handler_con2'.
connection handler_con2;
--echo # Wait until ALTER is blocked during upgrade.
let $wait_condition=
@@ -2531,19 +2247,16 @@ let $wait_condition=
info = "alter table t1 drop column j";
--source include/wait_condition.inc
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
--error ER_LOCK_ABORTED
--reap
handler t1 close;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Reaping 'alter table t1 drop column j'
--reap
unlock tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Then, check the scenario in which upgrade of SNRW lock to X
@@ -2552,17 +2265,14 @@ connection default;
--echo #
handler t1 open;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
lock table t1 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # The below insert should be blocked because active SNRW lock on 't1'.
--echo # Sending:
--send insert into t1 values (1);
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Wait until INSERT is blocked because of SNRW lock.
let $wait_condition=
@@ -2574,7 +2284,6 @@ let $wait_condition=
--echo # Sending:
--send alter table t1 add column j int;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # INSERT should be chosen as victim for resolving deadlock.
--echo # Reaping INSERT.
@@ -2583,13 +2292,11 @@ connection default;
--echo # Close HANDLER to unblock ALTER TABLE.
handler t1 close;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Reaping ALTER TABLE.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
@@ -2599,17 +2306,14 @@ connection default;
--echo #
handler t1 open;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
lock table t1 write, t2 write;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # The below insert should be blocked because active SNRW lock on 't1'.
--echo # Sending:
--send insert into t2 values (1);
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Wait until INSERT is blocked because of SNRW lock.
let $wait_condition=
@@ -2621,7 +2325,6 @@ let $wait_condition=
--echo # Sending:
--send alter table t1 drop column j;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # INSERT should be chosen as victim for resolving deadlock.
--echo # Reaping INSERT.
@@ -2630,13 +2333,11 @@ connection default;
--echo # Close HANDLER to unblock ALTER TABLE.
handler t1 close;
--echo #
---echo # Switching to connection 'handler_con1'.
connection handler_con1;
--echo # Reaping ALTER TABLE.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Clean-up.
@@ -2668,25 +2369,21 @@ create table t4 (k int);
--echo #
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
begin;
insert into t1 values (1);
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
begin;
insert into t2 values (1);
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Send:
--send rename table t2 to t0, t3 to t2, t0 to t3;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait until the above RENAME TABLE is blocked because it has to wait
--echo # for 'deadlock_con2' which holds shared metadata lock on 't2'.
@@ -2702,7 +2399,6 @@ let $wait_condition=
--send select * from t2;
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait until the above SELECT * FROM t2 is starts waiting
--echo # for an exclusive metadata lock to go away.
@@ -2716,19 +2412,16 @@ let $wait_condition=
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap RENAME TABLE.
--reap
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Reap SELECT.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo #
--echo # Let us check that in the process of waiting for conflicting lock
@@ -2738,7 +2431,6 @@ connection default;
--send rename table t1 to t0, t3 to t1, t0 to t3;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait until the above RENAME TABLE is blocked because it has to wait
--echo # for 'deadlock_con1' which should still hold shared metadata lock on
@@ -2752,7 +2444,6 @@ let $wait_condition=
commit;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap RENAME TABLE.
--reap
@@ -2762,19 +2453,16 @@ connection default;
--echo #
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
begin;
insert into t2 values (2);
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Send:
--send rename table t2 to t0, t1 to t2, t0 to t1;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait until the above RENAME TABLE is blocked because it has to wait
--echo # for 'deadlock_con1' which holds shared metadata lock on 't2'.
@@ -2791,7 +2479,6 @@ let $wait_condition=
select * from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap RENAME TABLE.
--reap
@@ -2801,18 +2488,15 @@ connection default;
--echo #
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
begin;
insert into t2 values (1);
--echo #
---echo # Switching to connection 'default'.
connection default;
lock table t1 write;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # The below SELECT statement should wait for metadata lock
--echo # on table 't1' and should not produce ER_LOCK_DEADLOCK
@@ -2820,7 +2504,6 @@ connection deadlock_con1;
--send select * from t1;
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait until the above SELECT * FROM t1 is starts waiting
--echo # for an UNRW metadata lock to go away.
@@ -2834,7 +2517,6 @@ let $wait_condition=
--send rename table t1 to t0, t2 to t1, t0 to t2;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait till above RENAME TABLE is blocked while holding
--echo # pending X lock on t1.
@@ -2848,7 +2530,6 @@ let $wait_condition=
unlock tables;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Since the latest RENAME TABLE entered in deadlock with SELECT
--echo # statement the latter should be aborted and emit ER_LOCK_DEADLOCK
@@ -2858,13 +2539,11 @@ connection deadlock_con1;
--reap
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Reap RENAME TABLE ... .
--reap;
--echo #
---echo # Switching to connection 'default'.
connection default;
drop tables t1, t2, t3, t4;
@@ -2881,19 +2560,16 @@ insert into t1 values (1);
select * from t1;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
begin;
select * from t1;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Send:
--send alter table t1 add column j int, rename to t2;
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait until the above ALTER TABLE ... RENAME acquires exclusive
--echo # metadata lock on 't2' and starts waiting for connection
@@ -2911,7 +2587,6 @@ let $wait_condition=
select * from t2;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap ALTER TABLE ... RENAME.
--reap
@@ -2935,7 +2610,6 @@ set debug_sync= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
--send select * from t2, t1
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait till SELECT acquires MDL on 't2' and starts waiting for signal.
set debug_sync= 'now WAIT_FOR locked';
@@ -2943,7 +2617,6 @@ set debug_sync= 'now WAIT_FOR locked';
--send lock tables t1 write, t2 write
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait until LOCK TABLES acquires SNRW lock on 't1' and is blocked
--echo # while trying to acquire SNRW lock on 't1'.
@@ -2956,14 +2629,12 @@ let $wait_condition=
set debug_sync= 'now SIGNAL finish';
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Reaping LOCK TABLES.
--reap
unlock tables;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SELECT. It succeed and not report ER_LOCK_DEADLOCK error.
--reap
@@ -2983,7 +2654,6 @@ set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL parked1 WAIT_FOR go1'
--send alter table t1 add column j int
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait till ALTER acquires SNW lock and stops.
set debug_sync='now WAIT_FOR parked1';
@@ -2995,7 +2665,6 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL parked2 WAIT_FOR go2';
--send insert into t1 values ()
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait till INSERT is paused.
set debug_sync='now WAIT_FOR parked2';
@@ -3005,7 +2674,6 @@ set debug_sync='now WAIT_FOR parked2';
set debug_sync='now SIGNAL go1';
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER TABLE.
--reap
@@ -3014,7 +2682,6 @@ connection default;
--send alter table t1 drop column j
--echo #
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait until ALTER is blocked.
let $wait_condition=
@@ -3035,13 +2702,11 @@ let $wait_condition=
set debug_sync='now SIGNAL go2';
--echo #
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Reaping INSERT.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping ALTER. It should succeed and not produce ER_LOCK_DEADLOCK.
--reap
@@ -3063,7 +2728,6 @@ create table t2(j int);
--echo #
set debug_sync= 'RESET';
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Start a statement, which will acquire SR metadata lock on t1, open it
--echo # and then stop, before trying to acquire SW lock on t2 and opening it.
@@ -3071,7 +2735,6 @@ set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR
--echo # Sending:
--send select * from t1 where i in (select j from t2 for update)
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait till the above SELECT stops.
set debug_sync='now WAIT_FOR parked';
@@ -3080,7 +2743,6 @@ set debug_sync='now WAIT_FOR parked';
--echo # Sending:
send flush tables t1, t2 with read lock;
---echo # Switching to connection 'deadlock_con3'.
connection deadlock_con3;
--echo # Wait until FLUSH TABLES WITH t1, t2 READ LOCK starts waiting
--echo # for SELECT to close t1.
@@ -3095,13 +2757,11 @@ let $wait_condition=
--echo # by backing-off SELECT. As a result FTWRL should be able to finish.
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Reap FLUSH TABLES WITH READ LOCK.
reap;
unlock tables;
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Reap SELECT.
reap;
@@ -3113,7 +2773,6 @@ reap;
--echo #
set debug_sync= 'RESET';
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
set debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked WAIT_FOR go';
@@ -3122,7 +2781,6 @@ set debug_sync='flush_tables_with_read_lock_after_acquire_locks SIGNAL parked WA
--echo # Sending:
send flush tables t1, t2 with read lock;
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Wait till FLUSH TABLE WITH READ LOCK stops.
set debug_sync='now WAIT_FOR parked';
@@ -3132,7 +2790,6 @@ set debug_sync='now WAIT_FOR parked';
--echo # Sending:
send select * from t1 where i in (select j from t2 for update);
---echo # Switching to connection 'deadlock_con3'.
connection deadlock_con3;
--echo # Wait till the above SELECT blocks.
let $wait_condition=
@@ -3146,13 +2803,11 @@ let $wait_condition=
--echo # backing-off SELECT. As a result FTWRL should be able to finish.
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Reap FLUSH TABLES WITH READ LOCK.
reap;
unlock tables;
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Reap SELECT.
reap;
@@ -3163,7 +2818,6 @@ reap;
--echo #
set debug_sync= 'RESET';
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Start a statement which will acquire SR metadata lock on t2, open it
--echo # and then stop, before trying to acquire SR on t1 and opening it.
@@ -3171,7 +2825,6 @@ set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR
--echo # Sending:
send select * from t2, t1;
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Wait till the above SELECT stops.
set debug_sync='now WAIT_FOR parked';
@@ -3180,7 +2833,6 @@ set debug_sync='now WAIT_FOR parked';
--echo # Sending:
send flush tables t2 with read lock;
---echo # Switching to connection 'deadlock_con3'.
connection deadlock_con3;
--echo # Wait until FLUSH TABLES WITH READ LOCK starts waiting
--echo # for SELECT to close t2.
@@ -3195,7 +2847,6 @@ let $wait_condition=
--echo # Sending:
send drop tables t1, t2;
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until DROP TABLES starts waiting for X lock on t2.
let $wait_condition=
@@ -3209,25 +2860,21 @@ let $wait_condition=
--echo # by backing-off SELECT. As a result, FTWRL should be able to finish.
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'deadlock_con2'.
connection deadlock_con2;
--echo # Reap FLUSH TABLES WITH READ LOCK.
reap;
--echo # Unblock DROP TABLES.
unlock tables;
---echo # Switching to connection 'deadlock_con3'.
connection deadlock_con3;
--echo # Reap DROP TABLES.
reap;
---echo # Switching to connection 'deadlock_con1'.
connection deadlock_con1;
--echo # Reap SELECT. It should emit error about missing table.
--error ER_NO_SUCH_TABLE
reap;
---echo # Switching to connection 'default'.
connection default;
set debug_sync= 'RESET';
@@ -3251,7 +2898,6 @@ set debug_sync= 'RESET';
create table t1(i int);
create table t2(j int);
---echo # Switching to connection 'con2'.
connection con2;
set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR go';
@@ -3261,7 +2907,6 @@ set debug_sync='open_tables_after_open_and_process_table SIGNAL parked WAIT_FOR
--echo # Sending:
send flush tables t1, t2 with read lock;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Wait till FLUSH TABLES <list> WITH READ LOCK stops.
set debug_sync='now WAIT_FOR parked';
@@ -3271,7 +2916,6 @@ set debug_sync='now WAIT_FOR parked';
--echo # Sending:
send flush tables;
---echo # Switching to connection 'default'.
connection default;
--echo # Wait till the above FLUSH TABLES blocks.
let $wait_condition=
@@ -3286,19 +2930,16 @@ let $wait_condition=
--echo # which would result in assertion failures.
set debug_sync='now SIGNAL go';
---echo # Switching to connection 'con2'.
connection con2;
--echo # Reap FLUSH TABLES <list> WITH READ LOCK.
reap;
unlock tables;
---echo # Switching to connection 'con1'.
connection con1;
--echo # Reap FLUSH TABLES.
reap;
--echo # Clean-up.
---echo # Switching to connection 'default'.
connection default;
drop tables t1, t2;
set debug_sync= 'RESET';
@@ -3328,16 +2969,13 @@ create trigger t1_bi before insert on t1 for each row
create trigger t2_bi before insert on t2 for each row
insert into t3 values (new.j);
--echo #
---echo # Switching to connection 'con1root'.
connection con1root;
lock tables t4 read;
--echo #
---echo # Switching to connection 'con2root'.
connection con2root;
--echo # Send :
--send rename table t3 to t5, t4 to t3;
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until the above RENAME TABLE adds pending requests for exclusive
--echo # metadata lock on its tables and blocks due to 't4' being used by LOCK
@@ -3349,7 +2987,6 @@ let $wait_condition= select count(*)= 1 from information_schema.processlist
--echo # Send :
--send insert into t1 values (1);
--echo #
---echo # Switching to connection 'con1root'.
connection con1root;
--echo # Wait until INSERT statement waits due to encountering pending
--echo # exclusive metadata lock on 't3'.
@@ -3359,12 +2996,10 @@ let $wait_condition= select count(*)= 1 from information_schema.processlist
--source include/wait_condition.inc
unlock tables;
--echo #
---echo # Switching to connection 'con2root'.
connection con2root;
--echo # Reap RENAME TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
--echo # Reap INSERT.
--reap
@@ -3390,14 +3025,12 @@ connect(con2, localhost, root,,);
--echo # Test 1: CREATE TABLE
--echo #
---echo # Connection 2
connection con2;
--echo # Start insert on the not-yet existing table
--echo # Wait after taking the MDL lock
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
--send INSERT INTO t1 VALUES(1,"def")
---echo # Connection 1
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Now INSERT has a MDL on the non-existent table t1.
@@ -3408,13 +3041,11 @@ SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL finish';
--echo # Try to create that table.
--send CREATE TABLE t1 (c1 INT, c2 VARCHAR(100), KEY(c1))
---echo # Connection 2
--echo # Insert fails
connection con2;
--error ER_NO_SUCH_TABLE
--reap
---echo # Connection 1
connection default;
--reap;
SET DEBUG_SYNC= 'RESET';
@@ -3430,14 +3061,12 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t2 (c1 INT, c2 VARCHAR(100), KEY(c1));
---echo # Connection 2
connection con2;
--echo # Start insert on the not-yet existing table
--echo # Wait after taking the MDL
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked WAIT_FOR finish';
--send INSERT INTO t1 VALUES(1,"def")
---echo # Connection 1
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Now INSERT has a MDL on the non-existent table t1.
@@ -3448,13 +3077,11 @@ SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL finish';
--echo # Try to create that table.
--send CREATE TABLE t1 LIKE t2
---echo # Connection 2
--echo # Insert fails
connection con2;
--error ER_NO_SUCH_TABLE
--reap
---echo # Connection 1
connection default;
--reap
SET DEBUG_SYNC= 'RESET';
@@ -3488,12 +3115,10 @@ insert into t1 values(1);
--echo # which owner is in its turn waiting for our connection.
lock tables t1 read;
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
--echo # Sending:
--send update t1 set i = 2
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Waiting until UPDATE t1 SET ... is blocked.
@@ -3506,7 +3131,6 @@ let $wait_condition=
--echo # Sending:
--send create table t2 select * from t1;
---echo # Switching to connection 'default'.
connection default;
--echo # Waiting until CREATE TABLE ... SELECT ... is blocked.
let $wait_condition=
@@ -3533,11 +3157,9 @@ select column_name from information_schema.columns
select table_name, table_type, auto_increment, table_comment
from information_schema.tables where table_schema='test' and table_name='t2';
---echo # Switching to connection 'default'.
connection default;
unlock tables;
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Reaping CREATE TABLE ... SELECT ... .
--reap
@@ -3555,16 +3177,13 @@ connection con46044_2;
--echo #
--echo # We check same three queries to I_S in this new situation.
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
lock tables t1 read;
---echo # Switching to connection 'con46044_3'.
connection con46044_3;
--echo # Sending:
send update t1 set i = 3;
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Waiting until UPDATE t1 SET ... is blocked.
@@ -3577,7 +3196,6 @@ let $wait_condition=
--echo # Sending:
--send create table t2 select * from t1;
---echo # Switching to connection 'default'.
connection default;
--echo # Waiting until CREATE TABLE ... SELECT ... is blocked.
let $wait_condition=
@@ -3590,7 +3208,6 @@ let $wait_condition=
--echo # Sending:
--send show fields from t2;
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
--echo # Wait until SHOW FIELDS gets blocked.
let $wait_condition=
@@ -3601,12 +3218,10 @@ let $wait_condition=
unlock tables;
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Reaping CREATE TABLE ... SELECT ... .
--reap
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SHOW FIELDS ...
--reap
@@ -3616,16 +3231,13 @@ connection con46044_3;
--echo # Reaping UPDATE t1 statement
--reap
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
lock tables t1 read;
---echo # Switching to connection 'con46044_3'.
connection con46044_3;
--echo # Sending:
--send update t1 set i = 4
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Waiting until UPDATE t1 SET ... is blocked.
@@ -3638,7 +3250,6 @@ let $wait_condition=
--echo # Sending:
--send create table t2 select * from t1;
---echo # Switching to connection 'default'.
connection default;
--echo # Waiting until CREATE TABLE ... SELECT ... is blocked.
let $wait_condition=
@@ -3651,7 +3262,6 @@ let $wait_condition=
--echo # Sending:
--send select column_name from information_schema.columns where table_schema='test' and table_name='t2';
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
--echo # Wait until SELECT COLUMN_NAME FROM I_S.COLUMNS gets blocked.
let $wait_condition=
@@ -3662,12 +3272,10 @@ let $wait_condition=
unlock tables;
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Reaping CREATE TABLE ... SELECT ... .
--reap
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SELECT COLUMN_NAME FROM I_S.COLUMNS
--reap
@@ -3677,16 +3285,13 @@ connection con46044_3;
--echo # Reaping UPDATE t1 statement
--reap
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
lock tables t1 read;
---echo # Switching to connection 'con46044_3'.
connection con46044_3;
--echo # Sending:
--send update t1 set i = 5
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Waiting until UPDATE t1 SET ... is blocked.
@@ -3699,7 +3304,6 @@ let $wait_condition=
--echo # Sending:
--send create table t2 select * from t1;
---echo # Switching to connection 'default'.
connection default;
--echo # Waiting until CREATE TABLE ... SELECT ... is blocked.
let $wait_condition=
@@ -3713,7 +3317,6 @@ let $wait_condition=
--echo # Sending:
--send select table_name, table_type, auto_increment, table_comment from information_schema.tables where table_schema='test' and table_name='t2';
---echo # Switching to connection 'con46044_2'.
connection con46044_2;
--echo # Wait until SELECT ... FROM I_S.TABLES gets blocked.
let $wait_condition=
@@ -3724,12 +3327,10 @@ let $wait_condition=
unlock tables;
---echo # Switching to connection 'con46044'.
connection con46044;
--echo # Reaping CREATE TABLE ... SELECT ... .
--reap
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping SELECT ... FROM I_S.TABLES
--reap
@@ -3739,7 +3340,6 @@ connection con46044_3;
--echo # Reaping UPDATE t1 statement
--reap
---echo # Switching to connection 'default'.
connection default;
--echo # Clean-up.
disconnect con46044;
@@ -3765,13 +3365,11 @@ begin;
select * from t1 where c2 = 3;
--echo #
---echo # Switching to connection 'con46273'.
connection con46273;
set debug_sync='alter_table_copy_after_lock_upgrade SIGNAL alter_table_locked WAIT_FOR alter_go';
--send alter table t1 add column e int, rename to t2;
--echo #
---echo # Switching to connection 'default'.
connection default;
set debug_sync='now WAIT_FOR alter_table_locked';
set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go';
@@ -3782,13 +3380,11 @@ set debug_sync='mdl_acquire_lock_wait SIGNAL alter_go';
update t1 set c3=c3+1 where c2 = 3;
--echo #
---echo # Switching to connection 'con46273'.
connection con46273;
--echo # Reap ALTER TABLE.
--reap
--echo #
---echo # Switching to connection 'default'.
connection default;
disconnect con46273;
--echo # Clean-up.
@@ -3807,12 +3403,10 @@ connect (con46673, localhost, root,,);
connection default;
create table t1 (i int);
---echo # Switching to connection 'con46673'.
connection con46673;
begin;
insert into t1 values (1);
---echo # Switching to connection 'default'.
connection default;
--echo # Statement below should not get blocked. And if after some
--echo # changes to code it is there should not be a deadlock between
@@ -3820,12 +3414,10 @@ connection default;
flush tables with read lock;
unlock tables;
---echo # Switching to connection 'con46673'.
connection con46673;
delete from t1 where i = 1;
commit;
---echo # Switching to connection 'default'.
connection default;
--echo # Clean-up
disconnect con46673;
@@ -3841,13 +3433,11 @@ connect (con2, localhost, root);
--echo # Test 1: CREATE PROCEDURE
---echo # Connection 1
connection default;
--echo # Start CREATE PROCEDURE and open mysql.proc
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait';
--send CREATE PROCEDURE p1() SELECT 1
---echo # Connection 2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
--echo # Check that FLUSH must wait to get the GRL
@@ -3855,16 +3445,13 @@ SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
--send FLUSH TABLES WITH READ LOCK
---echo # Connection 1
connection default;
--reap
---echo # Connection 2
connection con2;
--reap
UNLOCK TABLES;
---echo # Connection 1
connection default;
SET DEBUG_SYNC= 'RESET';
@@ -3875,7 +3462,6 @@ connection default;
SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL table_opened WAIT_FOR grlwait';
--send DROP PROCEDURE p1
---echo # Connection 2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
--echo # Check that FLUSH must wait to get the GRL
@@ -3883,7 +3469,6 @@ SET DEBUG_SYNC= 'now WAIT_FOR table_opened';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL grlwait';
--send FLUSH TABLES WITH READ LOCK
---echo # Connection 1
connection default;
--echo # Once FLUSH TABLES WITH READ LOCK starts waiting
--echo # DROP PROCEDURE will be waked up and will drop
@@ -3893,13 +3478,11 @@ connection default;
--echo # Reaping DROP PROCEDURE.
--reap
---echo # Connection 2
connection con2;
--echo # Reaping FTWRL.
--reap
UNLOCK TABLES;
---echo # Connection 1
connection default;
SET DEBUG_SYNC= 'RESET';
@@ -4015,13 +3598,11 @@ connect (con50913_2,localhost,root);
connection default;
create table t1 (i int) engine=InnoDB;
---echo # Switching to connection 'con50913_1'.
connection con50913_1;
set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL parked WAIT_FOR go';
--echo # Sending:
--send alter table t1 add column j int, ALGORITHM=COPY
---echo # Switching to connection 'default'.
connection default;
--echo # Wait until ALTER TABLE gets blocked on a sync point after
--echo # acquiring thr_lock.c lock.
@@ -4031,7 +3612,6 @@ set debug_sync= 'now WAIT_FOR parked';
--echo # Sending:
--send truncate table t1
---echo # Switching to connection 'con50913_2'.
connection con50913_2;
--echo # Wait until TRUNCATE TABLE is blocked on MDL lock.
let $wait_condition=
@@ -4042,12 +3622,10 @@ let $wait_condition=
--echo # Unblock ALTER TABLE.
set debug_sync= 'now SIGNAL go';
---echo # Switching to connection 'con50913_1'.
connection con50913_1;
--echo # Reaping ALTER TABLE.
--reap
---echo # Switching to connection 'default'.
connection default;
--echo # Reaping TRUNCATE TABLE.
--reap
@@ -4074,17 +3652,14 @@ connect (con3,localhost,root);
connection default;
create table t1 (i int);
---echo # Switching to connection 'con1'.
connection con1;
begin;
select * from t1;
---echo # Switching to connection 'con2'.
connection con2;
begin;
select * from t1;
---echo # Switching to connection 'default'.
connection default;
--echo # Start ALTER TABLE which will acquire SNW lock and
--echo # table lock and get blocked on sync point.
@@ -4092,19 +3667,16 @@ set debug_sync= 'alter_table_copy_after_lock_upgrade SIGNAL parked WAIT_FOR go';
--echo # Sending:
--send alter table t1 add column j int
---echo # Switching to connection 'con1'.
connection con1;
--echo # Wait until ALTER TABLE gets blocked on a sync point.
set debug_sync= 'now WAIT_FOR parked';
--echo # Sending:
--send insert into t1 values (1)
---echo # Switching to connection 'con2'.
connection con2;
--echo # Sending:
--send insert into t1 values (1)
---echo # Switching to connection 'con3'.
connection con3;
--echo # Wait until both 'con1' and 'con2' are blocked trying to acquire
--echo # SW lock on the table.
@@ -4119,7 +3691,6 @@ let $wait_condition=
--echo # should be aborted with ER_LOCK_DEADLOCK errors.
set debug_sync= 'now SIGNAL go';
---echo # Switching to connection 'con1'.
connection con1;
--echo # Reaping INSERT. It should end with ER_LOCK_DEADLOCK error and
--echo # not wait indefinitely (as it happened before the bugfix).
@@ -4127,14 +3698,12 @@ connection con1;
--reap
commit;
---echo # Switching to connection 'con2'.
connection con2;
--echo # Reaping INSERT.
--error ER_LOCK_DEADLOCK
--reap
commit;
---echo # Switching to connection 'default'.
connection default;
--echo # Reap ALTER TABLE.
--reap
@@ -4165,32 +3734,26 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1),(2),(3);
---echo # Connection: con1
connection con1;
LOCK TABLES t1 WRITE;
SET debug_sync='upgrade_lock_for_truncate SIGNAL parked_truncate WAIT_FOR go_truncate';
send TRUNCATE TABLE t1;
connection default;
---echo # Connection: default
SET debug_sync='now WAIT_FOR parked_truncate';
connection con2;
---echo # Connection: con2
SET debug_sync='after_open_table_ignore_flush SIGNAL parked_show WAIT_FOR go_show';
send SHOW FIELDS FROM t1;
connection default;
---echo # Connection: default
SET debug_sync='now WAIT_FOR parked_show';
connection con3;
---echo # Connection: con3
SET debug_sync='after_flush_unlock SIGNAL parked_flush WAIT_FOR go_flush';
send FLUSH TABLES t1;
connection default;
---echo # Connection: default
SET debug_sync='now WAIT_FOR parked_flush';
SET debug_sync='now SIGNAL go_truncate';
--echo # Ensure that truncate waits for a exclusive lock
@@ -4200,22 +3763,18 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
SET debug_sync= 'now SIGNAL go_show';
connection con1;
---echo # Connection: con1 (TRUNCATE)
--echo # Reaping...
reap;
UNLOCK TABLES;
connection con2;
---echo # Connection: con2 (SHOW FIELDS FROM t1)
--echo # Reaping...
reap;
connection default;
---echo # Connection: default
SET debug_sync= 'now SIGNAL go_flush';
connection con3;
---echo # Connection: con3 (FLUSH TABLES t1)
--echo # Reaping...
reap;
@@ -4224,7 +3783,6 @@ disconnect con2;
disconnect con3;
connection default;
---echo # Connection: default
SET debug_sync= 'RESET';
DROP TABLE t1;
@@ -4268,20 +3826,17 @@ connect (con3, localhost, root);
--echo # not database DDL on different databases. Tests X vs X lock.
--echo #
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send CREATE DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send CREATE DATABASE db1
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND info='CREATE DATABASE db1';
@@ -4292,12 +3847,10 @@ ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: CREATE DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: CREATE DATABASE db1
--error ER_DB_CREATE_EXISTS
@@ -4308,20 +3861,17 @@ connection con2;
--echo # not database DDL on different databases. Tests X vs X lock.
--echo #
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock'
@@ -4333,42 +3883,35 @@ ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
--reap
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should also block.
--send DROP DATABASE db1
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND info='DROP DATABASE db1';
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: DROP DATABASE db1
--reap
@@ -4387,20 +3930,17 @@ let $MYSQLD_DATADIR= `select @@datadir`;
--mkdir $MYSQLD_DATADIR/a-b-c-d
--copy_file $MYSQLD_DATADIR/db1/db.opt $MYSQLD_DATADIR/a-b-c-d/db.opt
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send ALTER DATABASE `#mysql50#a-b-c` UPGRADE DATA DIRECTORY NAME
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock'
@@ -4410,12 +3950,10 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
ALTER DATABASE `#mysql50#a-b-c-d` UPGRADE DATA DIRECTORY NAME;
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: ALTER DATABASE '#mysql50#a-b-c' UPGRADE DATA DIRECTORY NAME
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: ALTER DATABASE '#mysql50#a-b-c' UPGRADE DATA DIRECTORY NAME
--error ER_BAD_DB_ERROR
@@ -4428,20 +3966,17 @@ DROP DATABASE `a-b-c-d`;
--echo # not database DDL on different databases. Tests X vs X lock.
--echo #
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send DROP DATABASE db1
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND info='DROP DATABASE db1';
@@ -4452,32 +3987,27 @@ ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: DROP DATABASE db1
--error ER_DB_DROP_EXISTS
--reap
---echo # Connection default
connection default;
CREATE DATABASE db1;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should also block.
--send ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock'
@@ -4485,12 +4015,10 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
# Error 1 is from ALTER DATABASE when the database does not exist.
@@ -4504,21 +4032,18 @@ connection con2;
--echo # Tests X vs IX lock.
--echo #
---echo # Connection default
connection default;
CREATE DATABASE db1;
SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send CREATE TABLE db1.t1 (a INT)
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND
@@ -4526,12 +4051,10 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: CREATE TABLE db1.t1 (a INT)
--error ER_BAD_DB_ERROR
@@ -4542,7 +4065,6 @@ connection con2;
--echo # Tests X vs IX lock.
--echo #
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
@@ -4550,14 +4072,12 @@ SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send RENAME TABLE db1.t1 TO test.t1
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND
@@ -4565,18 +4085,15 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: RENAME TABLE db1.t1 TO test.t1
--error ER_NO_SUCH_TABLE
--reap
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE TABLE test.t2 (a INT);
@@ -4584,14 +4101,12 @@ SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send RENAME TABLE test.t2 TO db1.t2
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND
@@ -4599,12 +4114,10 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: RENAME TABLE test.t2 TO db1.t2
# Error 7 is from RENAME TABLE where the target database does not exist.
@@ -4619,7 +4132,6 @@ DROP TABLE test.t2;
--echo # Tests X vs IX lock.
--echo #
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
@@ -4627,32 +4139,27 @@ SET DEBUG_SYNC= 'after_wait_locked_schema_name SIGNAL locked WAIT_FOR blocked';
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--echo # Sending:
# This should block.
--send DROP TABLE db1.t1
---echo # Connection con3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' AND info='DROP TABLE db1.t1';
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL blocked';
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: DROP TABLE db1.t1
--error ER_BAD_TABLE_ERROR
--reap
---echo # Connection default
connection default;
disconnect con2;
disconnect con3;
@@ -4671,16 +4178,13 @@ CREATE TABLE db1.t1(a INT);
connect(con2, localhost, root);
connect(con3, localhost, root);
---echo # Connection default
connection default;
FLUSH TABLE WITH READ LOCK;
---echo # Connection con2
connection con2;
# IX global lock should block
--send CREATE TABLE db1.t2(a INT)
---echo # Connection default
connection default;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for global read lock'
@@ -4688,21 +4192,17 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
UNLOCK TABLES;
---echo # Connection con2
connection con2;
--echo # Reaping CREATE TABLE db1.t2(a INT)
--reap
---echo # Connection default
connection default;
FLUSH TABLE WITH READ LOCK;
---echo # Connection con2
connection con2;
# X global lock should block
--send ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
---echo # Connection default
connection default;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for global read lock'
@@ -4710,22 +4210,18 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
UNLOCK TABLES;
---echo # Connection con2
connection con2;
--echo # Reaping ALTER DATABASE db1 DEFAULT CHARACTER SET utf8
--reap
---echo # Connection default
connection default;
FLUSH TABLE WITH READ LOCK;
---echo # Connection con2
connection con2;
# S global lock should not block
FLUSH TABLE WITH READ LOCK;
UNLOCK TABLES;
---echo # Connection default
connection default;
UNLOCK TABLES;
DROP DATABASE db1;
@@ -4752,7 +4248,6 @@ connect(con1, localhost, root);
connect(con2, localhost, root);
connect(con3, localhost, root);
---echo # Connection con1
connection con1;
--echo # We need EXECUTE 2 since ALTER TABLE does SU => SNW => X and we want
--echo # to stop at the second upgrade.
@@ -4760,7 +4255,6 @@ SET DEBUG_SYNC= 'mdl_upgrade_lock SIGNAL upgrade WAIT_FOR continue EXECUTE 2';
--echo # Sending:
--send ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
---echo # Connection con2
connection con2;
--echo # Waiting for ALTER TABLE to try lock upgrade
SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
@@ -4769,7 +4263,6 @@ SET DEBUG_SYNC= 'now WAIT_FOR upgrade';
--echo # Sending:
--send DELETE FROM t2 WHERE a = 3
---echo # Connection default
connection con3;
--echo # Check that DELETE is waiting on a metadata lock and not a table lock.
let $wait_condition=
@@ -4786,18 +4279,15 @@ connection default;
--echo # Resuming ALTER TABLE
SET DEBUG_SYNC= 'now SIGNAL continue';
---echo # Connection con1
connection con1;
--echo # Reaping: ALTER TABLE m1 engine=MERGE UNION=(t2, t1)
--reap
---echo # Connection con2
connection con2;
--echo # Reaping: DELETE FROM t2 WHERE a = 3
--reap
connection con3;
--echo # Reaping: SELECT * FROM m1 WHERE a < 3
--reap
---echo # Connection default
connection default;
DROP TABLE m1, t1, t2;
SET DEBUG_SYNC= 'RESET';
diff --git a/mysql-test/t/merge-big.test b/mysql-test/t/merge-big.test
index 78c3e8c00ac..9bd2cab2c8a 100644
--- a/mysql-test/t/merge-big.test
+++ b/mysql-test/t/merge-big.test
@@ -40,13 +40,11 @@ drop table if exists t1,t2,t3,t4,t5,t6;
CREATE TABLE t1 (c1 INT) ENGINE= MyISAM;
LOCK TABLE t1 WRITE;
#SELECT NOW();
- --echo # connection con1
connect (con1,localhost,root,,);
let $con1_id= `SELECT CONNECTION_ID()`;
SET @orig_debug=@@debug;
SET GLOBAL debug_dbug="+d,sleep_open_and_lock_after_open";
send INSERT INTO t1 VALUES (1);
---echo # connection default
connection default;
--echo # Let INSERT go into thr_multi_lock().
#--sleep 8
@@ -72,12 +70,9 @@ FLUSH TABLES;
SELECT * FROM t1;
#SELECT NOW();
UNLOCK TABLES;
- --echo # connection con1
connection con1;
reap;
SET GLOBAL debug_dbug=@orig_debug;
disconnect con1;
---echo # connection default
connection default;
DROP TABLE t1;
-
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test
index 519094d6350..faa420fd275 100644
--- a/mysql-test/t/merge.test
+++ b/mysql-test/t/merge.test
@@ -2585,7 +2585,6 @@ DROP TABLE t1, t2, t3, t4, m1, m2;
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t3;
--enable_warnings
---echo # Connection con1.
connect (con1,localhost,root,,);
CREATE TABLE t1 (c1 int);
CREATE TABLE t2 (c1 int);
@@ -2594,12 +2593,10 @@ START TRANSACTION;
--error ER_ILLEGAL_HA
HANDLER t3 OPEN;
DROP TABLE t1, t2, t3;
---echo # Connection default.
connection default;
---echo # Disconnecting con1, all mdl_tickets must have been released.
+--echo # all mdl_tickets must have been released.
disconnect con1;
--echo # The bug-specific case.
---echo # Connection con1.
connect (con1,localhost,root,,);
CREATE TABLE t1 (c1 int);
CREATE TABLE t2 (c1 int);
@@ -2609,9 +2606,8 @@ START TRANSACTION;
--error ER_WRONG_MRG_TABLE
HANDLER t3 OPEN;
DROP TABLE t1, t3;
---echo # Connection default.
connection default;
---echo # Disconnecting con1, all mdl_tickets must have been released.
+--echo # all mdl_tickets must have been released.
disconnect con1;
--echo #
diff --git a/mysql-test/t/myisam_debug.test b/mysql-test/t/myisam_debug.test
index 5b5d006bd22..b106ecdea5e 100644
--- a/mysql-test/t/myisam_debug.test
+++ b/mysql-test/t/myisam_debug.test
@@ -34,13 +34,11 @@ while ($i)
commit;
--enable_query_log
---echo # Switch to insert Connection
CONNECTION insertConn;
SET SESSION debug_dbug='+d,wait_in_enable_indexes';
--echo # Send insert data
SEND INSERT INTO t1(id) SELECT id FROM t2;
---echo # Switch to default Connection
CONNECTION default;
--echo # Wait for insert data to reach the debug point
diff --git a/mysql-test/t/myisam_recover.test b/mysql-test/t/myisam_recover.test
index 49fe9c33460..0c686e59fb1 100644
--- a/mysql-test/t/myisam_recover.test
+++ b/mysql-test/t/myisam_recover.test
@@ -12,9 +12,6 @@
--echo # For that, we set the table cache to minimal size and populate it
--echo # in a concurrent connection.
connect(con1,localhost,root,,test,,);
---echo #
---echo # Switching to connection con1
---echo #
connection con1;
--echo #
--echo # Minimal values.
@@ -56,9 +53,6 @@ drop procedure p_create;
let $lock=`select @lock_table_stmt`;
eval $lock;
--enable_query_log
---echo #
---echo # Switching to connection 'default'
---echo #
connection default;
--echo #
--echo # We have to disable the ps-protocol, to avoid
@@ -102,9 +96,6 @@ select * from t1_mrg;
--echo # Cleanup
--echo #
drop table t1, t1_mrg;
---echo #
---echo # Switching to connection con1
---echo #
connection con1;
unlock tables;
prepare stmt from @drop_table_stmt;
diff --git a/mysql-test/t/mysqlbinlog_row_big.test b/mysql-test/t/mysqlbinlog_row_big.test
index ffd1b79af34..44bceaad66b 100644
--- a/mysql-test/t/mysqlbinlog_row_big.test
+++ b/mysql-test/t/mysqlbinlog_row_big.test
@@ -52,11 +52,8 @@ SET @@global.max_allowed_packet= 1024*1024*1024;
--echo to be seen and used, we must start a new connection.
--echo The change does not take effect with the current one.
--echo For simplicity, we just disconnect / reconnect connection default here.
---echo Disconnecting default connection...
disconnect default;
---echo Reconnecting default connection...
connect (default, localhost,root,,);
---echo default connection established, continuing with the test
--echo #
--echo # Delete all existing binary logs.
diff --git a/mysql-test/t/mysqldump-max.test b/mysql-test/t/mysqldump-max.test
index 3f73f046959..f5f4dbcd088 100644
--- a/mysql-test/t/mysqldump-max.test
+++ b/mysql-test/t/mysqldump-max.test
@@ -1133,7 +1133,6 @@ connect(c2,127.0.0.1,root,,test,$MASTER_MYPORT,);
connect(c3,127.0.0.1,root,,test,$MASTER_MYPORT,);
connection default;
---echo # Connection default
SET binlog_format= mixed;
RESET MASTER;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
@@ -1143,23 +1142,19 @@ INSERT INTO t2 VALUES (1,0), (2,0);
SELECT GET_LOCK("block_queries_1", 120);
connection c3;
---echo # Connection c3
SELECT GET_LOCK("block_queries_2", 120);
# Start two queries that will be running on the tables during mysqldump
connection c1;
---echo # Connection c1
SET @c= 0;
send SELECT IF(@c<1, @c:=@c+1, GET_LOCK("block_queries_1", 120)) FROM t1 ORDER BY a;
connection c2;
---echo # Connection c2
SET binlog_format="row";
SET @d= 10;
send UPDATE t2 SET b=IF(@d<=10, @d:=@d+1, GET_LOCK("block_queries_2", 120)) ORDER BY a;
connection default;
---echo # Connection default
--echo # Make sure other queries are running (and waiting).
let $wait_condition=
SELECT COUNT(*) FROM information_schema.processlist
@@ -1175,19 +1170,15 @@ let $wait_condition=
SELECT RELEASE_LOCK("block_queries_1");
connection c3;
---echo # Connection c3
SELECT RELEASE_LOCK("block_queries_2");
connection c1;
---echo # Connection c1
reap;
connection c2;
---echo # Connection c2
reap;
connection default;
---echo # Connection default
SELECT * FROM t2 ORDER BY a;
DROP TABLE t1;
DROP TABLE t2;
diff --git a/mysql-test/t/mysqltest.test b/mysql-test/t/mysqltest.test
index ae59c713c3d..a797dff572e 100644
--- a/mysql-test/t/mysqltest.test
+++ b/mysql-test/t/mysqltest.test
@@ -427,7 +427,6 @@ select 7;
--error 1
--exec echo "--disable_info OCNE" | $MYSQL_TEST 2>&1
---enable_connect_log ONCE
connect (con1,localhost,root,,);
connection default;
disconnect con1;
@@ -1789,12 +1788,14 @@ eval select "$long_rep" as x;
# Repeat connect/disconnect
--write_file $MYSQLTEST_VARDIR/tmp/mysqltest.sql
let $i=200;
+disable_connect_log;
while ($i)
{
connect (test_con1,localhost,root,,);
disconnect test_con1;
dec $i;
}
+enable_connect_log;
echo 200 connects succeeded;
EOF
--exec echo "source $MYSQLTEST_VARDIR/tmp/mysqltest.sql;" | $MYSQL_TEST 2>&1
@@ -1838,7 +1839,6 @@ disconnect con2;
connection default;
# Test enable_connect_log
---enable_connect_log
connect (con1,localhost,root,,);
connection default;
connection con1;
@@ -1851,7 +1851,6 @@ connection con1;
--enable_query_log
disconnect con1;
connection default;
---disable_connect_log
# ----------------------------------------------------------------------------
# Test mysqltest arguments
diff --git a/mysql-test/t/not_embedded_server.test b/mysql-test/t/not_embedded_server.test
index f22bf8cd7b5..b2cbdba6850 100644
--- a/mysql-test/t/not_embedded_server.test
+++ b/mysql-test/t/not_embedded_server.test
@@ -46,7 +46,6 @@ DROP TABLE t1;
CREATE USER nopriv_user@localhost;
connection default;
---echo connection: default
--disable_warnings
DROP TABLE IF EXISTS t1,t2,t3;
@@ -65,7 +64,6 @@ FLUSH PRIVILEGES;
connect (con1,localhost,nopriv_user,,);
connection con1;
---echo connection: con1
let outfile=$MYSQLTEST_VARDIR/tmp/mytest;
--error 0,1
@@ -93,7 +91,6 @@ disconnect con1;
--source include/wait_until_disconnected.inc
connection default;
---echo connection: default
DROP TABLE t1,t2;
DROP FUNCTION f;
diff --git a/mysql-test/t/partition_debug_sync.test b/mysql-test/t/partition_debug_sync.test
index 90f1d4173ff..11af9b06cdd 100644
--- a/mysql-test/t/partition_debug_sync.test
+++ b/mysql-test/t/partition_debug_sync.test
@@ -22,7 +22,6 @@ SET DEBUG_SYNC= 'RESET';
--echo # only until ALTER tries to upgrade its MDL lock, which ends up in MDL
--echo # deadlock which is correctly reported.
connect(con1, localhost, root,,);
---echo # Con 1
SET DEBUG_SYNC= 'RESET';
CREATE TABLE t1
(a INTEGER,
@@ -38,12 +37,10 @@ SET DEBUG_SYNC= 'alter_table_before_create_table_no_lock SIGNAL removing_partiti
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_upgrade';
--send ALTER TABLE t1 REMOVE PARTITIONING
connection default;
---echo # Con default
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitioning';
SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL waiting_for_alter';
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table WAIT_FOR waiting_for_upgrade';
DROP TABLE IF EXISTS t1;
---echo # Con 1
connection con1;
--error ER_LOCK_DEADLOCK
--reap
@@ -71,12 +68,10 @@ SET DEBUG_SYNC= 'alter_table_before_open_tables SIGNAL removing_partitions WAIT_
SET DEBUG_SYNC= 'alter_table_before_rename_result_table WAIT_FOR delete_done';
--send ALTER TABLE t2 REMOVE PARTITIONING
connection default;
---echo # Con default
SET DEBUG_SYNC= 'now WAIT_FOR removing_partitions';
SET DEBUG_SYNC= 'rm_table_no_locks_before_delete_table SIGNAL waiting_for_alter';
SET DEBUG_SYNC= 'rm_table_no_locks_before_binlog SIGNAL delete_done';
DROP TABLE IF EXISTS t2;
---echo # Con 1
connection con1;
--error ER_NO_SUCH_TABLE
--reap
@@ -84,7 +79,6 @@ SET DEBUG_SYNC= 'RESET';
disconnect con1;
--source include/wait_until_disconnected.inc
connection default;
---echo # Con default
SET DEBUG_SYNC= 'RESET';
--echo End of 5.1 tests
@@ -98,38 +92,32 @@ ENGINE = InnoDB PARTITION BY HASH (a) PARTITIONS 3;
HANDLER t1 OPEN;
---echo # Con1
connect (con1, localhost, root,,);
LOCK TABLES t1 WRITE, t2 READ;
---echo # Default
connection default;
SET DEBUG_SYNC="wait_for_lock SIGNAL locking";
send INSERT INTO t2 VALUES (1), (2), (3);
---echo # Con1
connection con1;
SET DEBUG_SYNC="now WAIT_FOR locking";
send ALTER TABLE t1 ADD COLUMN b int;
---echo # Default
connection default;
--error ER_LOCK_ABORTED
--reap
SELECT 1;
---echo # Con1
connection con1;
--reap
UNLOCK TABLES;
--disconnect con1
---echo # Default
connection default;
SET DEBUG_SYNC = 'RESET';
diff --git a/mysql-test/t/partition_innodb.test b/mysql-test/t/partition_innodb.test
index d7f683aa9e9..62a9173b526 100644
--- a/mysql-test/t/partition_innodb.test
+++ b/mysql-test/t/partition_innodb.test
@@ -106,7 +106,6 @@ INSERT INTO t1 VALUES (1, 1), (2, 2), (3, 3), (4, 4), (5, 5);
BEGIN;
SELECT COUNT(*) FROM t1;
---echo # con1
--connect (con1,localhost,root,,)
--echo # SEND a ALTER PARTITION which waits on the ongoing transaction.
--send
@@ -126,11 +125,11 @@ AND STATE = 'Waiting for table metadata lock';
SELECT COUNT(*) FROM t1;
COMMIT;
---echo # con1, reaping ALTER.
+--echo # reaping ALTER.
--connection con1
--reap
---echo # Disconnecting con1 and switching to default. Cleaning up.
+--echo # Cleaning up.
--disconnect con1
--connection default
@@ -170,7 +169,6 @@ SELECT * FROM t1 FOR UPDATE;
UPDATE t1 SET name = 'Mattias' WHERE id = 7;
SELECT * FROM t1 WHERE id = 7;
--connect (con1, localhost, root,,)
---echo # Connection con1
SET lock_wait_timeout = 1;
--echo # After the patch it will wait and fail on timeout.
--error ER_LOCK_WAIT_TIMEOUT
@@ -178,7 +176,6 @@ ALTER TABLE t1 DROP PARTITION p3;
SHOW WARNINGS;
--disconnect con1
--connection default
---echo # Connection default
SELECT * FROM t1;
--echo # No changes.
COMMIT;
@@ -609,7 +606,6 @@ START TRANSACTION;
SELECT * FROM t1 FOR UPDATE;
connect (con1, localhost, root,,);
---echo # Connection con1
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE t1 REORGANIZE PARTITION pMAX INTO
(PARTITION p3 VALUES LESS THAN (3),
@@ -626,7 +622,6 @@ SHOW WARNINGS;
disconnect con1;
connection default;
---echo # Connection default
SELECT * FROM t1;
COMMIT;
DROP TABLE t1;
@@ -871,10 +866,8 @@ CREATE TABLE t1
PARTITION BY HASH (a) PARTITIONS 3;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
--connect (con1, localhost, root,,)
- --echo # con1
ALTER TABLE t1 ADD INDEX idx1 (b);
--connection default
- --echo # con default
--error ER_TABLE_DEF_CHANGED
SELECT b FROM t1 WHERE b = 0;
--error ER_TABLE_DEF_CHANGED
@@ -889,11 +882,9 @@ CREATE TABLE t1
PRIMARY KEY (a))
ENGINE = InnoDB;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
---echo # con1
--connect (con1, localhost, root,,)
ALTER TABLE t1 ADD INDEX idx1 (b);
--connection default
---echo # con default
--error ER_TABLE_DEF_CHANGED
SELECT b FROM t1 WHERE b = 0;
--error ER_TABLE_DEF_CHANGED
diff --git a/mysql-test/t/partition_innodb_plugin.test b/mysql-test/t/partition_innodb_plugin.test
index fd6e60c27fb..eb3f999641d 100644
--- a/mysql-test/t/partition_innodb_plugin.test
+++ b/mysql-test/t/partition_innodb_plugin.test
@@ -41,7 +41,6 @@ SET @@global.innodb_file_format = Barracuda,
@@global.innodb_file_per_table = ON,
@@global.innodb_strict_mode = ON;
---echo # Connection con1
--connect(con1,localhost,root,,)
CREATE TABLE t1 (id INT NOT NULL
@@ -59,7 +58,6 @@ SET GLOBAL innodb_file_per_table = OFF;
--disconnect con1
--connect(con2,localhost,root,,)
---echo # Connection con2
LOCK TABLE t1 WRITE;
@@ -89,7 +87,6 @@ DROP TABLE t1;
--disconnect con2
--connection default
---echo # Connection default
SET @@global.innodb_strict_mode = @old_innodb_strict_mode;
SET @@global.innodb_file_format = @old_innodb_file_format;
SET @@global.innodb_file_per_table = @old_innodb_file_per_table;
@@ -110,20 +107,16 @@ SUBPARTITION BY HASH (a)
SUBPARTITION `sp3``\""e`));
INSERT INTO `t``\""e` VALUES (0), (2), (6), (10), (14), (18), (22);
START TRANSACTION;
---echo # con1
connect(con1,localhost,root,,);
SET NAMES utf8;
START TRANSACTION;
---echo # default connection
connection default;
UPDATE `t``\""e` SET a = 16 WHERE a = 0;
---echo # con1
connection con1;
UPDATE `t``\""e` SET a = 8 WHERE a = 22;
let $id_1= `SELECT CONNECTION_ID()`;
SEND;
UPDATE `t``\""e` SET a = 12 WHERE a = 0;
---echo # default connection
connection default;
let $wait_timeout= 2;
let $wait_condition= SELECT 1 FROM INFORMATION_SCHEMA.PROCESSLIST
@@ -156,12 +149,10 @@ set sql_mode = 'ANSI_QUOTES';
--replace_regex /.*RECORD LOCKS space id [0-9]* page no [0-9]* n bits [0-9]* // / trx id .*// /.*index .* in // /trx table locks [0-9]* // /total table locks [0-9]* //
SHOW ENGINE InnoDB STATUS;
set @@sql_mode = @old_sql_mode;
---echo # con1
connection con1;
REAP;
ROLLBACK;
disconnect con1;
---echo # default connection
connection default;
DROP TABLE `t``\""e`;
SET NAMES DEFAULT;
diff --git a/mysql-test/t/partition_innodb_semi_consistent.test b/mysql-test/t/partition_innodb_semi_consistent.test
index 7ab2527f0a5..7a1dfc36173 100644
--- a/mysql-test/t/partition_innodb_semi_consistent.test
+++ b/mysql-test/t/partition_innodb_semi_consistent.test
@@ -75,7 +75,6 @@ connect (con2,localhost,root,,);
SET SESSION AUTOCOMMIT = 0;
SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED;
set binlog_format=mixed;
---echo # Switch to connection con1
connection con1;
eval
@@ -94,7 +93,6 @@ UPDATE t1 SET b = 12 WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--enable_info
@@ -104,7 +102,6 @@ UPDATE t1 SET b = 21 WHERE a = 1;
--disable_info
ROLLBACK;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
ROLLBACK;
@@ -140,12 +137,10 @@ UPDATE t1 SET b = CONCAT(b, '+con1') WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--send CALL p1;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
COMMIT;
@@ -158,13 +153,11 @@ while ($bug31310)
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--reap
SELECT * FROM t1;
COMMIT;
---echo # Switch to connection con1
connection con1;
--echo # 3. test for updated key column:
@@ -180,12 +173,10 @@ UPDATE t1 SET a = 2, b = CONCAT(b, '+con1') WHERE a = 1;
--disable_info
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
--send CALL p1;
---echo # Switch to connection con1
connection con1;
SELECT * FROM t1;
COMMIT;
@@ -198,7 +189,6 @@ while ($bug31310)
SELECT * FROM t1;
---echo # Switch to connection con2
connection con2;
reap;
SELECT * FROM t1;
diff --git a/mysql-test/t/partition_innodb_stmt.test b/mysql-test/t/partition_innodb_stmt.test
index c6f30f41969..96a59cb9311 100644
--- a/mysql-test/t/partition_innodb_stmt.test
+++ b/mysql-test/t/partition_innodb_stmt.test
@@ -2,7 +2,6 @@
--source include/have_binlog_format_statement.inc
--source include/have_innodb.inc
---echo # connection default
SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ;
CREATE TABLE t1
@@ -28,14 +27,12 @@ SELECT * FROM t1;
connect (con1, localhost, root,,);
connection con1;
---echo #connection con1
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ;
BEGIN;
INSERT INTO t1 VALUES(7);
COMMIT;
connection default;
---echo # connection default
COMMIT;
FLUSH TABLES;
@@ -47,7 +44,6 @@ SELECT * FROM t1;
connection con1;
---echo # connection con1
SET TRANSACTION ISOLATION LEVEL READ COMMITTED;
BEGIN;
--error ER_BINLOG_STMT_MODE_AND_ROW_ENGINE
diff --git a/mysql-test/t/partition_sync.test b/mysql-test/t/partition_sync.test
index d5d60c176c5..fd704f35534 100644
--- a/mysql-test/t/partition_sync.test
+++ b/mysql-test/t/partition_sync.test
@@ -16,22 +16,18 @@ INSERT INTO t1 VALUES (0),(1);
connect(con1,localhost,root);
---echo # Connection 2
connection con1;
BEGIN;
SELECT * FROM t1;
---echo # Connection 1
connection default;
--error ER_DROP_PARTITION_NON_EXISTENT
ALTER TABLE t1 DROP PARTITION p3;
---echo # Connection 2
connection con1;
--echo # This failed with deadlock and should not do so.
SELECT * FROM t1;
---echo # Connection 1
connection default;
disconnect con1;
DROP TABLE t1;
@@ -53,34 +49,28 @@ INSERT INTO tbl_with_partitions VALUES (1);
connect(con2,localhost,root);
connect(con3,localhost,root);
---echo # Connection 3
connection con3;
LOCK TABLE tbl_with_partitions READ;
---echo # Connection 1
--echo # Access table with disabled autocommit
connection default;
SET AUTOCOMMIT = 0;
SELECT * FROM tbl_with_partitions;
---echo # Connection 2
--echo # Alter table, abort after prepare
connection con2;
set session debug_dbug="+d,abort_copy_table";
--error ER_LOCK_WAIT_TIMEOUT
ALTER TABLE tbl_with_partitions ADD COLUMN f INT;
---echo # Connection 1
--echo # Try accessing the table after Alter aborted.
--echo # This used to give ER_LOCK_DEADLOCK.
connection default;
SELECT * FROM tbl_with_partitions;
---echo # Connection 3
connection con3;
UNLOCK TABLES;
---echo # Connection 1
--echo # Cleanup
connection default;
disconnect con2;
diff --git a/mysql-test/t/plugin_auth_qa_1.test b/mysql-test/t/plugin_auth_qa_1.test
index 55fef4254e1..b0b8ffb3544 100644
--- a/mysql-test/t/plugin_auth_qa_1.test
+++ b/mysql-test/t/plugin_auth_qa_1.test
@@ -99,22 +99,16 @@ CREATE USER plug_user
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
GRANT PROXY ON plug_dest TO plug_user;
---echo connect(plug_user,localhost,plug_user,plug_dest);
connect(plug_user,localhost,plug_user,plug_dest);
select USER(),CURRENT_USER();
---echo connection default;
connection default;
---echo disconnect plug_user;
disconnect plug_user;
RENAME USER plug_user TO new_user;
---echo connect(plug_user,localhost,new_user,plug_dest);
connect(plug_user,localhost,new_user,plug_dest);
select USER(),CURRENT_USER();
---echo connection default;
connection default;
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
---echo disconnect plug_user;
disconnect plug_user;
UPDATE mysql.user SET user='plug_user' WHERE user='new_user';
FLUSH PRIVILEGES;
@@ -128,12 +122,9 @@ CREATE USER plug_user
IDENTIFIED WITH test_plugin_server AS 'plug_dest';
CREATE USER plug_dest IDENTIFIED BY 'plug_dest_passwd';
GRANT PROXY ON plug_dest TO plug_user;
---echo connect(plug_user,localhost,plug_user,plug_dest);
connect(plug_user,localhost,plug_user,plug_dest);
select USER(),CURRENT_USER();
---echo connection default;
connection default;
---echo disconnect plug_user;
disconnect plug_user;
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
@@ -149,7 +140,6 @@ UPDATE mysql.user SET plugin='new_plugin_server' WHERE user='new_user';
FLUSH PRIVILEGES;
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
---echo connect(plug_user,localhost,new_user,new_dest);
--disable_query_log
--error ER_PLUGIN_IS_NOT_LOADED
connect(plug_user,localhost,new_user,new_dest);
@@ -160,12 +150,9 @@ FLUSH PRIVILEGES;
GRANT PROXY ON new_dest TO new_user;
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
---echo connect(plug_user,localhost,new_user,new_dest);
connect(plug_user,localhost,new_user,new_dest);
select USER(),CURRENT_USER();
---echo connection default;
connection default;
---echo disconnect plug_user;
disconnect plug_user;
UPDATE mysql.user SET USER='plug_dest' WHERE user='new_dest';
FLUSH PRIVILEGES;
@@ -173,12 +160,9 @@ CREATE USER new_dest IDENTIFIED BY 'new_dest_passwd';
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
GRANT ALL PRIVILEGES ON test.* TO new_user;
---echo connect(plug_user,localhost,new_dest,new_dest_passwd);
connect(plug_user,localhost,new_dest,new_dest_passwd);
select USER(),CURRENT_USER();
---echo connection default;
connection default;
---echo disconnect plug_user;
disconnect plug_user;
DROP USER new_user,new_dest,plug_dest;
@@ -188,36 +172,26 @@ CREATE USER ''@'%%' IDENTIFIED WITH test_plugin_server AS 'proxied_user';
CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
---echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
SELECT USER(),CURRENT_USER();
--echo ========== test 2.2.1 ======================================
SELECT @@proxy_user;
---echo connection default;
connection default;
---echo disconnect proxy_con;
disconnect proxy_con;
---echo connect(proxy_con,localhost,proxy_user,proxied_user);
--disable_query_log
--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
connect(proxy_con,localhost,proxy_user,proxied_user);
--enable_query_log
GRANT PROXY ON proxied_user TO ''@'%%';
---echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
SELECT USER(),CURRENT_USER();
---echo connection default;
connection default;
---echo disconnect proxy_con;
disconnect proxy_con;
---echo connect(proxy_con,localhost,proxy_user,proxied_user);
connect(proxy_con,localhost,proxy_user,proxied_user);
SELECT USER(),CURRENT_USER();
--echo ========== test 2.2.1 ======================================
SELECT @@proxy_user;
---echo connection default;
connection default;
---echo disconnect proxy_con;
disconnect proxy_con;
DROP USER ''@'%%',proxied_user;
#
@@ -226,34 +200,24 @@ GRANT ALL PRIVILEGES ON test_user_db.* TO ''@'%%'
CREATE USER proxied_user IDENTIFIED BY 'proxied_user_passwd';
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
---echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection default;
connection default;
---echo disconnect proxy_con;
disconnect proxy_con;
---echo connect(proxy_con,localhost,proxy_user,proxied_user);
--disable_query_log
--error ER_ACCESS_DENIED_ERROR : this should fail : no grant
connect(proxy_con,localhost,proxy_user,proxied_user);
--enable_query_log
GRANT PROXY ON proxied_user TO ''@'%%';
---echo connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
connect(proxy_con,localhost,proxied_user,proxied_user_passwd);
SELECT USER(),CURRENT_USER();
---echo connection default;
connection default;
---echo disconnect proxy_con;
disconnect proxy_con;
---echo connect(proxy_con,localhost,proxy_user,proxied_user);
connect(proxy_con,localhost,proxy_user,proxied_user);
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection default;
connection default;
---echo disconnect proxy_con;
disconnect proxy_con;
DROP USER ''@'%%',proxied_user;
#
@@ -270,47 +234,31 @@ GRANT PROXY ON proxied_user_4 TO ''@'%%';
GRANT PROXY ON proxied_user_5 TO ''@'%%';
--sorted_result
SELECT user,plugin,authentication_string FROM mysql.user WHERE user != 'root';
---echo connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
connect(proxy_con_1,localhost,proxied_user_1,'proxied_user_1_pwd');
---echo connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
connect(proxy_con_2,localhost,proxied_user_2,proxied_user_2_pwd);
---echo connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
connect(proxy_con_3,localhost,proxied_user_3,proxied_user_3_pwd);
---echo connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
connect(proxy_con_4,localhost,proxied_user_4,proxied_user_4_pwd);
---echo connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
connect(proxy_con_5,localhost,proxied_user_5,proxied_user_5_pwd);
---echo connection proxy_con_1;
connection proxy_con_1;
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection proxy_con_2;
connection proxy_con_2;
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection proxy_con_3;
connection proxy_con_3;
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection proxy_con_4;
connection proxy_con_4;
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection proxy_con_5;
connection proxy_con_5;
SELECT USER(),CURRENT_USER();
SELECT @@proxy_user;
---echo connection default;
connection default;
---echo disconnect proxy_con_1;
disconnect proxy_con_1;
---echo disconnect proxy_con_2;
disconnect proxy_con_2;
---echo disconnect proxy_con_3;
disconnect proxy_con_3;
---echo disconnect proxy_con_4;
disconnect proxy_con_4;
---echo disconnect proxy_con_5;
disconnect proxy_con_5;
DROP USER ''@'%%',proxied_user_1,proxied_user_2,proxied_user_3,proxied_user_4,proxied_user_5;
diff --git a/mysql-test/t/query_cache_28249.test b/mysql-test/t/query_cache_28249.test
index b1be7c57343..a08371fe576 100644
--- a/mysql-test/t/query_cache_28249.test
+++ b/mysql-test/t/query_cache_28249.test
@@ -19,12 +19,10 @@ SET @query_cache_min_res_unit= @@global.query_cache_min_res_unit;
SET @query_cache_size= @@global.query_cache_size;
--echo # Bug#28249 Query Cache returns wrong result with concurrent insert/ certain lock
---echo # Establish connections user1,user2,user3 (user=root)
connect (user1,localhost,root,,test,,);
connect (user2,localhost,root,,test,,);
connect (user3,localhost,root,,test,,);
---echo # Switch to connection user1
connection user1;
SET GLOBAL query_cache_type=1;
@@ -40,11 +38,9 @@ CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
INSERT INTO t1 VALUES (1),(2),(3);
---echo # Switch to connection user2
connection user2;
LOCK TABLE t2 WRITE;
---echo # Switch to connection user1
connection user1;
--echo # "send" the next select, "reap" the result later.
--echo # The select will be blocked by the write lock on the t1.
@@ -53,7 +49,6 @@ SELECT *, (SELECT COUNT(*) FROM t2) FROM t1;
send;
eval $select_for_qc;
---echo # Switch to connection user3
connection user3;
# Typical information_schema.processlist content after sufficient sleep time
# ID USER COMMAND TIME STATE INFO
@@ -73,11 +68,9 @@ WHERE state = 'Waiting for table metadata lock'
AND info = '$select_for_qc';
INSERT INTO t1 VALUES (4);
---echo # Switch to connection user2
connection user2;
UNLOCK TABLES;
---echo # Switch to connection user1
connection user1;
#
# Since the lock ordering rule in thr_multi_lock depends on
@@ -95,13 +88,11 @@ connection user1;
--reap
--enable_result_log
---echo # Switch to connection user3
connection user3;
--echo # The next select enforces that effects of "concurrent_inserts" like the
--echo # record with a = 4 is missing in result sets can no more happen.
SELECT 1 FROM t1 WHERE a = 4;
---echo # Switch to connection user1
connection user1;
--echo # The next result set must contain 4 rows.
# If not, we have a regression of Bug#28249
@@ -111,7 +102,6 @@ eval $select_for_qc;
DROP TABLE t1,t2;
---echo # Switch to connection default + close connections user1,user2,user3
connection default;
disconnect user1;
disconnect user2;
@@ -121,4 +111,3 @@ SET GLOBAL query_cache_type= @query_cache_type;
SET GLOBAL query_cache_limit= @query_cache_limit;
SET GLOBAL query_cache_min_res_unit= @query_cache_min_res_unit;
SET GLOBAL query_cache_size= @query_cache_size;
-
diff --git a/mysql-test/t/query_cache_debug.test b/mysql-test/t/query_cache_debug.test
index 5eba778cf9e..31f2d786efb 100644
--- a/mysql-test/t/query_cache_debug.test
+++ b/mysql-test/t/query_cache_debug.test
@@ -27,7 +27,7 @@ connection default;
set debug_sync="now WAIT_FOR parked";
connection bug30887con2;
---echo On a second connection; clear the query cache.
+--echo clear the query cache.
show status like 'Qcache_queries_in_cache';
set global query_cache_size= 0;
@@ -71,28 +71,23 @@ connect(con1,localhost,root,,test,,);
connect(con2,localhost,root,,test,,);
connection con1;
---echo # Switch to connection con1
SET DEBUG_SYNC = "wait_after_query_cache_invalidate SIGNAL parked WAIT_FOR go";
--echo # Send concurrent insert, will wait in the query cache table invalidate
--send INSERT INTO t1 VALUES (4)
connection default;
---echo # Switch to connection default
--echo # Wait for concurrent insert to reach the debug point
SET DEBUG_SYNC = "now WAIT_FOR parked";
connection con2;
---echo # Switch to connection con2
--echo # Send SELECT that shouldn't be cached
SELECT * FROM t1;
connection default;
---echo # Switch to connection default
--echo # Notify the concurrent insert to proceed
SET DEBUG_SYNC = "now SIGNAL go";
connection con1;
---echo # Switch to connection con1
--echo # Gather insert result
--reap
SHOW STATUS LIKE "Qcache_queries_in_cache";
@@ -100,7 +95,6 @@ SHOW STATUS LIKE "Qcache_queries_in_cache";
SELECT * FROM t1;
SHOW STATUS LIKE "Qcache_queries_in_cache";
---echo # Disconnect
disconnect con1;
disconnect con2;
@@ -140,7 +134,6 @@ connect (thd3, localhost, root, ,test);
connect (thd1, localhost, root, ,test);
connection thd1;
---echo =================================== Connection thd1
--echo **
--echo ** Load Query Cache with a result set and one table.
--echo **
@@ -162,13 +155,11 @@ SET DEBUG_SYNC="wait_in_query_cache_invalidate2 SIGNAL parked1_2 WAIT_FOR go1_2"
--send DELETE FROM t1 WHERE a like '%a%';
connection default;
---echo =================================== Connection default
--echo ** Assert that the expect process status is obtained.
SET DEBUG_SYNC="now WAIT_FOR parked1_1";
-- echo **
connection thd2;
---echo =================================== Connection thd2
--echo ** On THD2: Insert a result into the cache. This attempt will be blocked
--echo ** because of a debug hook placed just before the mutex lock after which
--echo ** the first part of the result set is written.
@@ -176,21 +167,18 @@ SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked2 WAIT_FOR go2 EXECUTE 1
--send SELECT SQL_CACHE * FROM t2 UNION SELECT * FROM t3
connection default;
---echo =================================== Connection default
--echo ** Assert that the SELECT-stmt thread reaches the sync point.
SET DEBUG_SYNC="now WAIT_FOR parked2";
--echo **
--echo **
connection thd3;
---echo =================================== Connection thd3
--echo ** On THD3: Insert another result into the cache and block on the same
--echo ** debug hook.
SET DEBUG_SYNC="wait_in_query_cache_insert SIGNAL parked3 WAIT_FOR go3 EXECUTE 1";
--send SELECT SQL_CACHE * FROM t4 UNION SELECT * FROM t5
connection default;
---echo =================================== Connection default
--echo ** Assert that the SELECT-stmt thread reaches the sync point.
SET DEBUG_SYNC="now WAIT_FOR parked3";
--echo **
@@ -225,20 +213,17 @@ SET DEBUG_SYNC="now SIGNAL go1_2";
--echo *************************************************************************
--echo ** No tables should be locked
connection thd2;
---echo =================================== Connection thd2
reap;
DELETE FROM t1;
DELETE FROM t2;
DELETE FROM t3;
connection thd3;
---echo =================================== Connection thd3
reap;
DELETE FROM t4;
DELETE FROM t5;
connection thd1;
---echo =================================== Connection thd1
reap;
--echo ** Done.
@@ -278,23 +263,19 @@ connect(con1,localhost,root,,test,,);
connect(con2,localhost,root,,test,,);
connection con1;
---echo # Switch to connection con1
SET DEBUG_SYNC = "wait_in_query_cache_invalidate2 SIGNAL parked WAIT_FOR go";
--echo # Send INSERT, will wait in the query cache table invalidation
--send INSERT INTO t1 VALUES (4);
connection default;
---echo # Switch to connection default
--echo # Wait for insert to reach the debug point
SET DEBUG_SYNC = "now WAIT_FOR parked";
connection con2;
---echo # Switch to connection con2
--echo # Send a query that should wait on the query cache lock
--send RESET QUERY CACHE
connection default;
---echo # Switch to connection default
--echo # Wait for the state to be reflected in the processlist
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -304,12 +285,10 @@ let $wait_condition=
SET DEBUG_SYNC="now SIGNAL go";
connection con1;
---echo # Reap con1 and disconnect
--reap
disconnect con1;
connection con2;
---echo # Reap con2 and disconnect
--reap
disconnect con2;
diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test
index 3e5d4fc8ce1..3e970fc6da7 100644
--- a/mysql-test/t/read_only.test
+++ b/mysql-test/t/read_only.test
@@ -18,15 +18,12 @@ DROP TABLE IF EXISTS t1,t2,t3;
create user test@localhost;
grant CREATE, SELECT, DROP on *.* to test@localhost;
---echo connect (con1,localhost,test,,test);
connect (con1,localhost,test,,test);
---echo connection default;
connection default;
set global read_only=0;
---echo connection con1;
connection con1;
create table t1 (a int);
@@ -36,7 +33,6 @@ insert into t1 values(1);
create table t2 select * from t1;
---echo connection default;
connection default;
set global read_only=1;
@@ -46,7 +42,6 @@ set global read_only=1;
create table t3 (a int);
drop table t3;
---echo connection con1;
connection con1;
select @@global.read_only;
@@ -123,16 +118,13 @@ insert into t1 values(1);
# - is an error in the same connection
# - is ok in a different connection
---echo connection default;
connection default;
set global read_only=0;
lock table t1 write;
---echo connection con1;
connection con1;
lock table t2 write;
---echo connection default;
connection default;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
set global read_only=1;
@@ -142,7 +134,6 @@ unlock tables ;
--echo send set global read_only=1;
send set global read_only=1;
---echo connection con1;
connection con1;
select @@global.read_only;
unlock tables ;
@@ -150,7 +141,6 @@ let $wait_condition= SELECT @@global.read_only= 1;
--source include/wait_condition.inc
select @@global.read_only;
---echo connection default;
connection default;
--echo reap;
reap;
@@ -159,16 +149,13 @@ reap;
# - is an error in the same connection
# - is ok in a different connection
---echo connection default;
connection default;
set global read_only=0;
lock table t1 read;
---echo connection con1;
connection con1;
lock table t2 read;
---echo connection default;
connection default;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
set global read_only=1;
@@ -179,28 +166,23 @@ unlock tables ;
set global read_only=1;
select @@global.read_only;
---echo connection con1;
connection con1;
select @@global.read_only;
unlock tables ;
---echo connection default;
connection default;
# pending transaction / READ_ONLY
# - is an error in the same connection
# - is ok in a different connection
---echo connection default;
connection default;
set global read_only=0;
BEGIN;
---echo connection con1;
connection con1;
BEGIN;
---echo connection default;
connection default;
--error ER_LOCK_OR_ACTIVE_TRANSACTION
set global read_only=1;
@@ -208,7 +190,6 @@ ROLLBACK;
set global read_only=1;
---echo connection con1;
connection con1;
select @@global.read_only;
ROLLBACK;
@@ -217,26 +198,21 @@ ROLLBACK;
# - in the same SUPER connection
# - in another SUPER connection
---echo connection default;
connection default;
set global read_only=0;
flush tables with read lock;
set global read_only=1;
unlock tables;
---echo connect (root2,localhost,root,,test);
connect (root2,localhost,root,,test);
---echo connection default;
connection default;
set global read_only=0;
flush tables with read lock;
---echo connection root2;
connection root2;
set global read_only=1;
---echo connection default;
connection default;
select @@global.read_only;
unlock tables;
@@ -256,7 +232,6 @@ drop temporary table if exists ttt;
#
# Cleanup
#
---echo connection default;
connection default;
set global read_only=0;
disconnect con1;
@@ -283,18 +258,14 @@ grant all on mysqltest_db2.* to `mysqltest_u1`@`%`;
create database mysqltest_db1;
grant all on mysqltest_db1.* to `mysqltest_u1`@`%`;
flush privileges;
---echo connect (con_bug27440,127.0.0.1,mysqltest_u1,,test,MASTER_MYPORT,);
connect (con_bug27440,127.0.0.1,mysqltest_u1,,test,$MASTER_MYPORT,);
---echo connection con_bug27440;
connection con_bug27440;
--error ER_OPTION_PREVENTS_STATEMENT
create database mysqltest_db2;
show databases like '%mysqltest_db2%';
--error ER_OPTION_PREVENTS_STATEMENT
drop database mysqltest_db1;
---echo disconnect con_bug27440;
disconnect con_bug27440;
---echo connection default;
connection default;
delete from mysql.user where User like 'mysqltest_%';
delete from mysql.db where User like 'mysqltest_%';
diff --git a/mysql-test/t/read_only_innodb.test b/mysql-test/t/read_only_innodb.test
index f404ba17579..9ba3ccaca07 100644
--- a/mysql-test/t/read_only_innodb.test
+++ b/mysql-test/t/read_only_innodb.test
@@ -84,19 +84,15 @@ COMMIT;
connection default;
UNLOCK TABLES;
---echo connection con1;
connection con1;
lock table t1 read;
---echo connection default;
connection default;
set global read_only=1;
---echo connection con1;
connection con1;
unlock tables;
---echo connection default;
connection default;
SET GLOBAL read_only=0;
@@ -127,7 +123,6 @@ GRANT CREATE TEMPORARY TABLES, DROP, INSERT, DELETE, UPDATE,
SELECT, LOCK TABLES ON db1.* TO bug33669@localhost;
SET GLOBAL READ_ONLY = ON;
connect(con1,localhost,bug33669,,db1);
---echo # Connection con1 (user bug33669):
--echo
--echo # Create, insert and drop temporary table:
diff --git a/mysql-test/t/schema.test b/mysql-test/t/schema.test
index 6af7ee20b02..8f9047e2e3f 100644
--- a/mysql-test/t/schema.test
+++ b/mysql-test/t/schema.test
@@ -27,7 +27,6 @@ DROP SCHEMA IF EXISTS schema1;
connect(con2, localhost, root);
---echo # Connection default
connection default;
CREATE SCHEMA schema1;
@@ -36,11 +35,9 @@ CREATE TABLE schema1.t1 (a INT);
SET autocommit= FALSE;
INSERT INTO schema1.t1 VALUES (1);
---echo # Connection 2
connection con2;
--send DROP SCHEMA schema1
---echo # Connection default
connection default;
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
WHERE state= 'Waiting for table metadata lock'
@@ -52,11 +49,9 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
ALTER SCHEMA schema1 DEFAULT CHARACTER SET utf8;
SET autocommit= TRUE;
---echo # Connection 2
connection con2;
--reap
---echo # Connection default
connection default;
disconnect con2;
@@ -71,17 +66,14 @@ DROP SCHEMA IF EXISTS schema1;
connect (con2, localhost, root);
---echo # Connection default
connection default;
CREATE SCHEMA schema1;
CREATE TABLE schema1.t1 (id INT);
LOCK TABLE schema1.t1 WRITE;
---echo # Connection con2
connection con2;
--send DROP SCHEMA schema1
---echo # Connection default
connection default;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for schema metadata lock' and info='DROP SCHEMA schema1';
@@ -95,11 +87,9 @@ CREATE SCHEMA IF NOT EXISTS schema1;
--echo # UNLOCK TABLES so DROP SCHEMA can continue.
UNLOCK TABLES;
---echo # Connection con2
connection con2;
--reap
---echo # Connection default
connection default;
disconnect con2;
@@ -112,22 +102,18 @@ CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
INSERT INTO db1.t1 VALUES (1), (2);
---echo # Connection con1
connect (con1, localhost, root);
HANDLER db1.t1 OPEN;
---echo # Connection default
connection default;
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connect (con2, localhost, root);
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for table metadata lock' AND info='DROP DATABASE db1';
--source include/wait_condition.inc
---echo # Connection con1
connection con1;
# All these statements before resulted in deadlock.
CREATE DATABASE db2;
@@ -135,7 +121,6 @@ ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
HANDLER t1 CLOSE;
---echo # Connection default
connection default;
--echo # Reaping: DROP DATABASE db1
--reap
@@ -156,20 +141,17 @@ DROP DATABASE IF EXISTS db2;
connect (con2, localhost, root);
connect (con3, localhost, root);
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (id INT);
START TRANSACTION;
INSERT INTO db1.t1 VALUES (1);
---echo # Connection 2
connection con2;
--echo # DROP DATABASE should block due to the active transaction
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection 3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='Waiting for table metadata lock' and info='DROP DATABASE db1';
@@ -179,17 +161,14 @@ CREATE DATABASE db2;
ALTER DATABASE db2 DEFAULT CHARACTER SET utf8;
DROP DATABASE db2;
---echo # Connection default
connection default;
--echo # End the transaction so DROP DATABASE db1 can continue
COMMIT;
---echo # Connection 2
connection con2;
--echo # Reaping: DROP DATABASE db1
--reap
---echo # Connection default;
connection default;
disconnect con2;
disconnect con3;
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index d9aed952fce..a14c42d8ade 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -1232,7 +1232,6 @@ connection default;
CREATE TABLE t1 (i INT PRIMARY KEY);
LOCK TABLE t1 WRITE;
---echo # Switching to connection 'con1'.
connection con1;
--echo # This statement used to be blocked.
SHOW CREATE TABLE t1;
@@ -1240,7 +1239,6 @@ SHOW CREATE TABLE t1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Switching to connection 'default'.
connection default;
UNLOCK TABLES;
DROP TABLE t1;
@@ -1257,22 +1255,18 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT);
---echo # Connection con1
connect (con1,localhost,root);
LOCK TABLE t1 WRITE;
---echo # Connection default
connection default;
START TRANSACTION;
SHOW CREATE TABLE t1;
---echo # Connection con1
connection con1;
# Used to block
ALTER TABLE t1 CHARACTER SET = utf8;
UNLOCK TABLES;
---echo # Connection default
connection default;
COMMIT;
disconnect con1;
@@ -1292,27 +1286,22 @@ CREATE TRIGGER t1_bi BEFORE INSERT ON t1 FOR EACH ROW SET new.a = 1;
--echo # Test 1: SHOW CREATE TRIGGER with WRITE locked table.
---echo # Connection con1
connect (con1, localhost, root);
LOCK TABLE t1 WRITE;
---echo # Connection default
connection default;
# Should not block.
SHOW CREATE TRIGGER t1_bi;
---echo # Connection con1
connection con1;
UNLOCK TABLES;
--echo # Test 2: ALTER TABLE with SHOW CREATE TRIGGER in transaction
---echo # Connection default
connection default;
START TRANSACTION;
SHOW CREATE TRIGGER t1_bi;
---echo # Connection con1
connection con1;
# Should not block.
ALTER TABLE t1 CHARACTER SET = utf8;
@@ -1320,7 +1309,6 @@ ALTER TABLE t1 CHARACTER SET = utf8;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
COMMIT;
DROP TRIGGER t1_bi;
diff --git a/mysql-test/t/show_grants_with_plugin-7985.test b/mysql-test/t/show_grants_with_plugin-7985.test
index 9c05cb2e06d..84f71c72667 100644
--- a/mysql-test/t/show_grants_with_plugin-7985.test
+++ b/mysql-test/t/show_grants_with_plugin-7985.test
@@ -1,5 +1,4 @@
--source include/not_embedded.inc
---enable_connect_log
call mtr.add_suppression("password and an authentication plugin");
--echo #
diff --git a/mysql-test/t/sp-lock.test b/mysql-test/t/sp-lock.test
index a01c9e19908..83ea07d4bda 100644
--- a/mysql-test/t/sp-lock.test
+++ b/mysql-test/t/sp-lock.test
@@ -142,7 +142,6 @@ drop temporary table t1;
--echo # connection, try to use the routine.
--echo # That should block on the pending exclusive lock.
--echo #
---echo # Establish helper connections.
connect(con1, localhost, root,,);
connect(con2, localhost, root,,);
connect(con3, localhost, root,,);
@@ -150,7 +149,6 @@ connect(con3, localhost, root,,);
--echo #
--echo # Test DROP PROCEDURE.
--echo #
---echo # --> connection default
connection default;
create procedure p1() begin end;
delimiter |;
@@ -162,11 +160,9 @@ end|
delimiter ;|
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'drop procedure p1'...
send drop procedure p1;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop procedure t1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -176,24 +172,19 @@ info='drop procedure p1';
--echo # Demonstrate that there is a pending exclusive lock.
--echo # Sending 'select f1()'...
send select f1();
---echo # --> connection con3
connection con3;
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored procedure metadata lock' and info='select f1()';
---echo # --> connection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop procedure p1'...
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'select f1()'
--error ER_SP_DOES_NOT_EXIST
reap;
---echo # --> connection default
connection default;
--echo #
@@ -202,11 +193,9 @@ connection default;
create procedure p1() begin end;
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'create procedure p1'...
send create procedure p1() begin end;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'create procedure t1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -216,20 +205,16 @@ info='create procedure p1() begin end';
--echo # Demonstrate that there is a pending exclusive lock.
--echo # Sending 'select f1()'...
send select f1();
---echo # --> connection con3
connection con3;
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored procedure metadata lock' and info='select f1()';
---echo # --> connection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'create procedure p1'...
--error ER_SP_ALREADY_EXISTS
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'select f1()'
reap;
@@ -240,11 +225,9 @@ connection default;
--echo #
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'alter procedure p1'...
send alter procedure p1 contains sql;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'alter procedure t1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -254,23 +237,18 @@ info='alter procedure p1 contains sql';
--echo # Demonstrate that there is a pending exclusive lock.
--echo # Sending 'select f1()'...
send select f1();
---echo # --> connection con3
connection con3;
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored procedure metadata lock' and info='select f1()';
---echo # --> connection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'alter procedure p1'...
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'select f1()'
reap;
---echo # --> connection default
connection default;
--echo #
@@ -278,11 +256,9 @@ connection default;
--echo #
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'drop function f1'...
send drop function f1;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -292,24 +268,19 @@ info='drop function f1';
--echo # Demonstrate that there is a pending exclusive lock.
--echo # Sending 'select f1()'...
send select f1();
---echo # --> connection con3
connection con3;
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored function metadata lock' and info='select f1()';
---echo # --> connection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop function f1'...
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'select f1()'
--error ER_SP_DOES_NOT_EXIST
reap;
---echo # --> connection default
connection default;
--echo #
@@ -318,11 +289,9 @@ connection default;
create function f1() returns int return 1;
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'create function f1'...
send create function f1() returns int return 2;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'create function f1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -332,24 +301,19 @@ info='create function f1() returns int return 2';
--echo # Demonstrate that there is a pending exclusive lock.
--echo # Sending 'select f1()'...
send select f1();
---echo # --> connection con3
connection con3;
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored function metadata lock' and info='select f1()';
---echo # --> connection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'create function f1'...
--error ER_SP_ALREADY_EXISTS
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'select f1()'
reap;
---echo # --> connection default
connection default;
--echo #
@@ -357,11 +321,9 @@ connection default;
--echo #
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'alter function f1'...
send alter function f1 contains sql;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'alter function f1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -371,23 +333,18 @@ info='alter function f1 contains sql';
--echo # Demonstrate that there is a pending exclusive lock.
--echo # Sending 'select f1()'...
send select f1();
---echo # --> connection con3
connection con3;
--echo # Waiting for 'select f1()' to get blocked by a pending MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored function metadata lock' and info='select f1()';
---echo # --> connection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'alter function f1'...
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'select f1()'
reap;
---echo # --> connection default
connection default;
drop function f1;
drop procedure p1;
@@ -427,13 +384,11 @@ call p4();
prepare stmt from "call p4()";
execute stmt;
execute stmt;
---echo # --> connection con1
connection con1;
drop procedure p1;
drop procedure p2;
drop procedure p3;
drop procedure p4;
---echo # --> connection default
connection default;
--echo # This is to verify there was no implicit commit.
rollback to savepoint sv;
@@ -456,25 +411,20 @@ create trigger t1_ai after insert on t1 for each row
insert into t2 (a, b) values (new.a, f1());
begin;
insert into t1 (a) values (1);
---echo # --> connection con1
connection con1;
--echo # Sending 'drop function f1'
send drop function f1;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored function metadata lock' and
info='drop function f1';
--source include/wait_condition.inc
---echo # --> connnection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop function f1'...
reap;
---echo # --> connection default
connection default;
--echo #
--echo # A function is used from a view.
@@ -483,25 +433,20 @@ create function f1() returns int return 1;
create view v1 as select f1() as a;
begin;
select * from v1;
---echo # --> connection con1
connection con1;
--echo # Sending 'drop function f1'
send drop function f1;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored function metadata lock' and
info='drop function f1';
--source include/wait_condition.inc
---echo # --> connnection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop function f1'...
reap;
---echo # --> connection default
connection default;
--echo #
--echo # A procedure is used from a function.
@@ -517,25 +462,20 @@ delimiter ;|
create procedure p1(out v_out int) set v_out=3;
begin;
select * from v1;
---echo # --> connection con1
connection con1;
--echo # Sending 'drop procedure p1'
send drop procedure p1;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop procedure p1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored procedure metadata lock' and
info='drop procedure p1';
--source include/wait_condition.inc
---echo # --> connnection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop procedure p1'...
reap;
---echo # --> connection default
connection default;
--echo #
@@ -549,25 +489,20 @@ create trigger t1_ai after insert on t1 for each row
insert into t2 (a, b) values (new.a, (select max(a) from v1));
begin;
insert into t1 (a) values (3);
---echo # --> connection con1
connection con1;
--echo # Sending 'drop function f2'
send drop function f2;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop function f2' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
where state='Waiting for stored function metadata lock' and
info='drop function f2';
--source include/wait_condition.inc
---echo # --> connnection default
connection default;
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop function f2'...
reap;
---echo # --> connection default
connection default;
drop view v1;
@@ -612,11 +547,9 @@ lock table v1 read;
select * from v1;
savepoint sv;
select f2();
---echo # --> connection con1
connection con1;
--echo # Sending 'drop function f1'...
send drop function f1;
---echo # --> connection con2
connection con2;
--echo # Waiting for 'drop function f1' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -625,7 +558,6 @@ info='drop function f1';
--source include/wait_condition.inc
--echo # Sending 'drop function f2'...
send drop function f2;
---echo # --> connection default
connection default;
--echo # Waiting for 'drop function f2' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -633,18 +565,14 @@ where state='Waiting for stored function metadata lock' and
info='drop function f2';
--source include/wait_condition.inc
rollback to savepoint sv;
---echo # --> connection con2
connection con2;
--echo # Reaping 'drop function f2'...
reap;
---echo # --> connection default
connection default;
unlock tables;
---echo # --> connection con1
connection con1;
--echo # Reaping 'drop function f1'...
reap;
---echo # --> connection default
connection default;
--error ER_SP_DOES_NOT_EXIST
drop function f1;
@@ -683,18 +611,14 @@ begin
execute stmt;
end|
delimiter ;|
---echo # --> connection con2
connection con2;
prepare stmt from "select f2()";
---echo # --> connection default
connection default;
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'alter function f1 ...'...
send alter function f1 comment "comment";
---echo # --> connection con2
connection con2;
--echo # Waiting for 'alter function f1 ...' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -711,16 +635,13 @@ info='select f1() into @var';
--source include/wait_condition.inc
--echo # Let 'alter function f1 ...' go through...
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'alter function f1 ...'
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'call p1()'...
reap;
deallocate prepare stmt;
---echo # --> connection default
connection default;
drop function f1;
drop function f2;
@@ -739,11 +660,9 @@ drop procedure p1;
create function f1() returns int return 1;
begin;
select f1();
---echo # --> connection con1
connection con1;
--echo # Sending 'alter function f1 ...'...
send alter function f1 comment "comment";
---echo # --> connection con2
connection con2;
--echo # Waiting for 'alter function f1 ...' to get blocked on MDL lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -781,15 +700,12 @@ info='select f1() into @var';
--source include/wait_condition.inc
--echo # Let 'alter function f1 ...' go through...
commit;
---echo # --> connection con1
connection con1;
--echo # Reaping 'alter function f1 ...'
reap;
---echo # --> connection con2
connection con2;
--echo # Reaping 'call p1()'...
reap;
---echo # --> connection default
connection default;
drop function f1;
drop function f2;
@@ -817,14 +733,11 @@ begin
return res;
end|
delimiter ;|
---echo # --> connection con1
connection con1;
select get_lock("30977", 0);
---echo # --> connection default
connection default;
--echo # Sending 'select f3()'...
send select f3();
---echo # --> connection con1
connection con1;
--echo # Waiting for 'select f3()' to get blocked on the user level lock...
let $wait_condition=select count(*)=1 from information_schema.processlist
@@ -834,7 +747,6 @@ where state='User lock' and info='select f1() into @var';
create function f4() returns int return 4;
drop function f4;
select release_lock("30977");
---echo # --> connection default
connection default;
--echo # Reaping 'select f3()'...
--echo # Routine 'f2()' should exist and get executed successfully.
@@ -880,19 +792,15 @@ drop procedure p1;
drop function f1;
set @@session.max_sp_recursion_depth=default;
---echo # --> connection con1
connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # --> connection con2
connection con2;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # --> connection con3
connection con3;
disconnect con3;
--source include/wait_until_disconnected.inc
---echo # --> connection default
connection default;
@@ -914,17 +822,14 @@ delimiter ;|
connect (con2, localhost, root);
connect (con3, localhost, root);
---echo # Connection default
connection default;
SELECT get_lock("test", 10);
---echo # Connection 2
connection con2;
--echo # Will halt before executing SHOW CREATE PROCEDURE p1
--echo # Sending:
--send CALL p1()
---echo # Connection 3
connection con3;
let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
WHERE state='User lock' and info='SELECT get_lock("test", 10)';
@@ -933,25 +838,20 @@ let $wait_condition=SELECT COUNT(*)=1 FROM information_schema.processlist
DROP PROCEDURE p1;
CREATE PROCEDURE p1() BEGIN END;
---echo # Connection default
connection default;
--echo # Resume CALL p1, now with new p1
SELECT release_lock("test");
---echo # Connection 2
connection con2;
--echo # Reaping: CALL p1()
--reap
---echo # Connection 3
connection con3;
disconnect con3;
--source include/wait_until_disconnected.inc
---echo # Connection 2
connection con2;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection default;
connection default;
DROP PROCEDURE p1;
@@ -972,19 +872,16 @@ connect(con2, localhost, root);
--echo # Test 1: Check that DROP DATABASE block if a function is used
--echo # by an active transaction.
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
START TRANSACTION;
SELECT db1.f1();
---echo # Connection con1
connection con1;
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection default
connection default;
--echo # Waiting for DROP DATABASE to be blocked by the lock on f1()
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -993,7 +890,6 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--source include/wait_condition.inc
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: DROP DATABASE db1
--reap
@@ -1001,7 +897,6 @@ connection con1;
--echo # Test 2: Check that DROP DATABASE blocks if a procedure is
--echo # used by an active transaction.
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE PROCEDURE db1.p1() BEGIN END;
@@ -1015,12 +910,10 @@ delimiter ;|
START TRANSACTION;
SELECT f1();
---echo # Connection con1
connection con1;
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection default
connection default;
--echo # Waiting for DROP DATABASE to be blocked by the lock on p1()
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -1029,7 +922,6 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--source include/wait_condition.inc
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: DROP DATABASE db1
--reap
@@ -1037,7 +929,6 @@ connection con1;
--echo # Test 3: Check that DROP DATABASE is not selected as a victim if a
--echo # deadlock is discovered with DML statements.
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE TABLE db1.t1 (a INT);
@@ -1046,12 +937,10 @@ START TRANSACTION;
# DROP DATABASE will lock tables (t1) before functions (f1)
SELECT db1.f1();
---echo # Connection con1
connection con1;
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection default
connection default;
--echo # Waiting for DROP DATABASE to be blocked by the lock on f1()
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -1062,14 +951,12 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
SELECT * FROM db1.t1;
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: DROP DATABASE db1
--reap
--echo # Test 4: Check that active DROP DATABASE blocks stored routine DDL.
---echo # Connection default
connection default;
CREATE DATABASE db1;
CREATE FUNCTION db1.f1() RETURNS INTEGER RETURN 1;
@@ -1077,12 +964,10 @@ CREATE FUNCTION db1.f2() RETURNS INTEGER RETURN 2;
START TRANSACTION;
SELECT db1.f2();
---echo # Connection con1
connection con1;
--echo # Sending:
--send DROP DATABASE db1
---echo # Connection con2
connection con2;
--echo # Waiting for DROP DATABASE to be blocked by the lock on f2()
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -1092,7 +977,6 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--echo # Sending:
--send ALTER FUNCTION db1.f1 COMMENT "test"
---echo # Connection default
connection default;
--echo # Waiting for ALTER FUNCTION to be blocked by the schema lock on db1
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
@@ -1101,14 +985,12 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--source include/wait_condition.inc
COMMIT;
---echo # Connection con1
connection con1;
--echo # Reaping: DROP DATABASE db1
--reap
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection con2
connection con2;
--echo # Reaping: ALTER FUNCTION f1 COMMENT 'test'
--error ER_SP_DOES_NOT_EXIST
@@ -1116,7 +998,6 @@ connection con2;
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
DROP FUNCTION f1;
diff --git a/mysql-test/t/sp-security.test b/mysql-test/t/sp-security.test
index a5df4859d6b..f719cbff11c 100644
--- a/mysql-test/t/sp-security.test
+++ b/mysql-test/t/sp-security.test
@@ -580,8 +580,6 @@ drop database db_bug14533;
# Setup the environment.
---echo
---echo ---> connection: root
--connection con1root
--disable_warnings
@@ -602,8 +600,6 @@ GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
# test case (1).
---echo
---echo ---> connection: mysqltest_2_con
--connection mysqltest_2_con
USE mysqltest;
@@ -614,8 +610,6 @@ CREATE FUNCTION wl2897_f1() RETURNS INT RETURN 1;
# test case (2).
---echo
---echo ---> connection: mysqltest_1_con
--connection mysqltest_1_con
USE mysqltest;
@@ -628,8 +622,6 @@ CREATE DEFINER=root@localhost FUNCTION wl2897_f2() RETURNS INT RETURN 2;
# test case (3).
---echo
---echo ---> connection: mysqltest_2_con
--connection mysqltest_2_con
use mysqltest;
@@ -640,8 +632,6 @@ CREATE DEFINER='a @ b @ c'@localhost FUNCTION wl2897_f3() RETURNS INT RETURN 3;
# test case (4).
---echo
---echo ---> connection: con1root
--connection con1root
USE mysqltest;
@@ -669,8 +659,6 @@ DROP DATABASE mysqltest;
# Prepare environment.
---echo
---echo ---> connection: root
--connection con1root
--disable_warnings
@@ -690,8 +678,6 @@ GRANT ALL PRIVILEGES ON mysqltest.* TO mysqltest_2@localhost;
# Create a procedure/function under u1.
---echo
---echo ---> connection: mysqltest_1_con
--connection mysqltest_1_con
USE mysqltest;
@@ -708,8 +694,6 @@ SELECT bug13198_f1();
# Check that u2 can call the procedure/function.
---echo
---echo ---> connection: mysqltest_2_con
--connection mysqltest_2_con
USE mysqltest;
@@ -720,8 +704,6 @@ SELECT bug13198_f1();
# Drop user u1 (definer of the object);
---echo
---echo ---> connection: root
--connection con1root
--disconnect mysqltest_1_con
@@ -730,8 +712,6 @@ DROP USER mysqltest_1@localhost;
# Check that u2 can not call the procedure/function.
---echo
---echo ---> connection: mysqltest_2_con
--connection mysqltest_2_con
USE mysqltest;
@@ -744,8 +724,6 @@ SELECT bug13198_f1();
# Cleanup.
---echo
---echo ---> connection: root
--connection con1root
--disconnect mysqltest_2_con
@@ -767,8 +745,6 @@ user19857@localhost;
SELECT Host,User,Password FROM mysql.user WHERE User='user19857';
--connect (mysqltest_2_con,localhost,user19857,meow,test)
---echo
---echo ---> connection: mysqltest_2_con
--connection mysqltest_2_con
USE test;
@@ -790,8 +766,6 @@ SHOW CREATE PROCEDURE test.sp19857;
DROP PROCEDURE IF EXISTS test.sp19857;
---echo
---echo ---> connection: root
--connection con1root
--disconnect mysqltest_2_con
@@ -949,7 +923,6 @@ create database mysqltest_db;
create user bug57061_user@localhost;
create function mysqltest_db.f1() returns int return 0;
create procedure mysqltest_db.p1() begin end;
---echo # Connect as user 'bug57061_user@localhost'
connect (conn1, localhost, bug57061_user,,);
--echo # Attempt to drop routine on which user doesn't have privileges
--echo # should result in the same 'access denied' type of error whether
@@ -962,7 +935,6 @@ drop procedure if exists mysqltest_db.p_does_not_exist;
drop function if exists mysqltest_db.f1;
--error ER_PROCACCESS_DENIED_ERROR
drop procedure if exists mysqltest_db.p1;
---echo # Connection 'default'.
connection default;
disconnect conn1;
drop user bug57061_user@localhost;
@@ -983,23 +955,19 @@ CREATE PROCEDURE db1.p1() SELECT 1;
CREATE USER user2@localhost IDENTIFIED BY '';
GRANT SELECT(db) ON mysql.proc TO user2@localhost;
---echo # Connection con2 as user2
connect (con2, localhost, user2);
--echo # The statement below before disclosed info from body_utf8 column.
--error ER_SP_DOES_NOT_EXIST
SHOW CREATE PROCEDURE db1.p1;
--echo # Check that SHOW works with SELECT grant on whole table
---echo # Connection default
connection default;
GRANT SELECT ON mysql.proc TO user2@localhost;
---echo # Connection con2
connection con2;
--echo # This should work
SHOW CREATE PROCEDURE db1.p1;
---echo # Connection default
connection default;
disconnect con2;
DROP USER user2@localhost;
@@ -1020,7 +988,6 @@ create procedure mysqltest_db.p1() begin end;
--echo # Create user with no privileges on mysqltest_db database.
create user bug12602983_user@localhost;
---echo # Connect as user 'bug12602983_user@localhost'
connect (conn1, localhost, bug12602983_user,,);
--echo # Attempt to execute routine on which user doesn't have privileges
@@ -1041,7 +1008,6 @@ create view bug12602983_v1 as select mysqltest_db.f_does_not_exist();
--error ER_PROCACCESS_DENIED_ERROR
create view bug12602983_v1 as select mysqltest_db.f1();
---echo # Connection 'default'.
connection default;
disconnect conn1;
drop user bug12602983_user@localhost;
diff --git a/mysql-test/t/sp_notembedded.test b/mysql-test/t/sp_notembedded.test
index d7aaaa4340f..c620f415e22 100644
--- a/mysql-test/t/sp_notembedded.test
+++ b/mysql-test/t/sp_notembedded.test
@@ -331,7 +331,6 @@ FLUSH PRIVILEGES;
--echo #
SELECT GET_LOCK('Bug44521', 0);
--connect (con1,localhost,root,,)
---echo ** Connection con1
delimiter $;
CREATE PROCEDURE p()
BEGIN
@@ -342,7 +341,6 @@ END$
delimiter ;$
--send CALL p();
--connection default
---echo ** Default connection
let $wait_condition=
SELECT count(*) = 1 FROM information_schema.processlist
WHERE state = "User lock" AND info = "SELECT GET_LOCK('Bug44521', 100)";
@@ -420,14 +418,12 @@ use `my.db`;
CREATE FUNCTION f1(a int) RETURNS INT RETURN a;
---echo # Create new connection.
connect (addcon, localhost, root,,);
connection addcon;
USE `my.db`;
SELECT f1(1);
SELECT `my.db`.f1(2);
---echo # Switching to default connection.
connection default;
disconnect addcon;
DROP DATABASE `my.db`;
diff --git a/mysql-test/t/sp_sync.test b/mysql-test/t/sp_sync.test
index 589832bb570..a5682fc572f 100644
--- a/mysql-test/t/sp_sync.test
+++ b/mysql-test/t/sp_sync.test
@@ -24,7 +24,6 @@ SET DEBUG_SYNC= 'RESET';
connect (con2, localhost, root);
---echo # Connection default
connection default;
CREATE FUNCTION f1() RETURNS INT RETURN 1;
--echo # Get f1 cached
@@ -34,7 +33,6 @@ SET DEBUG_SYNC= 'before_execute_sql_command SIGNAL before WAIT_FOR changed';
--echo # Sending:
--send SELECT f1()
---echo # Connection 2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR before';
--echo # ... but before f1 is locked, change it.
@@ -42,7 +40,6 @@ DROP FUNCTION f1;
CREATE FUNCTION f1() RETURNS INT RETURN 2;
SET DEBUG_SYNC= 'now SIGNAL changed';
---echo # Connection default
--echo # We should now get '2' and not '1'.
connection default;
--echo # Reaping: SELECT f1()
@@ -66,25 +63,21 @@ DROP FUNCTION IF EXISTS f1;
connect (con2, localhost, root);
connect (con3, localhost, root);
---echo # Connection default
connection default;
CREATE FUNCTION f1() RETURNS INT RETURN 0;
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'after_wait_locked_pname SIGNAL locked WAIT_FOR issued';
--echo # con2 will now have an x-lock on f1
--echo # Sending:
--send ALTER FUNCTION f1 COMMENT 'comment'
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked';
--disable_result_log
--echo # This query will block due to the x-lock on f1 and back-off
--send SHOW OPEN TABLES WHERE f1()=0
---echo # Connection con3
connection con3;
let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
WHERE state= 'Waiting for stored function metadata lock'
@@ -93,7 +86,6 @@ let $wait_condition= SELECT COUNT(*)= 1 FROM information_schema.processlist
--echo # Check that the IS query is blocked before releasing the x-lock
SET DEBUG_SYNC= 'now SIGNAL issued';
---echo # Connection default
connection default;
--echo # Reaping: ALTER FUNCTION f1 COMMENT 'comment'
--reap
@@ -116,7 +108,6 @@ CREATE PROCEDURE p1() SELECT COUNT(f1(a)) FROM t1, t0;
INSERT INTO t0 VALUES(1);
INSERT INTO t1 VALUES(1), (2);
---echo # Connection 2
connect (con2, localhost, root);
CALL p1();
@@ -128,7 +119,6 @@ SET DEBUG_SYNC= 'after_open_table_mdl_shared SIGNAL locked_t1 WAIT_FOR go_for_t0
--echo # Sending:
--send CALL p1()
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR locked_t1';
--echo # Issue LOCK TABLES statement which will enter in MDL deadlock
@@ -138,12 +128,10 @@ SET DEBUG_SYNC= 'mdl_acquire_lock_wait SIGNAL go_for_t0';
LOCK TABLES t0 WRITE, t1 WRITE;
UNLOCK TABLES;
---echo # Connection 2
connection con2;
--echo # Reaping: CALL p1()
--reap;
---echo # Connection default
connection default;
disconnect con2;
DROP PROCEDURE p1;
diff --git a/mysql-test/t/ssl_connect.test b/mysql-test/t/ssl_connect.test
index 05d6dc45c74..ce57e4f746d 100644
--- a/mysql-test/t/ssl_connect.test
+++ b/mysql-test/t/ssl_connect.test
@@ -4,12 +4,14 @@
# Repeat connect/disconnect
let $i=100;
+disable_connect_log;
while ($i)
{
connect (test_con1,localhost,root,,,,,SSL);
disconnect test_con1;
dec $i;
}
+enable_connect_log;
echo completed;
## This test file is for testing encrypted communication only, not other
diff --git a/mysql-test/t/status.test b/mysql-test/t/status.test
index 32b903c0265..e0b0d9c8838 100644
--- a/mysql-test/t/status.test
+++ b/mysql-test/t/status.test
@@ -30,7 +30,6 @@ show status like 'Table_lock%';
select * from information_schema.session_status where variable_name like 'Table_lock%';
connection con1;
---echo # Switched to connection: con1
set sql_log_bin=0;
set @old_general_log = @@global.general_log;
set global general_log = 'OFF';
@@ -45,18 +44,15 @@ insert into t1 values(1);
select 1;
connection con2;
---echo # Switched to connection: con2
lock tables t1 read;
unlock tables;
lock tables t1 read;
connection con1;
---echo # Switched to connection: con1
let $ID= `select connection_id()`;
--send update t1 set n = 3
connection con2;
---echo # Switched to connection: con2
# wait for the other query to start executing
let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST
where ID = $ID and STATE = "Waiting for table level lock";
@@ -64,7 +60,6 @@ let $wait_condition= select 1 from INFORMATION_SCHEMA.PROCESSLIST
unlock tables;
connection con1;
---echo # Switched to connection: con1
reap;
show status like 'Table_locks_waited';
drop table t1;
@@ -73,7 +68,6 @@ set global general_log = @old_general_log;
disconnect con2;
disconnect con1;
connection default;
---echo # Switched to connection: default
# End of 4.1 tests
diff --git a/mysql-test/t/trans_read_only.test b/mysql-test/t/trans_read_only.test
index f50fb7db376..38b2a833216 100644
--- a/mysql-test/t/trans_read_only.test
+++ b/mysql-test/t/trans_read_only.test
@@ -10,7 +10,7 @@
--echo # Check that the option was set by the .opt file.
SELECT @@tx_read_only;
---echo # Also for new connections. Switching to con1
+--echo # Also for new connections.
connect (con1, localhost, root);
SELECT @@tx_read_only;
SET SESSION TRANSACTION READ WRITE;
@@ -18,7 +18,6 @@ SELECT @@tx_read_only;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
SELECT @@tx_read_only;
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index c627d1a6040..2d949b0c91e 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -42,8 +42,6 @@ GRANT CREATE, TRIGGER ON mysqltest_db1.* TO mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT);
diff --git a/mysql-test/t/trigger-trans.test b/mysql-test/t/trigger-trans.test
index c17202055e1..17656c3516e 100644
--- a/mysql-test/t/trigger-trans.test
+++ b/mysql-test/t/trigger-trans.test
@@ -191,7 +191,6 @@ drop table t1,t2;
--echo # AND TRIGGER HANDLERS TO BE IGNORED
--echo #Code fixed in Bug#16041903
---enable_connect_log
CREATE TABLE t1 (id int unsigned PRIMARY KEY, val int DEFAULT 0)
ENGINE=InnoDB;
@@ -232,7 +231,5 @@ connection default;
DROP TABLE t3, t2, t1;
---disable_connect_log
-
# Wait till we reached the initial number of concurrent sessions
--source include/wait_until_count_sessions.inc
diff --git a/mysql-test/t/trigger_notembedded.test b/mysql-test/t/trigger_notembedded.test
index f0c565be41f..df5637790af 100644
--- a/mysql-test/t/trigger_notembedded.test
+++ b/mysql-test/t/trigger_notembedded.test
@@ -47,8 +47,6 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT);
@@ -56,8 +54,6 @@ CREATE TABLE t2(user_str TEXT);
--disconnect wl2818_definer_con
--connection default
---echo
---echo ---> connection: default
GRANT INSERT, DROP ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
GRANT INSERT, DROP ON mysqltest_db1.t2 TO mysqltest_dfn@localhost;
@@ -67,15 +63,11 @@ GRANT INSERT, DROP ON mysqltest_db1.t2 TO mysqltest_dfn@localhost;
#
--connection default
---echo
---echo ---> connection: default
GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
--error ER_TABLEACCESS_DENIED_ERROR
CREATE TRIGGER trg1 AFTER INSERT ON t1
@@ -89,15 +81,11 @@ CREATE TRIGGER trg1 AFTER INSERT ON t1
#
--connection default
---echo
---echo ---> connection: default
GRANT TRIGGER ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
CREATE TRIGGER trg1 AFTER INSERT ON t1
FOR EACH ROW
@@ -106,15 +94,11 @@ CREATE TRIGGER trg1 AFTER INSERT ON t1
--disconnect wl2818_definer_con
--connection default
---echo
---echo ---> connection: default
REVOKE TRIGGER ON mysqltest_db1.t1 FROM mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
--error ER_TABLEACCESS_DENIED_ERROR
DROP TRIGGER trg1;
@@ -127,8 +111,6 @@ DROP TRIGGER trg1;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
--error ER_TABLEACCESS_DENIED_ERROR
INSERT INTO t1 VALUES(0);
@@ -136,15 +118,11 @@ INSERT INTO t1 VALUES(0);
--disconnect wl2818_definer_con
--connection default
---echo
---echo ---> connection: default
GRANT TRIGGER ON mysqltest_db1.t1 TO mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
INSERT INTO t1 VALUES(0);
@@ -156,8 +134,6 @@ TRUNCATE TABLE t2;
--disconnect wl2818_definer_con
--connection default
---echo
---echo ---> connection: default
REVOKE SUPER ON *.* FROM mysqltest_dfn@localhost;
@@ -175,16 +151,12 @@ REVOKE SUPER ON *.* FROM mysqltest_dfn@localhost;
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
CREATE TRIGGER trg1 AFTER INSERT ON t1
FOR EACH ROW
INSERT INTO t2 VALUES(CURRENT_USER());
--connection default
---echo
---echo ---> connection: default
# Setup definer's privileges.
@@ -200,8 +172,6 @@ GRANT SELECT ON mysqltest_db1.t2
TO 'mysqltest_inv'@localhost;
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
use mysqltest_db1;
@@ -212,8 +182,6 @@ SELECT * FROM t2;
--connect (wl2818_invoker_con,localhost,mysqltest_inv,,mysqltest_db1)
--connection wl2818_invoker_con
---echo
---echo ---> connection: wl2818_invoker_con
use mysqltest_db1;
@@ -234,16 +202,12 @@ SELECT * FROM t2;
#
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
REVOKE INSERT ON mysqltest_db1.t2 FROM mysqltest_dfn@localhost;
--connection wl2818_invoker_con
---echo
---echo ---> connection: wl2818_invoker_con
use mysqltest_db1;
@@ -273,8 +237,6 @@ SELECT * FROM t2;
#
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
use mysqltest_db1;
@@ -289,8 +251,6 @@ CREATE DEFINER='mysqltest_inv'@'localhost'
SET @new_sum = 0;
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
@@ -299,8 +259,6 @@ GRANT SUPER ON *.* TO mysqltest_dfn@localhost;
--disconnect wl2818_definer_con
--connect (wl2818_definer_con,localhost,mysqltest_dfn,,mysqltest_db1)
--connection wl2818_definer_con
---echo
---echo ---> connection: wl2818_definer_con
CREATE DEFINER='mysqltest_inv'@'localhost'
TRIGGER trg1 BEFORE INSERT ON t1
@@ -388,8 +346,6 @@ SELECT * FROM INFORMATION_SCHEMA.TRIGGERS ORDER BY trigger_name;
#
--connection default
---echo
---echo ---> connection: default
DROP USER mysqltest_dfn@localhost;
DROP USER mysqltest_inv@localhost;
@@ -445,8 +401,6 @@ SET @mysqltest_var = NULL;
# NEW/OLD variables.
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
@@ -454,8 +408,6 @@ GRANT DELETE ON mysqltest_db1.* TO mysqltest_u1@localhost;
SHOW GRANTS FOR mysqltest_u1@localhost;
--connection bug15166_u1_con
---echo
---echo ---> connection: bug15166_u1_con
use mysqltest_db1;
@@ -468,8 +420,6 @@ CREATE TRIGGER t1_trg_after_delete AFTER DELETE ON t1
# - check that UPDATE is required to modify the value;
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
@@ -480,8 +430,6 @@ GRANT UPDATE(col) ON mysqltest_db1.t3 TO mysqltest_u1@localhost;
GRANT UPDATE(col) ON mysqltest_db1.t4 TO mysqltest_u1@localhost;
--connection bug15166_u1_con
---echo
---echo ---> connection: bug15166_u1_con
use mysqltest_db1;
@@ -530,8 +478,6 @@ CREATE TRIGGER t4_trg_before_insert BEFORE INSERT ON t4
# - check that SELECT is not enough to modify the value;
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
@@ -546,8 +492,6 @@ GRANT SELECT(col) on mysqltest_db1.t3 TO mysqltest_u1@localhost;
GRANT SELECT(col) on mysqltest_db1.t4 TO mysqltest_u1@localhost;
--connection bug15166_u1_con
---echo
---echo ---> connection: bug15166_u1_con
use mysqltest_db1;
@@ -604,8 +548,6 @@ DROP TRIGGER t4_trg_err_2;
# - check that UPDATE is required to modify the value;
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
@@ -648,8 +590,6 @@ SELECT * FROM t4;
# - check that SELECT is not enough to modify the value;
--connection default
---echo
---echo ---> connection: default
use mysqltest_db1;
@@ -959,13 +899,10 @@ drop table if exists t1;
create table t1 (i int);
connect (flush,localhost,root,,test,,);
connection default;
---echo connection: default
lock tables t1 write;
connection flush;
---echo connection: flush
--send flush tables with read lock;
connection default;
---echo connection: default
let $wait_condition=
select count(*) = 1 from information_schema.processlist
where state = "Waiting for global read lock";
@@ -973,7 +910,6 @@ let $wait_condition=
create trigger t1_bi before insert on t1 for each row begin end;
unlock tables;
connection flush;
---echo connection: flush
--reap
unlock tables;
connection default;
diff --git a/mysql-test/t/truncate_coverage.test b/mysql-test/t/truncate_coverage.test
index 6f5c773ac6a..0834f7a3eca 100644
--- a/mysql-test/t/truncate_coverage.test
+++ b/mysql-test/t/truncate_coverage.test
@@ -27,16 +27,12 @@ INSERT INTO t1 VALUES (1);
# TRUNCATE shall block on this metadata lock.
# We can't use normal DML as such statements would also block LOCK TABLES.
#
---echo #
---echo # connection con1
--connect (con1, localhost, root,,)
HANDLER t1 OPEN;
#
# Get connection id of default connection.
# Lock the table and start TRUNCATE, which will block on MDL upgrade.
#
---echo #
---echo # connection default
--connection default
let $ID= `SELECT @id := CONNECTION_ID()`;
LOCK TABLE t1 WRITE;
@@ -47,27 +43,19 @@ send TRUNCATE TABLE t1;
# Kill the TRUNCATE query. This shall result in an error return
# from wait_while_table_is_used().
#
---echo #
---echo # connection con2
--connect (con2, localhost, root,,)
SET DEBUG_SYNC='now WAIT_FOR waiting';
let $invisible_assignment_in_select = `SELECT @id := $ID`;
KILL QUERY @id;
--disconnect con2
---echo #
---echo # connection default
--connection default
--error ER_QUERY_INTERRUPTED
reap;
UNLOCK TABLES;
---echo #
---echo # connection con1
--connection con1
--echo # Release shared metadata lock by closing HANDLER.
HANDLER t1 CLOSE;
--disconnect con1
---echo #
---echo # connection default
--connection default
DROP TABLE t1;
SET DEBUG_SYNC='RESET';
@@ -81,15 +69,11 @@ INSERT INTO t1 VALUES (1);
# TRUNCATE shall block on this metadata lock.
# We can't use normal DML as such statements would also block LOCK TABLES.
#
---echo #
---echo # connection con1
--connect (con1, localhost, root,,)
HANDLER t1 OPEN;
#
# Lock the table and start TRUNCATE, which will block on MDL upgrade.
#
---echo #
---echo # connection default
--connection default
LOCK TABLE t1 WRITE;
SET DEBUG_SYNC='mdl_upgrade_lock SIGNAL waiting';
@@ -98,19 +82,13 @@ send TRUNCATE TABLE t1;
# Remove datafile.
# Commit to let TRUNCATE continue.
#
---echo #
---echo # connection con2
--connect (con2, localhost, root,,)
SET DEBUG_SYNC='now WAIT_FOR waiting';
--remove_file $MYSQLD_DATADIR/test/t1.frm
--disconnect con2
---echo #
---echo # connection con1
--connection con1
HANDLER t1 CLOSE;
--disconnect con1
---echo #
---echo # connection default
--connection default
--error ER_NO_SUCH_TABLE
reap;
@@ -128,8 +106,6 @@ INSERT INTO t1 VALUES (1);
# Start a transaction and execute a DML in it. Since 5.4.4 this leaves
# a shared meta data lock (MDL) behind. TRUNCATE shall block on it.
#
---echo #
---echo # connection con1
--connect (con1, localhost, root,,)
START TRANSACTION;
INSERT INTO t1 VALUES (2);
@@ -137,8 +113,6 @@ INSERT INTO t1 VALUES (2);
# Get connection id of default connection.
# Start TRUNCATE, which will block on acquire_exclusive_locks().
#
---echo #
---echo # connection default
--connection default
let $ID= `SELECT @id := CONNECTION_ID()`;
SET DEBUG_SYNC='mdl_acquire_lock_wait SIGNAL waiting';
@@ -148,25 +122,17 @@ send TRUNCATE TABLE t1;
# Kill the TRUNCATE query. This shall result in an error return
# from wait_while_table_is_used().
#
---echo #
---echo # connection con1
--connection con1
SET DEBUG_SYNC='now WAIT_FOR waiting';
let $invisible_assignment_in_select = `SELECT @id := $ID`;
KILL QUERY @id;
---echo #
---echo # connection default
--connection default
--error ER_QUERY_INTERRUPTED
reap;
---echo #
---echo # connection con1
--connection con1
--echo # Release SW lock by committing transaction.
COMMIT;
--disconnect con1
---echo #
---echo # connection default
--connection default
UNLOCK TABLES;
DROP TABLE t1;
@@ -187,19 +153,16 @@ CREATE TABLE t1(a INT) engine=memory;
CREATE TABLE m1(a INT) engine=merge UNION(t1);
connect(con2, localhost, root);
---echo # Connection con1
connect(con1, localhost, root);
SET DEBUG_SYNC= 'open_tables_after_open_and_process_table SIGNAL opened WAIT_FOR dropped';
--echo # Sending:
--send TRUNCATE TABLE m1
---echo # Connection con2
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR opened';
--echo # Sending:
--send FLUSH TABLES
---echo # Connection default
connection default;
--echo # Waiting for FLUSH TABLES to be blocked.
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
@@ -207,7 +170,6 @@ let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist
--source include/wait_condition.inc
SET DEBUG_SYNC= 'now SIGNAL dropped';
---echo # Connection con1
connection con1;
--echo # Reaping: TRUNCATE TABLE m1
--error ER_WRONG_MRG_TABLE
@@ -215,14 +177,12 @@ connection con1;
disconnect con1;
--source include/wait_until_disconnected.inc
---echo # Connection con2
connection con2;
--echo # Reaping: FLUSH TABLES
--reap
disconnect con2;
--source include/wait_until_disconnected.inc
---echo # Connection default
connection default;
SET DEBUG_SYNC= 'RESET';
DROP TABLE m1, t1;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 8f29528ac25..4d97f380dff 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -562,7 +562,6 @@ select @@lc_time_names;
select @@global.lc_time_names, @@lc_time_names;
set @@global.lc_time_names=fr_FR;
select @@global.lc_time_names, @@lc_time_names;
---echo New connection
connect (con1,localhost,root,,);
connection con1;
select @@global.lc_time_names, @@lc_time_names;
@@ -570,7 +569,6 @@ set @@lc_time_names=ru_RU;
select @@global.lc_time_names, @@lc_time_names;
disconnect con1;
connection default;
---echo Returnung to default connection
select @@global.lc_time_names, @@lc_time_names;
set lc_time_names=default;
select @@global.lc_time_names, @@lc_time_names;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 83b7e5839ef..d11b7f0bc37 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -4643,7 +4643,6 @@ DROP PROCEDURE IF EXISTS p1;
connect (con2, localhost, root);
connect (con3, localhost, root);
---echo # Connection default
connection default;
CREATE VIEW v1 AS SELECT schema_name FROM information_schema.schemata;
@@ -4653,17 +4652,14 @@ CREATE PROCEDURE p1() INSERT INTO t1 SELECT * FROM v1;
--echo # CALL p1() so the view is merged.
CALL p1();
---echo # Connection 3
connection con3;
LOCK TABLE t1 READ;
---echo # Connection default
connection default;
--echo # Try to CALL p1() again, this time it should block for t1.
--echo # Sending:
--send CALL p1()
---echo # Connection 2
connection con2;
let $wait_condition=
SELECT COUNT(*) = 1 from information_schema.processlist
@@ -4674,7 +4670,6 @@ let $wait_condition=
--echo # Sending:
--send DROP VIEW v1
---echo # Connection 3
connection con3;
let $wait_condition=
SELECT COUNT(*) = 1 from information_schema.processlist
@@ -4683,17 +4678,14 @@ let $wait_condition=
--echo # Now allow CALL p1() to complete
UNLOCK TABLES;
---echo # Connection default
connection default;
--echo # Reaping: CALL p1()
--reap
---echo # Connection 2
connection con2;
--echo # Reaping: DROP VIEW v1
--reap
---echo # Connection default
connection default;
DROP PROCEDURE p1;
DROP TABLE t1;
diff --git a/mysql-test/t/view_grant.test b/mysql-test/t/view_grant.test
index 6d0cd8e5c28..a70241138aa 100644
--- a/mysql-test/t/view_grant.test
+++ b/mysql-test/t/view_grant.test
@@ -1197,8 +1197,6 @@ GRANT SELECT, DELETE ON mysqltest1.t4 TO mysqltest_u1@localhost;
GRANT ALL PRIVILEGES ON mysqltest2.* TO mysqltest_u1@localhost;
--connect (bug24040_con,localhost,mysqltest_u1,,mysqltest2)
---echo
---echo ---> connection: bug24040_con
SELECT * FROM mysqltest1.t1;
INSERT INTO mysqltest1.t2 VALUES(25);
@@ -1238,8 +1236,6 @@ CREATE VIEW v42 AS SELECT c4, c2 FROM mysqltest1.t4, mysqltest1.t2;
CREATE VIEW v43 AS SELECT c4, c3 FROM mysqltest1.t4, mysqltest1.t3;
--connection default
---echo
---echo ---> connection: default
SELECT * FROM mysqltest1.t1;
SELECT * FROM mysqltest1.t2;
@@ -1965,13 +1961,9 @@ GRANT SELECT ON t1 TO 'mysqluser1'@'%';
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser1'@'%';
---echo #
---echo # Connection 'mysqluser1'.
--connect (mysqluser1, localhost, mysqluser1,,mysqltest1)
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
---echo #
---echo # Connection 'default'.
--connection default
CREATE USER 'mysqluser2'@'%';
GRANT SELECT ON v2_uses_t1 TO 'mysqluser2'@'%';
@@ -1980,8 +1972,6 @@ GRANT SELECT ON t2 TO 'mysqluser2'@'%';
GRANT CREATE VIEW ON mysqltest1.* TO 'mysqluser2'@'%';
--echo # Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
---echo #
---echo # Connection 'mysqluser2'.
--connect (mysqluser2, localhost, mysqluser2,,mysqltest1)
--echo # The below statement should succeed thanks to suid nature of v2_uses_t1.
SELECT * FROM v2_uses_t1;
@@ -1990,8 +1980,6 @@ SELECT * FROM v2_uses_t1;
SELECT * FROM v2_uses_t2;
--echo #
--echo # 2) INVOKER-security view uses INVOKER-security view.
---echo #
---echo # Connection 'default'.
--connection default
DROP VIEW v2_uses_t1, v2_uses_t2;
CREATE SQL SECURITY INVOKER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
@@ -2000,15 +1988,11 @@ GRANT SELECT ON v2_uses_t1 TO 'mysqluser1'@'%';
GRANT SELECT ON v2_uses_t2 TO 'mysqluser1'@'%';
GRANT SELECT ON v1_uses_t1 TO 'mysqluser2'@'%';
GRANT SELECT ON v1_uses_t2 TO 'mysqluser2'@'%';
---echo #
---echo # Connection 'mysqluser1'.
--connection mysqluser1
--echo # For both versions of 'v2' 'mysqluser1' privileges should be used.
SELECT * FROM v2_uses_t1;
--error ER_VIEW_INVALID
SELECT * FROM v2_uses_t2;
---echo #
---echo # Connection 'mysqluser2'.
--connection mysqluser2
--echo # And now for both versions of 'v2' 'mysqluser2' privileges should
--echo # be used.
@@ -2017,24 +2001,16 @@ SELECT * FROM v2_uses_t1;
SELECT * FROM v2_uses_t2;
--echo #
--echo # 3) INVOKER-security view uses DEFINER-security view.
---echo #
---echo # Connection 'default'.
--connection default
DROP VIEW v1_uses_t1, v1_uses_t2;
--echo # To be able create 'v1_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
---echo #
---echo # Connection 'mysqluser1'.
--connection mysqluser1
CREATE SQL SECURITY DEFINER VIEW v1_uses_t1 AS SELECT * FROM t1;
CREATE SQL SECURITY DEFINER VIEW v1_uses_t2 AS SELECT * FROM t2;
---echo #
---echo # Connection 'default'.
--connection default
--echo # Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
---echo #
---echo # Connection 'mysqluser2'.
--connection mysqluser2
--echo # Due to suid nature of v1_uses_t1 and v1_uses_t2 the first
--echo # select should succeed and the second select should fail.
@@ -2043,24 +2019,16 @@ SELECT * FROM v2_uses_t1;
SELECT * FROM v2_uses_t2;
--echo #
--echo # 4) DEFINER-security view uses DEFINER-security view.
---echo #
---echo # Connection 'default'.
--connection default
DROP VIEW v2_uses_t1, v2_uses_t2;
--echo # To be able create 'v2_uses_t2' we also need select on t2.
GRANT SELECT ON t2 TO 'mysqluser1'@'%';
---echo #
---echo # Connection 'mysqluser2'.
--connection mysqluser2
CREATE SQL SECURITY DEFINER VIEW v2_uses_t1 AS SELECT * FROM v1_uses_t1;
CREATE SQL SECURITY DEFINER VIEW v2_uses_t2 AS SELECT * FROM v1_uses_t2;
---echo #
---echo # Connection 'default'.
--connection default
--echo # Make 'mysqluser1' unable to access t2.
REVOKE SELECT ON t2 FROM 'mysqluser1'@'%';
---echo #
---echo # Connection 'mysqluser2'.
--connection mysqluser2
--echo # Again privileges of creator of innermost views should apply.
SELECT * FROM v2_uses_t1;
@@ -2132,8 +2100,6 @@ create sql security invoker view v42 as
where t2.id = v2.id;
---echo #
---echo # Connect as user_11766767
connect (conn_11766767, localhost, user_11766767,,);
--echo #
@@ -2231,7 +2197,6 @@ update mysqltest1.t11 as t11, mysqltest2.v42 as v4 set v4.val= 'test20'
--echo #
--echo # Clean-up.
--echo #
---echo # Switching to connection 'default'.
disconnect conn_11766767;
connection default;
drop user user_11766767;
diff --git a/mysql-test/t/wait_timeout.test b/mysql-test/t/wait_timeout.test
index 68c0957347d..4ece5fd1749 100644
--- a/mysql-test/t/wait_timeout.test
+++ b/mysql-test/t/wait_timeout.test
@@ -19,14 +19,12 @@
let $start_value= `SELECT @@global.wait_timeout`;
SET @@global.wait_timeout= 2;
---echo disconnect default;
disconnect default;
# Connect with another connection and reset counters
---disable_query_log
connect (wait_con,localhost,root,,test,,);
---echo connection wait_con;
connection wait_con;
+--disable_query_log
SET SESSION wait_timeout=100;
let $retries=300;
SET @aborted_clients= 0;
@@ -34,16 +32,14 @@ SET @aborted_clients= 0;
# Disable reconnect and do the query
connect (default,localhost,root,,test,,);
---echo connection default;
connection default;
--echo --disable_reconnect;
--disable_reconnect
SELECT 1;
# Switch to wait_con and wait until server has aborted the connection
---disable_query_log
---echo connection wait_con;
connection wait_con;
+--disable_query_log
while (!`select @aborted_clients`)
{
real_sleep 0.1;
@@ -61,7 +57,6 @@ while (!`select @aborted_clients`)
# the disconnect has reached client
let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist;
--source include/wait_condition.inc
---echo connection default;
connection default;
# When the connection is closed in this way, the error code should
# be consistent see Bug#2845 for an explanation
@@ -73,7 +68,6 @@ SELECT 2;
SELECT 3;
# Disconnect so that we will not be confused by a future abort from this
# connection.
---echo disconnection default;
disconnect default;
#
@@ -81,24 +75,21 @@ disconnect default;
# (which we get by specifying an ip adress)
# Connect with another connection and reset counters
---disable_query_log
---echo connection wait_con;
connection wait_con;
+--disable_query_log
FLUSH STATUS; # Reset counters
let $retries=300;
SET @aborted_clients= 0;
--enable_query_log
---echo connection con1;
connect (con1,127.0.0.1,root,,test,$MASTER_MYPORT,);
--echo --disable_reconnect;
--disable_reconnect
SELECT 1;
# Switch to wait_con and wait until server has aborted the connection
---disable_query_log
---echo connection wait_con;
connection wait_con;
+--disable_query_log
while (!`select @aborted_clients`)
{
real_sleep 0.1;
@@ -118,7 +109,6 @@ let $wait_condition= SELECT COUNT(*)=1 FROM information_schema.processlist;
--source include/wait_condition.inc
disconnect wait_con;
---echo connection con1;
connection con1;
# When the connection is closed in this way, the error code should
# be consistent see Bug#2845 for an explanation
@@ -130,7 +120,6 @@ SELECT 2;
SELECT 3;
--replace_result $start_value <start_value>
eval SET @@global.wait_timeout= $start_value;
---echo disconnection con1;
disconnect con1;
diff --git a/mysql-test/t/xa.test b/mysql-test/t/xa.test
index 1709886eb0c..f1576f021ec 100644
--- a/mysql-test/t/xa.test
+++ b/mysql-test/t/xa.test
@@ -258,19 +258,16 @@ DROP TABLE IF EXISTS t1;
CREATE TABLE t1(a INT, b INT, PRIMARY KEY(a)) engine=InnoDB;
INSERT INTO t1 VALUES (1, 1), (2, 2);
---echo # Connection con1
connect (con1, localhost, root);
XA START 'a';
UPDATE t1 SET b= 3 WHERE a=1;
---echo # Connection default
connection default;
XA START 'b';
UPDATE t1 SET b=4 WHERE a=2;
--echo # Sending:
--send UPDATE t1 SET b=5 WHERE a=1
---echo # Connection con1
connection con1;
--sleep 1
--error ER_LOCK_DEADLOCK
@@ -279,7 +276,6 @@ UPDATE t1 SET b=6 WHERE a=2;
--error ER_XA_RBDEADLOCK
XA COMMIT 'a';
---echo # Connection default
connection default;
--echo # Reaping: UPDATE t1 SET b=5 WHERE a=1
--reap
@@ -343,13 +339,11 @@ CREATE TABLE t2 (a INT) ENGINE=InnoDB;
START TRANSACTION;
INSERT INTO t1 VALUES (1);
---echo # Connection con2
--connect (con2,localhost,root)
XA START 'xid1';
--echo # Sending:
--send INSERT INTO t2 SELECT a FROM t1
---echo # Connection default
--connection default
let $wait_condition=
SELECT COUNT(*) = 1 FROM information_schema.processlist
@@ -360,7 +354,6 @@ let $wait_condition=
--sleep 0.1
DELETE FROM t1;
---echo # Connection con2
--connection con2
--echo # Reaping: INSERT INTO t2 SELECT a FROM t1
--error ER_LOCK_DEADLOCK
@@ -368,12 +361,10 @@ DELETE FROM t1;
--error ER_XA_RBDEADLOCK
XA COMMIT 'xid1';
---echo # Connection default
connection default;
COMMIT;
---echo # Connection con2
connection con2;
# This caused the assert to be triggered
XA START 'xid1';
@@ -382,7 +373,6 @@ XA END 'xid1';
XA PREPARE 'xid1';
XA ROLLBACK 'xid1';
---echo # Connection default
connection default;
DROP TABLE t1, t2;
disconnect con2;
diff --git a/storage/connect/mysql-test/connect/r/grant.result b/storage/connect/mysql-test/connect/r/grant.result
index 4e64b983ea7..118d75408be 100644
--- a/storage/connect/mysql-test/connect/r/grant.result
+++ b/storage/connect/mysql-test/connect/r/grant.result
@@ -4,6 +4,8 @@ set sql_mode="";
#
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -14,6 +16,7 @@ ftype CHAR(4) NOT NULL,
size DOUBLE(12,0) NOT NULL flag=5
) ENGINE=CONNECT TABLE_TYPE=DIR FILE_NAME='*.*';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -26,6 +29,7 @@ size DOUBLE(12,0) NOT NULL flag=5
SELECT fname, ftype, size FROM t1 WHERE size>0;
fname ftype size
t1 .frm 1081
+connection user;
SELECT user();
user()
user@localhost
@@ -44,10 +48,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -59,6 +65,8 @@ UPDATE v1 SET path=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+disconnect user;
+connection default;
SELECT user();
user()
root@localhost
@@ -74,6 +82,8 @@ DROP USER user@localhost;
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -102,11 +112,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=BIN FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
@@ -129,10 +141,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -144,6 +158,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -153,12 +168,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=BIN;
Warnings:
Warning 1105 No file name. Table will use t1.bin
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
+disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
@@ -169,6 +187,8 @@ DROP USER user@localhost;
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -197,11 +217,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
@@ -224,10 +246,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -239,6 +263,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -248,12 +273,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=CSV;
Warnings:
Warning 1105 No file name. Table will use t1.csv
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
+disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
@@ -264,6 +292,8 @@ DROP USER user@localhost;
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -292,11 +322,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
@@ -319,10 +351,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -334,6 +368,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -343,12 +378,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=DBF;
Warnings:
Warning 1105 No file name. Table will use t1.dbf
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
+disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
@@ -359,6 +397,8 @@ DROP USER user@localhost;
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -387,11 +427,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
@@ -414,10 +456,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -429,6 +473,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -438,12 +483,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=FIX;
Warnings:
Warning 1105 No file name. Table will use t1.fix
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
+disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
@@ -454,6 +502,8 @@ DROP USER user@localhost;
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -482,11 +532,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=VEC MAX_ROWS=100 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=VEC MAX_ROWS=100 FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
@@ -509,10 +561,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -524,6 +578,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -533,12 +588,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=VEC MAX_ROWS=100;
Warnings:
Warning 1105 No file name. Table will use t1.vec
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
+disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
diff --git a/storage/connect/mysql-test/connect/r/grant2.result b/storage/connect/mysql-test/connect/r/grant2.result
index 0259dd74cdc..73e41f49256 100644
--- a/storage/connect/mysql-test/connect/r/grant2.result
+++ b/storage/connect/mysql-test/connect/r/grant2.result
@@ -5,6 +5,7 @@ CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
# Testing SQLCOM_SELECT
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -21,6 +22,7 @@ a
10
SELECT * FROM v1_baddefiner;
ERROR 28000: Access denied for user 'root'@'localhost' (using password: NO)
+connect user,localhost,user,,;
SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
SELECT * FROM v1_invoker;
@@ -28,9 +30,11 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
SELECT * FROM v1_definer;
a
10
+connection default;
DROP VIEW v1_invoker, v1_definer, v1_baddefiner;
DROP TABLE t1;
# Testing SQLCOM_UPDATE
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -38,14 +42,17 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
UPDATE t1 SET a=11;
UPDATE v1_invoker SET a=12;
UPDATE v1_definer SET a=13;
+connection user;
UPDATE t1 SET a=21;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
UPDATE v1_invoker SET a=22;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
UPDATE v1_definer SET a=23;
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_INSERT
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -53,14 +60,17 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
INSERT INTO t1 VALUES (11);
INSERT INTO v1_invoker VALUES (12);
INSERT INTO v1_definer VALUES (13);
+connection user;
INSERT INTO t1 VALUES (21);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
INSERT INTO v1_invoker VALUES (22);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
INSERT INTO v1_definer VALUES (23);
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_REPLACE
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -71,15 +81,18 @@ REPLACE INTO v1_invoker VALUES (12);
ERROR 42000: CONNECT Unsupported command
REPLACE INTO v1_definer VALUES (13);
ERROR 42000: CONNECT Unsupported command
+connection user;
REPLACE INTO t1 VALUES (21);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
REPLACE INTO v1_invoker VALUES (22);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
REPLACE INTO v1_definer VALUES (23);
ERROR 42000: CONNECT Unsupported command
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_DELETE
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10),(11),(12),(13),(21),(22),(23);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -87,14 +100,17 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
DELETE FROM t1 WHERE a=11;
DELETE FROM v1_invoker WHERE a=12;
DELETE FROM v1_definer WHERE a=13;
+connection user;
DELETE FROM t1 WHERE a=21;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1_invoker WHERE a=22;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1_definer WHERE a=23;
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_LOAD
+connection default;
CREATE TABLE t1 (a VARCHAR(128)) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -102,29 +118,38 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE t1;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer;
+connection user;
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_invoker;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
LOAD DATA LOCAL INFILE 'MTR_SUITE_DIR/std_data/boys.txt' INTO TABLE v1_definer;
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_TRUNCATE
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
TRUNCATE TABLE t1;
INSERT INTO t1 VALUES (11);
+connection user;
TRUNCATE TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_DROP_TABLE
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
+connection user;
DROP TABLE t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_DROP_VIEW
# DROP VIEW does not need FILE_ACL.
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10),(11),(12),(13),(21),(22),(23);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -132,13 +157,18 @@ CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
DROP VIEW v1_invoker, v1_definer;
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
CREATE SQL SECURITY DEFINER VIEW v1_definer AS SELECT * FROM t1;
+connection user;
DROP VIEW v1_invoker;
DROP VIEW v1_definer;
+connection default;
DROP TABLE t1;
# Testing SQLCOM_CREATE_TABLE
+connection user;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
# Testing SQLCOM_LOCK_TABLES
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -155,6 +185,7 @@ LOCK TABLE v1_definer READ;
UNLOCK TABLES;
LOCK TABLE v1_definer WRITE;
UNLOCK TABLES;
+connection user;
LOCK TABLE t1 READ;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
LOCK TABLE t1 WRITE;
@@ -167,9 +198,11 @@ LOCK TABLE v1_definer READ;
UNLOCK TABLES;
LOCK TABLE v1_definer WRITE;
UNLOCK TABLES;
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_UPDATE_MULTI
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
CREATE TABLE t2 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t2.fix';
CREATE TABLE t3 (a INT);
@@ -229,6 +262,7 @@ UPDATE v2_definer a1,v1_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
+connection user;
UPDATE t1 a1,t1 a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
UPDATE t1 a1,t2 a2 SET a1.a=50 WHERE a1.a=a2.a;
@@ -318,9 +352,11 @@ UPDATE v2_definer a1,v1_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
UPDATE v2_definer a1,v2_invoker a2 SET a1.a=50 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
UPDATE v2_definer a1,v2_definer a2 SET a1.a=50 WHERE a1.a=a2.a;
+connection default;
DROP VIEW v1_invoker, v1_definer, v2_invoker, v2_definer;
DROP TABLE t1, t2, t3;
# Testing SQLCOM_DELETE_MULTI
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
CREATE TABLE t2 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t2.fix';
CREATE TABLE t3 (a INT);
@@ -380,6 +416,7 @@ DELETE a1 FROM v2_definer a1,v1_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
+connection user;
DELETE a1 FROM t1 a1,t1 a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE a1 FROM t1 a1,t2 a2 WHERE a1.a=a2.a;
@@ -469,9 +506,11 @@ DELETE a1 FROM v2_definer a1,v1_definer a2 WHERE a1.a=a2.a;
DELETE a1 FROM v2_definer a1,v2_invoker a2 WHERE a1.a=a2.a;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE a1 FROM v2_definer a1,v2_definer a2 WHERE a1.a=a2.a;
+connection default;
DROP VIEW v1_invoker, v1_definer, v2_invoker, v2_definer;
DROP TABLE t1, t2, t3;
# Testing SQLCOM_CREATE_VIEW
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -480,15 +519,18 @@ CREATE VIEW v2 AS SELECT * FROM v1_invoker;
DROP VIEW v2;
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
+connection user;
CREATE VIEW v2 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v2 AS SELECT * FROM v1_invoker;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v2 AS SELECT * FROM v1_definer;
DROP VIEW v2;
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_INSERT_SELECT
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -502,6 +544,7 @@ INSERT INTO v1_invoker SELECT * FROM v1_definer WHERE a=20;
INSERT INTO v1_definer SELECT * FROM t1 WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
+connection user;
INSERT INTO t1 SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
INSERT INTO t1 SELECT * FROM v1_invoker WHERE a=20;
@@ -519,9 +562,11 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
INSERT INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
INSERT INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_REPLACE_SELECT
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
CREATE SQL SECURITY INVOKER VIEW v1_invoker AS SELECT * FROM t1;
@@ -544,6 +589,7 @@ REPLACE INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
ERROR 42000: CONNECT Unsupported command
REPLACE INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
ERROR 42000: CONNECT Unsupported command
+connection user;
REPLACE INTO t1 SELECT * FROM t1 WHERE a=20;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
REPLACE INTO t1 SELECT * FROM v1_invoker WHERE a=20;
@@ -562,9 +608,11 @@ REPLACE INTO v1_definer SELECT * FROM v1_invoker WHERE a=20;
ERROR 42000: CONNECT Unsupported command
REPLACE INTO v1_definer SELECT * FROM v1_definer WHERE a=20;
ERROR 42000: CONNECT Unsupported command
+connection default;
DROP VIEW v1_invoker, v1_definer;
DROP TABLE t1;
# Testing SQLCOM_RENAME_TABLE
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
RENAME TABLE t1 TO t2;
@@ -574,10 +622,13 @@ t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=fix `FILE_NAME`='t1.fix'
RENAME TABLE t2 TO t1;
+connection user;
RENAME TABLE t1 TO t2;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (for ALTER..RENAME)
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
ALTER TABLE t1 RENAME TO t2;
@@ -587,20 +638,26 @@ t2 CREATE TABLE `t2` (
`a` int(11) DEFAULT NULL
) ENGINE=CONNECT DEFAULT CHARSET=latin1 `TABLE_TYPE`=fix `FILE_NAME`='t1.fix'
ALTER TABLE t2 RENAME TO t1;
+connection user;
ALTER TABLE t1 RENAME TO t2;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (changing ENGINE to non-CONNECT)
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
ALTER TABLE t1 ENGINE=MyISAM;
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
+connection user;
ALTER TABLE t1 ENGINE=MyISAM;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (changing ENGINE to CONNECT)
+connection default;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (10);
SELECT * FROM t1;
@@ -610,63 +667,83 @@ ALTER TABLE t1 ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=MyISAM;
INSERT INTO t1 VALUES (10);
+connection user;
ALTER TABLE t1 ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_OPTIMIZE
+connection default;
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
+connection user;
OPTIMIZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 optimize Error Access denied for user 'user'@'localhost' (using password: NO)
test.t1 optimize Error Got error 122 'This operation requires the FILE privilege' from CONNECT
test.t1 optimize error Corrupt
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (adding columns)
+connection default;
CREATE TABLE t1 (a INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10);
ALTER TABLE t1 ADD b INT;
Warnings:
Warning 1105 This is an outward table, table data were not modified.
+connection user;
ALTER TABLE t1 ADD c INT;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (removing columns)
+connection default;
CREATE TABLE t1 (a INT,b INT,c INT) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10,10,10);
ALTER TABLE t1 DROP b;
Warnings:
Warning 1105 This is an outward table, table data were not modified.
+connection user;
ALTER TABLE t1 DROP c;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (adding keys)
+connection default;
CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 ADD KEY(a);
+connection user;
ALTER TABLE t1 ADD KEY(b);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_ALTER_TABLE (removing keys)
+connection default;
CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL, KEY a(a), KEY b(b)) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10,10);
ALTER TABLE t1 DROP KEY a;
+connection user;
ALTER TABLE t1 DROP KEY b;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing SQLCOM_CREATE_INDEX and SQLCOM_DROP_INDEX
+connection default;
CREATE TABLE t1 (a INT NOT NULL,b INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=fix FILE_NAME='t1.fix';
INSERT INTO t1 VALUES (10,10);
CREATE INDEX a ON t1 (a);
DROP INDEX a ON t1;
CREATE INDEX a ON t1 (a);
+connection user;
CREATE INDEX b ON t1 (b);
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DROP INDEX a ON t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
# Testing stored procedures
CREATE PROCEDURE p_definer() SQL SECURITY DEFINER
@@ -681,9 +758,11 @@ CALL p_invoker();
DROP TABLE t1;
CALL p_baddefiner();
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection user;
CALL p_invoker();
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CALL p_definer();
+connection default;
DROP TABLE t1;
DROP PROCEDURE p_definer;
DROP PROCEDURE p_invoker;
diff --git a/storage/connect/mysql-test/connect/r/ini_grant.result b/storage/connect/mysql-test/connect/r/ini_grant.result
index 68330278183..8cbf88123fb 100644
--- a/storage/connect/mysql-test/connect/r/ini_grant.result
+++ b/storage/connect/mysql-test/connect/r/ini_grant.result
@@ -5,6 +5,8 @@ set sql_mode="";
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
set sql_mode=default;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -33,11 +35,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (sec CHAR(10) NOT NULL FLAG=1, val CHAR(10) NOT NULL) ENGINE=CONNECT TABLE_TYPE=INI FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES ('sec1','val1');
+connection user;
SELECT user();
user()
user@localhost
@@ -58,10 +62,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -73,6 +79,8 @@ UPDATE v1 SET val='val11';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+disconnect user;
+connection default;
DROP VIEW v1;
DROP TABLE t1;
DROP USER user@localhost;
diff --git a/storage/connect/mysql-test/connect/r/mysql_discovery.result b/storage/connect/mysql-test/connect/r/mysql_discovery.result
index 4580c68558f..220df6f7b92 100644
--- a/storage/connect/mysql-test/connect/r/mysql_discovery.result
+++ b/storage/connect/mysql-test/connect/r/mysql_discovery.result
@@ -1,5 +1,10 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE connect;
+connection slave;
CREATE DATABASE connect;
+connection slave;
CREATE TABLE t1 (
`id` int(20) primary key,
`group` int NOT NULL default 1,
@@ -7,6 +12,7 @@ CREATE TABLE t1 (
`a\\` int unsigned,
`name` varchar(32) default 'name')
DEFAULT CHARSET=latin1;
+connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
SHOW CREATE TABLE t1;
@@ -25,12 +31,15 @@ id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
+connection slave;
SELECT * FROM t1;
id group a\\b a\\ name
1 1 2 NULL foo
2 1 2 NULL fee
DROP TABLE t1;
+connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
+connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
diff --git a/storage/connect/mysql-test/connect/r/mysql_exec.result b/storage/connect/mysql-test/connect/r/mysql_exec.result
index 778577a1d8a..b6606ab5978 100644
--- a/storage/connect/mysql-test/connect/r/mysql_exec.result
+++ b/storage/connect/mysql-test/connect/r/mysql_exec.result
@@ -1,8 +1,13 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE connect;
+connection slave;
CREATE DATABASE connect;
#
# Checking Sending Commands
#
+connection master;
CREATE TABLE t1 (
command VARCHAR(128) NOT NULL,
warnings INT(4) NOT NULL FLAG=3,
@@ -48,6 +53,7 @@ command warnings number message
update t1 set msg = "Five" where id = 5 0 1 Affected rows
DROP PROCEDURE p1;
DROP TABLE t1;
+connection slave;
SELECT * FROM t1;
id msg
1 One
@@ -56,7 +62,9 @@ id msg
4 Four
5 Five
DROP TABLE t1;
+connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
+connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
diff --git a/storage/connect/mysql-test/connect/r/mysql_grant.result b/storage/connect/mysql-test/connect/r/mysql_grant.result
index 5f630834392..11a3dbba36c 100644
--- a/storage/connect/mysql-test/connect/r/mysql_grant.result
+++ b/storage/connect/mysql-test/connect/r/mysql_grant.result
@@ -5,11 +5,14 @@ set sql_mode="";
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
set sql_mode=default;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=MySQL OPTION_LIST='host=localhost,user=root1,port=PORT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -21,6 +24,7 @@ a
10
20
30
+connection user;
SELECT user();
user()
user@localhost
@@ -39,10 +43,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -54,6 +60,8 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+disconnect user;
+connection default;
SELECT user();
user()
root@localhost
diff --git a/storage/connect/mysql-test/connect/r/mysql_new.result b/storage/connect/mysql-test/connect/r/mysql_new.result
index 309d69abe7e..05071ef7be6 100644
--- a/storage/connect/mysql-test/connect/r/mysql_new.result
+++ b/storage/connect/mysql-test/connect/r/mysql_new.result
@@ -1,5 +1,10 @@
+connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
+connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
+connection master;
CREATE DATABASE connect;
+connection slave;
CREATE DATABASE connect;
+connection slave;
CREATE TABLE t1 (a int, b char(10));
INSERT INTO t1 VALUES (NULL,NULL),(0,'test00'),(1,'test01'),(2,'test02'),(3,'test03');
SELECT * FROM t1;
@@ -12,6 +17,7 @@ NULL NULL
#
# Testing errors
#
+connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://unknown@127.0.0.1:SLAVE_PORT/test/t1';
ERROR HY000: (1045) Access denied for user 'unknown'@'localhost' (using password: NO)
@@ -39,10 +45,14 @@ ERROR HY000: Got error 174 '(1054) Unknown column 'x' in 'field list' [SELECT `x
DROP TABLE t1;
CREATE TABLE t1 (a int, b char(10)) ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
+connection slave;
ALTER TABLE t1 RENAME t1backup;
+connection master;
SELECT * FROM t1;
ERROR HY000: Got error 174 '(1146) Table 'test.t1' doesn't exist [SELECT `a`, `b` FROM `t1`]' from CONNECT
+connection slave;
ALTER TABLE t1backup RENAME t1;
+connection master;
DROP TABLE t1;
#
# Testing SELECT, etc.
@@ -111,6 +121,7 @@ NULL NULL
2 0
3 0
DROP TABLE t1;
+connection slave;
DROP TABLE t1;
#
# Testing numeric data types
@@ -129,6 +140,7 @@ t1 CREATE TABLE `t1` (
`h` decimal(20,5) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES(100,3333,41235,1234567890,235000000000,3.14159265,3.14159265,3141.59265);
+connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
OPTION_LIST='host=127.0.0.1,user=root,port=SLAVE_PORT';
SHOW CREATE TABLE t1;
@@ -147,6 +159,7 @@ SELECT * FROM t1;
a b c d e f g h
100 3333 41235 1234567890 235000000000 3.14159 3.14159265 3141.59265
DROP TABLE t1;
+connection slave;
DROP TABLE t1;
#
# Testing character data types
@@ -162,6 +175,7 @@ INSERT INTO t1 VALUES('Welcome','Hello, World');
SELECT * FROM t1;
a b
Welcome Hello, World
+connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT';
SHOW CREATE TABLE t1;
@@ -174,6 +188,7 @@ SELECT * FROM t1;
a b
Welcome Hello, World
DROP TABLE t1;
+connection slave;
DROP TABLE t1;
#
# Testing temporal data types
@@ -196,6 +211,7 @@ Warning 1265 Data truncated for column 'e' at row 1
SELECT * FROM t1;
a b c d e
2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 2003
+connection master;
CREATE TABLE t1 ENGINE=CONNECT TABLE_TYPE=MYSQL
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT';
SHOW CREATE TABLE t1;
@@ -211,8 +227,11 @@ SELECT * FROM t1;
a b c d e
2003-05-27 2003-05-27 10:45:23 10:45:23 2003-05-27 10:45:23 2003
DROP TABLE t1;
+connection slave;
DROP TABLE t1;
+connection master;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
+connection slave;
DROP TABLE IF EXISTS connect.t1;
DROP DATABASE IF EXISTS connect;
diff --git a/storage/connect/mysql-test/connect/r/xml_grant.result b/storage/connect/mysql-test/connect/r/xml_grant.result
index 9eb818bf32f..817d3f5bf57 100644
--- a/storage/connect/mysql-test/connect/r/xml_grant.result
+++ b/storage/connect/mysql-test/connect/r/xml_grant.result
@@ -6,6 +6,8 @@ Warning 1105 No file name. Table will use t1.xml
CREATE USER user@localhost;
GRANT ALL PRIVILEGES ON *.* TO user@localhost;
REVOKE FILE ON *.* FROM user@localhost;
+connect user,localhost,user,,;
+connection user;
SELECT user();
user()
user@localhost
@@ -34,11 +36,13 @@ DROP VIEW v1;
DROP TABLE t1;
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmlsup=libxml2,rownode=row' FILE_NAME='t1.EXT';
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
@@ -61,10 +65,12 @@ ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
CREATE VIEW v1 AS SELECT * FROM t1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
# Testing a VIEW created with FILE privileges but accessed with no FILE
+connection default;
SELECT user();
user()
root@localhost
CREATE SQL SECURITY INVOKER VIEW v1 AS SELECT * FROM t1;
+connection user;
SELECT user();
user()
user@localhost
@@ -76,6 +82,7 @@ UPDATE v1 SET a=123;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
DELETE FROM v1;
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
SELECT user();
user()
root@localhost
@@ -85,12 +92,15 @@ CREATE TABLE t1 (a INT NOT NULL) ENGINE=CONNECT TABLE_TYPE=XML OPTION_LIST='xmls
Warnings:
Warning 1105 No file name. Table will use t1.xml
INSERT INTO t1 VALUES (10);
+connection user;
SELECT user();
user()
user@localhost
ALTER TABLE t1 FILE_NAME='t1.EXT';
ERROR 28000: Access denied for user 'user'@'localhost' (using password: NO)
+connection default;
DROP TABLE t1;
+disconnect user;
DROP USER user@localhost;
#
# End of grant.inc
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result
index c09ec340ccb..412ae455898 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_after_insert_multithread.result
@@ -6,7 +6,11 @@ FULLTEXT INDEX ft(title)
);
INSERT INTO diaries VALUES("Hello mroonga!");
INSERT INTO diaries VALUES("It's funny.");
+CONNECT thread2, localhost, root, ,;
+connection thread2;
INSERT INTO diaries VALUES("Happy birthday!");
+disconnect thread2;
+connection default;
SHOW STATUS LIKE 'mroonga_count_skip';
Variable_name Value
Mroonga_count_skip 0
diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result
index 0181fe02d84..9968abaf18c 100644
--- a/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result
+++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_max_n_records_for_estimate_global.result
@@ -13,8 +13,12 @@ INSERT INTO ids VALUES (8);
INSERT INTO ids VALUES (9);
INSERT INTO ids VALUES (10);
SET GLOBAL mroonga_max_n_records_for_estimate = 1;
+CONNECT new_connection, localhost, root, ,;
+connection new_connection;
EXPLAIN SELECT * FROM ids WHERE id > 5;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE ids range PRIMARY PRIMARY 4 NULL 1 Using where; Using index
+connection default;
+disconnect new_connection;
SET GLOBAL mroonga_max_n_records_for_estimate = DEFAULT;
DROP TABLE ids;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result
index 3da64b2de1f..590abf0a989 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/fulltext_order_transaction.result
@@ -27,12 +27,15 @@ id title body
1 survey will start groonga!
2 groonga (1) starting groonga...
3 groonga (2) started groonga.
+CONNECT search_connection, localhost, root;
USE test;
SELECT * FROM diaries
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
id title body
+connection default;
COMMIT;
+connection search_connection;
SELECT * FROM diaries
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
@@ -40,6 +43,8 @@ id title body
1 survey will start groonga!
2 groonga (1) starting groonga...
3 groonga (2) started groonga.
+disconnect search_connection;
+connection default;
SELECT * FROM diaries
WHERE MATCH(body) AGAINST("groonga")
ORDER BY id;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result
index 54afac7a1a7..61fbe239a35 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/transaction_query_cache.result
@@ -11,18 +11,23 @@ simple_table CREATE TABLE `simple_table` (
PRIMARY KEY (`id`)
) ENGINE=Mroonga DEFAULT CHARSET=utf8 COMMENT='ENGINE "InnoDB"'
INSERT INTO simple_table (id) VALUES (1),(2);
+CONNECT second_connection, localhost, root;
USE test;
START TRANSACTION;
INSERT INTO simple_table (id) VALUES (3);
+connection default;
SELECT * FROM simple_table;
id
1
2
+connection second_connection;
COMMIT;
+connection default;
SELECT * FROM simple_table;
id
1
2
3
DROP TABLE simple_table;
+disconnect second_connection;
SET GLOBAL query_cache_size = @tmp_query_cache_size;
diff --git a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result
index c98847cb50a..d66c0c025e5 100644
--- a/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result
+++ b/storage/mroonga/mysql-test/mroonga/wrapper/r/variable_match_escalation_threshold_global.result
@@ -20,8 +20,11 @@ SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
id title tags
1 Hello groonga! groonga install
SET GLOBAL mroonga_match_escalation_threshold = -1;
+CONNECT search_connection, localhost, root;
USE test;
SELECT * FROM diaries WHERE MATCH (tags) AGAINST ("gr" IN BOOLEAN MODE);
id title tags
+disconnect search_connection;
+connection default;
SET GLOBAL mroonga_match_escalation_threshold = DEFAULT;
DROP TABLE diaries;
diff --git a/storage/oqgraph/mysql-test/oqgraph/connections_mdev5748.result b/storage/oqgraph/mysql-test/oqgraph/connections_mdev5748.result
index 3d9c13bd733..3b71112df90 100644
--- a/storage/oqgraph/mysql-test/oqgraph/connections_mdev5748.result
+++ b/storage/oqgraph/mysql-test/oqgraph/connections_mdev5748.result
@@ -1,3 +1,4 @@
+connect con1,localhost,root,,;
CREATE TABLE oq_backing (
origid INT UNSIGNED NOT NULL,
destid INT UNSIGNED NOT NULL,
@@ -25,6 +26,8 @@ destid bigint(20) unsigned YES NULL
weight double YES NULL
seq bigint(20) unsigned YES NULL
linkid bigint(20) unsigned YES NULL
+disconnect con1;
+connection default;
show tables;
Tables_in_test
oq_backing
diff --git a/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result b/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result
index 42c86405503..96b9380fcc5 100644
--- a/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result
+++ b/storage/oqgraph/mysql-test/oqgraph/regression_mdev6282.result
@@ -1,3 +1,4 @@
+connect con1,localhost,root,,test;
CREATE TABLE `db_history` (
`version` VARCHAR(10) NOT NULL,
`updateJSON` MEDIUMTEXT,
@@ -28,10 +29,15 @@ FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` =
WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1;
version nodeID
0.0.3 3
+disconnect con1;
+connect con2,localhost,root,,test;
SELECT `db`.`version`, `db`.`nodeID`
FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid`
WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1;
version nodeID
0.0.3 3
+disconnect con2;
+connect con3,localhost,root,,test;
DROP TABLE db_history;
DROP TABLE version_history;
+disconnect con3;
diff --git a/storage/spider/mysql-test/spider/bg/r/basic_sql.result b/storage/spider/mysql-test/spider/bg/r/basic_sql.result
index 1e9fe78acea..94a09fc317b 100644
--- a/storage/spider/mysql-test/spider/bg/r/basic_sql.result
+++ b/storage/spider/mysql-test/spider/bg/r/basic_sql.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table select test
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -43,6 +48,7 @@ CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -52,6 +58,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
create table ignore select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
@@ -76,6 +83,7 @@ Warning 1062 Duplicate entry '2' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
Warning 1062 Duplicate entry '4' for key 'PRIMARY'
Warning 1062 Duplicate entry '5' for key 'PRIMARY'
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -85,11 +93,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
create table ignore select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
REPLACE SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -99,10 +109,12 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
create no index table
+connection master_1;
DROP TABLE IF EXISTS ta_l_no_idx;
CREATE TABLE ta_l_no_idx
MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -112,6 +124,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -121,6 +134,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table shared mode
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a
LOCK IN SHARE MODE;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -131,6 +145,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table for update
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a
FOR UPDATE;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -141,6 +156,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table join
+connection master_1;
SELECT a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b
WHERE a.a = b.a ORDER BY a.a;
a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
@@ -151,6 +167,7 @@ a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table straight_join
+connection master_1;
SELECT STRAIGHT_JOIN a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s')
FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a;
a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
@@ -161,6 +178,7 @@ a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_small_result
+connection master_1;
SELECT SQL_SMALL_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -171,6 +189,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_big_result
+connection master_1;
SELECT SQL_BIG_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -181,6 +200,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_buffer_result
+connection master_1;
SELECT SQL_BUFFER_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -191,6 +211,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_cache
+connection master_1;
SELECT SQL_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -201,6 +222,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_no_cache
+connection master_1;
SELECT SQL_NO_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -211,6 +233,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_calc_found_rows
+connection master_1;
SELECT SQL_CALC_FOUND_ROWS a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a LIMIT 4;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -218,11 +241,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
3 j 2007-05-04 20:03:11
4 i 2003-10-30 05:01:03
+connection master_1;
SELECT found_rows();
found_rows()
5
select high_priority
+connection master_1;
SELECT HIGH_PRIORITY a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -233,6 +258,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select distinct
+connection master_1;
SELECT DISTINCT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -243,11 +269,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select count
+connection master_1;
SELECT count(*) FROM ta_l ORDER BY a;
count(*)
5
select table join not use index
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM tb_l a WHERE
EXISTS (SELECT * FROM ta_l b WHERE b.b = a.b) ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
@@ -258,27 +286,35 @@ a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select using pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE
a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
select using index and pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE
a.a > 0 AND a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
insert
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert select
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -288,61 +324,82 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
insert select a
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1),
'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
insert low_priority
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT LOW_PRIORITY INTO ta_l (a, b, c) values (2, 'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert high_priority
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT HIGH_PRIORITY INTO ta_l (a, b, c) VALUES (2, 'e',
'2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert ignore
+connection master_1;
INSERT IGNORE INTO ta_l (a, b, c) VALUES (2, 'd', '2009-02-02 01:01:01');
Warnings:
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert update (insert)
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE
KEY UPDATE b = 'f', c = '2005-08-08 11:11:11';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert update (update)
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE
KEY UPDATE b = 'f', c = '2005-08-08 11:11:11';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 f 2005-08-08 11:11:11
replace
+connection master_1;
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59');
+connection master_1;
REPLACE INTO ta_l (a, b, c) VALUES (2, 'f', '2008-02-02 02:02:02');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 f 2008-02-02 02:02:02
replace select
+connection master_1;
REPLACE INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -352,8 +409,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
replace select a
+connection master_1;
REPLACE INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1),
'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -363,8 +422,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
replace low_priority
+connection master_1;
REPLACE LOW_PRIORITY INTO ta_l (a, b, c) VALUES (3, 'g',
'2009-03-03 03:03:03');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -377,66 +438,84 @@ update
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59');
+connection master_1;
UPDATE ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
2 f 2008-02-02 02:02:02
update select
+connection master_1;
UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a IN (SELECT a FROM
tb_l);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
update select a
+connection master_1;
UPDATE ta_l SET b = 'h', c = '2010-04-04 04:04:04' WHERE a = (SELECT a FROM
tb_l ORDER BY a LIMIT 1);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 h 2010-04-04 04:04:04
2 g 2009-03-03 03:03:03
update join
+connection master_1;
UPDATE ta_l a, tb_l b SET a.b = b.b, a.c = b.c WHERE a.a = b.a;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
2 g 2000-02-01 00:00:00
update join a
+connection master_1;
UPDATE ta_l a, tb_l b SET a.b = 'g', a.c = '2009-03-03 03:03:03' WHERE
a.a = b.a;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
update low_priority
+connection master_1;
UPDATE LOW_PRIORITY ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 f 2008-02-02 02:02:02
update ignore
+connection master_1;
UPDATE IGNORE ta_l SET a = 1, b = 'g', c = '2009-03-03 03:03:03' WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 f 2008-02-02 02:02:02
update pushdown
+connection master_1;
update ta_l set b = 'j', c = '2009-03-03 03:03:03' where b = 'f';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 j 2009-03-03 03:03:03
update index pushdown
+connection master_1;
UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'j';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
@@ -450,7 +529,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -464,7 +545,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
10 j 2008-01-01 23:59:59
delete all
+connection master_1;
DELETE FROM ta_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -476,7 +559,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a IN (SELECT a FROM tb_l);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2008-01-01 23:59:59
@@ -493,7 +578,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
@@ -514,7 +601,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE a FROM ta_l a, (SELECT a FROM tb_l ORDER BY a) b WHERE a.a = b.a;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2008-01-01 23:59:59
@@ -531,7 +620,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE LOW_PRIORITY FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -552,7 +643,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE IGNORE FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -573,7 +666,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE QUICK FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -594,7 +689,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE b = 'e';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
10 j 2008-01-01 23:59:59
@@ -607,19 +704,26 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a > 0 AND b = 'e';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
10 j 2008-01-01 23:59:59
truncate
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result b/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result
index 9e1201c17c9..0f4029404a7 100644
--- a/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/basic_sql_part.result
@@ -9,20 +9,25 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -38,10 +43,12 @@ INSERT INTO tb_l (a, b, c) VALUES
(5, 'h', '2001-10-31 23:59:59');
create table with partition and select test
+connection master_1;
CREATE TABLE ta_l2 (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1
SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -51,19 +58,23 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select partition using pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE
a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
select partition using index pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE
a.a > 0 AND a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
update partition pushdown
+connection master_1;
UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -73,7 +84,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
update partition index pushdown
+connection master_1;
UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -85,7 +98,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
delete partition pushdown
TRUNCATE TABLE ta_l2;
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+connection master_1;
DELETE FROM ta_l2 WHERE b = 'g';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -96,7 +111,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
delete partition index pushdown
TRUNCATE TABLE ta_l2;
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+connection master_1;
DELETE FROM ta_l2 WHERE a > 0 AND b = 'g';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -105,8 +122,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result
index 3a9c7be3076..9a8660ba79e 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -40,6 +45,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
direct_aggregating test
+connection master_1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
@@ -75,8 +81,11 @@ Variable_name Value
Spider_direct_aggregate 0
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result
index bbdc943601b..760b39e16d5 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_aggregate_part.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
with partition test
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -66,8 +71,11 @@ Variable_name Value
Spider_direct_aggregate 0
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update.result b/storage/spider/mysql-test/spider/bg/r/direct_update.result
index 517491253e9..74dae7aec2e 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_update.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_update.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -40,6 +45,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
direct_updating test
+connection master_1;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
@@ -122,8 +128,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-12-01 05:01:03
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result
index bd8f1b89f69..6db7c01f563 100644
--- a/storage/spider/mysql-test/spider/bg/r/direct_update_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/direct_update_part.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
with partition test
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -113,8 +118,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-12-01 05:01:03
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/function.result b/storage/spider/mysql-test/spider/bg/r/function.result
index 764c774514b..c088a8a9541 100644
--- a/storage/spider/mysql-test/spider/bg/r/function.result
+++ b/storage/spider/mysql-test/spider/bg/r/function.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
in()
+connection master_1;
CREATE TABLE t1 (
a VARCHAR(255),
PRIMARY KEY(a)
@@ -41,12 +46,14 @@ insert into t1 select a + 128 from t1;
insert into t1 select a + 256 from t1;
insert into t1 select a + 512 from t1;
flush tables;
+connection master_1;
select a from t1 where a in ('15', '120');
a
120
15
date_sub()
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -124,6 +131,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-02-03 06:00:03
5 c 2001-03-07 00:58:59
UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 SECOND);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-07 11:20:40
@@ -133,8 +141,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-03-07 00:59:00
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/ha.result b/storage/spider/mysql-test/spider/bg/r/ha.result
index 9837faebd87..f8833c229ef 100644
--- a/storage/spider/mysql-test/spider/bg/r/ha.result
+++ b/storage/spider/mysql-test/spider/bg/r/ha.result
@@ -18,34 +18,43 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
CREATE DATABASE auto_test_remote3;
USE auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
test select 1
+connection master_1;
SELECT 1;
1
1
create table test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -61,6 +70,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -70,6 +80,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 0
@@ -101,6 +112,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
@@ -113,6 +125,7 @@ auto_test_local ta_l 1 2
SELECT spider_copy_tables('ta_l', '0', '1');
spider_copy_tables('ta_l', '0', '1')
1
+connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
@@ -134,12 +147,14 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
8 g 2011-05-05 21:33:30
DROP TABLE ta_l;
+connection master_1;
SELECT spider_flush_table_mon_cache();
spider_flush_table_mon_cache()
1
active standby test
create table test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -155,6 +170,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -164,6 +180,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
@@ -191,6 +208,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2", alc "1",
@@ -206,17 +224,25 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
8 g 2011-05-05 21:33:30
DROP TABLE ta_l;
+connection master_1;
SELECT spider_flush_table_mon_cache();
spider_flush_table_mon_cache()
1
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/ha_part.result b/storage/spider/mysql-test/spider/bg/r/ha_part.result
index 8c0300ba5a5..315f37298bc 100644
--- a/storage/spider/mysql-test/spider/bg/r/ha_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/ha_part.result
@@ -18,34 +18,43 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
CREATE DATABASE auto_test_remote3;
USE auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
test select 1
+connection master_1;
SELECT 1;
1
1
create table with partition test
+connection master_1;
DROP TABLE IF EXISTS ta_l2;
CREATE TABLE ta_l2 (
a INT,
@@ -61,6 +70,7 @@ INSERT INTO ta_l2 (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -70,6 +80,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 0
@@ -103,6 +114,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
@@ -120,6 +132,7 @@ auto_test_local ta_l2#P#pt2 1 2
SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1');
spider_copy_tables('ta_l2#P#pt2', '0', '1')
1
+connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
@@ -150,6 +163,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
DROP TABLE ta_l2;
create table with partition test
+connection master_1;
DROP TABLE IF EXISTS ta_l2;
CREATE TABLE ta_l2 (
a INT,
@@ -165,6 +179,7 @@ INSERT INTO ta_l2 (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -174,6 +189,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
@@ -206,6 +222,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
@@ -233,12 +250,19 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
DROP TABLE ta_l2;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
index 98073fa5e54..aa734573a1a 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes.result
@@ -10,26 +10,34 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
3.1
auto_increment
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -182,6 +190,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -190,11 +199,16 @@ id
3108
5000
10000
+connection master_1;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
index 12f43ef09b2..b793346df4b 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider3_fixes_part.result
@@ -10,24 +10,32 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
auto_increment with partition
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -180,6 +188,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -188,11 +197,16 @@ id
3108
5000
10000
+connection master_1;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
index 3033586821e..f50c9822534 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes.result
@@ -10,25 +10,31 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table and insert
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -50,6 +56,7 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l;
2.13
select table with "order by desc" and "<"
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a < 5 ORDER BY a DESC LIMIT 3;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -58,6 +65,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 b 2000-01-01 00:00:00
select table with "order by desc" and "<="
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a <= 5 ORDER BY a DESC LIMIT 3;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -67,7 +75,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2.14
update table with range scan and split_read
+connection master_1;
UPDATE ta_l SET c = '2000-02-02 00:00:00' WHERE a > 1;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -80,6 +90,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
select table with range scan
TRUNCATE TABLE ta_l;
DROP TABLE IF EXISTS ta_l;
+connection master_1;
CREATE TABLE ta_l (
a int(11) NOT NULL DEFAULT '0',
b char(1) DEFAULT NULL,
@@ -87,50 +98,62 @@ c datetime DEFAULT NULL,
PRIMARY KEY (a, b, c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a >= 4 AND b = 'd'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a > 4 AND b = 'c'
AND c = '2001-12-31 23:59:59';
a b c
5 c 2001-12-31 23:59:59
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b <= 'd'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b < 'e'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND b = 'b'
AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND b = 'b'
AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
AND b <= 'd' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b'
AND b < 'e' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND a >= 1
AND b >= 'b' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND a > 1
AND b >= 'b' AND c = '2000-01-01 00:00:00';
a b c
@@ -138,6 +161,7 @@ a b c
2.16
auto_increment insert with trigger
+connection master_1;
CREATE TABLE ta_l_auto_inc (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -151,14 +175,17 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE2 MASTER_1_CHARSET2
CREATE TRIGGER ins_ta_l_auto_inc AFTER INSERT ON ta_l_auto_inc FOR EACH ROW BEGIN INSERT INTO tc_l (a, b, c) VALUES (NEW.a, NEW.b, NEW.c); END;;
+connection master_1;
INSERT INTO ta_l_auto_inc (a, b, c) VALUES
(NULL, 's', '2008-12-31 20:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM tc_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 s 2008-12-31 20:59:59
2.17
engine-condition-pushdown with "or" and joining
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a = 1 OR a IN (SELECT a FROM tb_l);
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -169,6 +196,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2.23
index merge
+connection master_1;
CREATE TABLE ta_l_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -182,6 +210,7 @@ INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int;
+connection master_1;
SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2)
WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a;
a b c
@@ -191,6 +220,7 @@ a b c
2.24
index scan update without PK
+connection master_1;
DROP TABLE IF EXISTS ta_l_int;
CREATE TABLE ta_l_int (
a INT NOT NULL,
@@ -219,7 +249,9 @@ a b c
16 17 18
INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3);
INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3);
+connection master_1;
UPDATE ta_l_int SET c = 4 WHERE b = 2;
+connection master_1;
SELECT a, b, c FROM ta_l_int ORDER BY a;
a b c
1 2 4
@@ -243,6 +275,7 @@ a b c
2.25
direct order limit
+connection master_1;
SHOW STATUS LIKE 'Spider_direct_order_limit';
Variable_name Value
Spider_direct_order_limit 2
@@ -257,6 +290,7 @@ Spider_direct_order_limit 3
2.26
lock tables
+connection master_1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
@@ -271,6 +305,9 @@ LOCK TABLES t1 READ, t2 READ;
UNLOCK TABLES;
auto_increment
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -358,6 +395,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t1;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -371,8 +409,10 @@ id
5439
6216
10000
+connection master_1;
read only
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -404,6 +444,7 @@ ERROR HY000: Table 'auto_test_local.t1' is read only
2.27
error mode
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -427,6 +468,7 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
3.0
is null
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a VARCHAR(255),
@@ -449,6 +491,7 @@ insert into t1 select a + 128, b + 128, c + 128 from t1;
insert into t1 select a + 256, b + 256, c + 256 from t1;
insert into t1 select a + 512, b + 512, c + 512 from t1;
flush tables;
+connection master_1;
select a from t1 where a is null order by a limit 30;
a
NULL
@@ -515,6 +558,7 @@ NULL
NULL
direct_order_limit
+connection master_1;
TRUNCATE TABLE t1;
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
@@ -526,6 +570,7 @@ insert into t1 select a, b + 32, c + 32 from t1;
insert into t1 select a, b + 64, c + 64 from t1;
insert into t1 select a, b + 128, c + 128 from t1;
flush tables;
+connection master_1;
select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5;
a b c
10 74 74
@@ -542,9 +587,13 @@ a c
10 170
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result
index 104ba971df9..faf0b6efbea 100644
--- a/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result
+++ b/storage/spider/mysql-test/spider/bg/r/spider_fixes_part.result
@@ -10,23 +10,29 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -43,6 +49,7 @@ INSERT INTO tb_l (a, b, c) VALUES
2.17
partition with sort
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -60,7 +67,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2.23
partition update with moving partition
+connection master_1;
DROP TABLE IF EXISTS ta_l2;
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -73,7 +82,9 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 B 2010-09-26 00:00:00
index merge with partition
+connection master_1;
DROP TABLE IF EXISTS ta_l_int;
+connection master_1;
CREATE TABLE ta_l_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -87,6 +98,7 @@ INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int;
+connection master_1;
SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2)
WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a;
a b c
@@ -96,6 +108,9 @@ a b c
2.26
auto_increment with partition
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -183,6 +198,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t1;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -196,11 +212,16 @@ id
5439
6216
10000
+connection master_1;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/bg/r/vp_fixes.result b/storage/spider/mysql-test/spider/bg/r/vp_fixes.result
index 15dd29aa4d3..cc0e4105d61 100644
--- a/storage/spider/mysql-test/spider/bg/r/vp_fixes.result
+++ b/storage/spider/mysql-test/spider/bg/r/vp_fixes.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table and insert
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -46,26 +51,34 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l;
0.9
create different primary key table
+connection master_1;
CREATE TABLE ta_l_int (
a INT DEFAULT 10,
b INT AUTO_INCREMENT,
c INT DEFAULT 11,
PRIMARY KEY(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
create un-correspond primary key table
+connection master_1;
DROP TABLE IF EXISTS ta_l_int;
+connection master_1;
CREATE TABLE ta_l_int (
a INT DEFAULT 10,
b INT DEFAULT 12,
c INT DEFAULT 11,
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/basic_sql.result b/storage/spider/mysql-test/spider/r/basic_sql.result
index 1e9fe78acea..94a09fc317b 100644
--- a/storage/spider/mysql-test/spider/r/basic_sql.result
+++ b/storage/spider/mysql-test/spider/r/basic_sql.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table select test
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -43,6 +48,7 @@ CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -52,6 +58,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
create table ignore select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
@@ -76,6 +83,7 @@ Warning 1062 Duplicate entry '2' for key 'PRIMARY'
Warning 1062 Duplicate entry '3' for key 'PRIMARY'
Warning 1062 Duplicate entry '4' for key 'PRIMARY'
Warning 1062 Duplicate entry '5' for key 'PRIMARY'
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -85,11 +93,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
create table ignore select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT_2_1
REPLACE SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -99,10 +109,12 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
create no index table
+connection master_1;
DROP TABLE IF EXISTS ta_l_no_idx;
CREATE TABLE ta_l_no_idx
MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT2_2_1
SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l_no_idx ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -112,6 +124,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -121,6 +134,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table shared mode
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a
LOCK IN SHARE MODE;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -131,6 +145,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table for update
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a
FOR UPDATE;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -141,6 +156,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table join
+connection master_1;
SELECT a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a, tb_l b
WHERE a.a = b.a ORDER BY a.a;
a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
@@ -151,6 +167,7 @@ a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select table straight_join
+connection master_1;
SELECT STRAIGHT_JOIN a.a, a.b, date_format(b.c, '%Y-%m-%d %H:%i:%s')
FROM ta_l a, tb_l b WHERE a.a = b.a ORDER BY a.a;
a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
@@ -161,6 +178,7 @@ a b date_format(b.c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_small_result
+connection master_1;
SELECT SQL_SMALL_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -171,6 +189,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_big_result
+connection master_1;
SELECT SQL_BIG_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -181,6 +200,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_buffer_result
+connection master_1;
SELECT SQL_BUFFER_RESULT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -191,6 +211,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_cache
+connection master_1;
SELECT SQL_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -201,6 +222,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_no_cache
+connection master_1;
SELECT SQL_NO_CACHE a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -211,6 +233,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select sql_calc_found_rows
+connection master_1;
SELECT SQL_CALC_FOUND_ROWS a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a LIMIT 4;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -218,11 +241,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
3 j 2007-05-04 20:03:11
4 i 2003-10-30 05:01:03
+connection master_1;
SELECT found_rows();
found_rows()
5
select high_priority
+connection master_1;
SELECT HIGH_PRIORITY a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -233,6 +258,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select distinct
+connection master_1;
SELECT DISTINCT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -243,11 +269,13 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select count
+connection master_1;
SELECT count(*) FROM ta_l ORDER BY a;
count(*)
5
select table join not use index
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM tb_l a WHERE
EXISTS (SELECT * FROM ta_l b WHERE b.b = a.b) ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
@@ -258,27 +286,35 @@ a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select using pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE
a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
select using index and pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l a WHERE
a.a > 0 AND a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
insert
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert select
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -288,61 +324,82 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
insert select a
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1),
'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
insert low_priority
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT LOW_PRIORITY INTO ta_l (a, b, c) values (2, 'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert high_priority
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT HIGH_PRIORITY INTO ta_l (a, b, c) VALUES (2, 'e',
'2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert ignore
+connection master_1;
INSERT IGNORE INTO ta_l (a, b, c) VALUES (2, 'd', '2009-02-02 01:01:01');
Warnings:
Warning 1062 Duplicate entry '2' for key 'PRIMARY'
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert update (insert)
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE
KEY UPDATE b = 'f', c = '2005-08-08 11:11:11';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
insert update (update)
+connection master_1;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59') ON DUPLICATE
KEY UPDATE b = 'f', c = '2005-08-08 11:11:11';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 f 2005-08-08 11:11:11
replace
+connection master_1;
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (2, 'e', '2008-01-01 23:59:59');
+connection master_1;
REPLACE INTO ta_l (a, b, c) VALUES (2, 'f', '2008-02-02 02:02:02');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 f 2008-02-02 02:02:02
replace select
+connection master_1;
REPLACE INTO ta_l (a, b, c) SELECT a, b, c FROM tb_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -352,8 +409,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
replace select a
+connection master_1;
REPLACE INTO ta_l (a, b, c) VALUES ((SELECT a FROM tb_l ORDER BY a LIMIT 1),
'e', '2008-01-01 23:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -363,8 +422,10 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
replace low_priority
+connection master_1;
REPLACE LOW_PRIORITY INTO ta_l (a, b, c) VALUES (3, 'g',
'2009-03-03 03:03:03');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -377,66 +438,84 @@ update
TRUNCATE TABLE ta_l;
INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(2, 'e', '2008-01-01 23:59:59');
+connection master_1;
UPDATE ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
2 f 2008-02-02 02:02:02
update select
+connection master_1;
UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a IN (SELECT a FROM
tb_l);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
update select a
+connection master_1;
UPDATE ta_l SET b = 'h', c = '2010-04-04 04:04:04' WHERE a = (SELECT a FROM
tb_l ORDER BY a LIMIT 1);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 h 2010-04-04 04:04:04
2 g 2009-03-03 03:03:03
update join
+connection master_1;
UPDATE ta_l a, tb_l b SET a.b = b.b, a.c = b.c WHERE a.a = b.a;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
2 g 2000-02-01 00:00:00
update join a
+connection master_1;
UPDATE ta_l a, tb_l b SET a.b = 'g', a.c = '2009-03-03 03:03:03' WHERE
a.a = b.a;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 g 2009-03-03 03:03:03
update low_priority
+connection master_1;
UPDATE LOW_PRIORITY ta_l SET b = 'f', c = '2008-02-02 02:02:02' WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 f 2008-02-02 02:02:02
update ignore
+connection master_1;
UPDATE IGNORE ta_l SET a = 1, b = 'g', c = '2009-03-03 03:03:03' WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 f 2008-02-02 02:02:02
update pushdown
+connection master_1;
update ta_l set b = 'j', c = '2009-03-03 03:03:03' where b = 'f';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
2 j 2009-03-03 03:03:03
update index pushdown
+connection master_1;
UPDATE ta_l SET b = 'g', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'j';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 g 2009-03-03 03:03:03
@@ -450,7 +529,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -464,7 +545,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
10 j 2008-01-01 23:59:59
delete all
+connection master_1;
DELETE FROM ta_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -476,7 +559,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a IN (SELECT a FROM tb_l);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2008-01-01 23:59:59
@@ -493,7 +578,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a = (SELECT a FROM tb_l ORDER BY a LIMIT 1);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 e 2008-01-01 23:59:59
@@ -514,7 +601,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE a FROM ta_l a, (SELECT a FROM tb_l ORDER BY a) b WHERE a.a = b.a;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2008-01-01 23:59:59
@@ -531,7 +620,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE LOW_PRIORITY FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -552,7 +643,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE IGNORE FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -573,7 +666,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE QUICK FROM ta_l WHERE a = 2;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 e 2008-01-01 23:59:59
@@ -594,7 +689,9 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE b = 'e';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
10 j 2008-01-01 23:59:59
@@ -607,19 +704,26 @@ INSERT INTO ta_l (a, b, c) VALUES (1, 'e', '2008-01-01 23:59:59'),
(6, 'e', '2008-01-01 23:59:59'), (7, 'e', '2008-01-01 23:59:59'),
(8, 'e', '2008-01-01 23:59:59'), (9, 'e', '2008-01-01 23:59:59'),
(10, 'j', '2008-01-01 23:59:59');
+connection master_1;
DELETE FROM ta_l WHERE a > 0 AND b = 'e';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
10 j 2008-01-01 23:59:59
truncate
+connection master_1;
TRUNCATE TABLE ta_l;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/basic_sql_part.result b/storage/spider/mysql-test/spider/r/basic_sql_part.result
index 9e1201c17c9..0f4029404a7 100644
--- a/storage/spider/mysql-test/spider/r/basic_sql_part.result
+++ b/storage/spider/mysql-test/spider/r/basic_sql_part.result
@@ -9,20 +9,25 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -38,10 +43,12 @@ INSERT INTO tb_l (a, b, c) VALUES
(5, 'h', '2001-10-31 23:59:59');
create table with partition and select test
+connection master_1;
CREATE TABLE ta_l2 (
PRIMARY KEY(a)
) MASTER_1_ENGINE MASTER_1_COMMENT_P_2_1
SELECT a, b, c FROM tb_l
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -51,19 +58,23 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
select partition using pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE
a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
select partition using index pushdown
+connection master_1;
SELECT a.a, a.b, date_format(a.c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 a WHERE
a.a > 0 AND a.b = 'g' ORDER BY a.a;
a b date_format(a.c, '%Y-%m-%d %H:%i:%s')
2 g 2000-02-01 00:00:00
update partition pushdown
+connection master_1;
UPDATE ta_l2 SET b = 'e', c = '2009-03-03 03:03:03' WHERE b = 'j';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -73,7 +84,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
update partition index pushdown
+connection master_1;
UPDATE ta_l2 SET b = 'j', c = '2009-03-03 03:03:03' WHERE a > 0 AND b = 'e';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -85,7 +98,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
delete partition pushdown
TRUNCATE TABLE ta_l2;
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+connection master_1;
DELETE FROM ta_l2 WHERE b = 'g';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -96,7 +111,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
delete partition index pushdown
TRUNCATE TABLE ta_l2;
INSERT INTO ta_l2 SELECT a, b, c FROM tb_l;
+connection master_1;
DELETE FROM ta_l2 WHERE a > 0 AND b = 'g';
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 f 2008-07-01 10:21:39
@@ -105,8 +122,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 h 2001-10-31 23:59:59
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate.result b/storage/spider/mysql-test/spider/r/direct_aggregate.result
index 3a9c7be3076..9a8660ba79e 100644
--- a/storage/spider/mysql-test/spider/r/direct_aggregate.result
+++ b/storage/spider/mysql-test/spider/r/direct_aggregate.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -40,6 +45,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
direct_aggregating test
+connection master_1;
SHOW STATUS LIKE 'Spider_direct_aggregate';
Variable_name Value
Spider_direct_aggregate 0
@@ -75,8 +81,11 @@ Variable_name Value
Spider_direct_aggregate 0
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result
index bbdc943601b..760b39e16d5 100644
--- a/storage/spider/mysql-test/spider/r/direct_aggregate_part.result
+++ b/storage/spider/mysql-test/spider/r/direct_aggregate_part.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
with partition test
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -66,8 +71,11 @@ Variable_name Value
Spider_direct_aggregate 0
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/direct_update.result b/storage/spider/mysql-test/spider/r/direct_update.result
index 517491253e9..74dae7aec2e 100644
--- a/storage/spider/mysql-test/spider/r/direct_update.result
+++ b/storage/spider/mysql-test/spider/r/direct_update.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table select test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -40,6 +45,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
direct_updating test
+connection master_1;
SHOW STATUS LIKE 'Spider_direct_update';
Variable_name Value
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
@@ -122,8 +128,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-12-01 05:01:03
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/direct_update_part.result b/storage/spider/mysql-test/spider/r/direct_update_part.result
index bd8f1b89f69..6db7c01f563 100644
--- a/storage/spider/mysql-test/spider/r/direct_update_part.result
+++ b/storage/spider/mysql-test/spider/r/direct_update_part.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
with partition test
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -113,8 +118,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-12-01 05:01:03
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/function.result b/storage/spider/mysql-test/spider/r/function.result
index 764c774514b..c088a8a9541 100644
--- a/storage/spider/mysql-test/spider/r/function.result
+++ b/storage/spider/mysql-test/spider/r/function.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
in()
+connection master_1;
CREATE TABLE t1 (
a VARCHAR(255),
PRIMARY KEY(a)
@@ -41,12 +46,14 @@ insert into t1 select a + 128 from t1;
insert into t1 select a + 256 from t1;
insert into t1 select a + 512 from t1;
flush tables;
+connection master_1;
select a from t1 where a in ('15', '120');
a
120
15
date_sub()
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -124,6 +131,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 d 2003-02-03 06:00:03
5 c 2001-03-07 00:58:59
UPDATE ta_l SET c = DATE_ADD(c, INTERVAL 1 SECOND);
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2007-10-07 11:20:40
@@ -133,8 +141,11 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-03-07 00:59:00
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/ha.result b/storage/spider/mysql-test/spider/r/ha.result
index 9837faebd87..f8833c229ef 100644
--- a/storage/spider/mysql-test/spider/r/ha.result
+++ b/storage/spider/mysql-test/spider/r/ha.result
@@ -18,34 +18,43 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
CREATE DATABASE auto_test_remote3;
USE auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
test select 1
+connection master_1;
SELECT 1;
1
1
create table test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -61,6 +70,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -70,6 +80,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 0
@@ -101,6 +112,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
@@ -113,6 +125,7 @@ auto_test_local ta_l 1 2
SELECT spider_copy_tables('ta_l', '0', '1');
spider_copy_tables('ta_l', '0', '1')
1
+connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2",
@@ -134,12 +147,14 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
8 g 2011-05-05 21:33:30
DROP TABLE ta_l;
+connection master_1;
SELECT spider_flush_table_mon_cache();
spider_flush_table_mon_cache()
1
active standby test
create table test
+connection master_1;
DROP TABLE IF EXISTS ta_l;
CREATE TABLE ta_l (
a INT,
@@ -155,6 +170,7 @@ INSERT INTO ta_l (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -164,6 +180,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
@@ -191,6 +208,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l
CONNECTION='host "localhost", user "root", password "",
msi "5", mkd "2", alc "1",
@@ -206,17 +224,25 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
8 g 2011-05-05 21:33:30
DROP TABLE ta_l;
+connection master_1;
SELECT spider_flush_table_mon_cache();
spider_flush_table_mon_cache()
1
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/ha_part.result b/storage/spider/mysql-test/spider/r/ha_part.result
index 8c0300ba5a5..315f37298bc 100644
--- a/storage/spider/mysql-test/spider/r/ha_part.result
+++ b/storage/spider/mysql-test/spider/r/ha_part.result
@@ -18,34 +18,43 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
CREATE DATABASE auto_test_remote3;
USE auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
test select 1
+connection master_1;
SELECT 1;
1
1
create table with partition test
+connection master_1;
DROP TABLE IF EXISTS ta_l2;
CREATE TABLE ta_l2 (
a INT,
@@ -61,6 +70,7 @@ INSERT INTO ta_l2 (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -70,6 +80,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 0
@@ -103,6 +114,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
@@ -120,6 +132,7 @@ auto_test_local ta_l2#P#pt2 1 2
SELECT spider_copy_tables('ta_l2#P#pt2', '0', '1');
spider_copy_tables('ta_l2#P#pt2', '0', '1')
1
+connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
@@ -150,6 +163,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
DROP TABLE ta_l2;
create table with partition test
+connection master_1;
DROP TABLE IF EXISTS ta_l2;
CREATE TABLE ta_l2 (
a INT,
@@ -165,6 +179,7 @@ INSERT INTO ta_l2 (a, b, c) VALUES
(5, 'c', '2001-12-31 23:59:59');
select test
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2 ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -174,6 +189,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
5 c 2001-12-31 23:59:59
fail-over test
+connection master_1;
SHOW STATUS LIKE 'Spider_mon_table_cache_version%';
Variable_name Value
Spider_mon_table_cache_version 1
@@ -206,6 +222,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
6 e 2011-05-05 20:04:05
recovery test
+connection master_1;
ALTER TABLE ta_l2
PARTITION BY KEY(a) (
PARTITION pt1 COMMENT='srv "s_2_1 s_2_2", tbl "ta_r ta_r3",
@@ -233,12 +250,19 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
DROP TABLE ta_l2;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
+connection child2_3;
DROP DATABASE IF EXISTS auto_test_remote3;
+connection child3_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_2;
DROP DATABASE IF EXISTS auto_test_local;
+connection child3_3;
DROP DATABASE IF EXISTS auto_test_local;
for master_1
for child2
diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes.result b/storage/spider/mysql-test/spider/r/spider3_fixes.result
index cb62468d3ae..d6aec25bfc1 100644
--- a/storage/spider/mysql-test/spider/r/spider3_fixes.result
+++ b/storage/spider/mysql-test/spider/r/spider3_fixes.result
@@ -10,26 +10,34 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
3.1
auto_increment
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -182,6 +190,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -190,11 +199,16 @@ id
3108
5000
10000
+connection master_1;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result
index 12f43ef09b2..b793346df4b 100644
--- a/storage/spider/mysql-test/spider/r/spider3_fixes_part.result
+++ b/storage/spider/mysql-test/spider/r/spider3_fixes_part.result
@@ -10,24 +10,32 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
auto_increment with partition
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -180,6 +188,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t2;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -188,11 +197,16 @@ id
3108
5000
10000
+connection master_1;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/r/spider_fixes.result b/storage/spider/mysql-test/spider/r/spider_fixes.result
index 3033586821e..f50c9822534 100644
--- a/storage/spider/mysql-test/spider/r/spider_fixes.result
+++ b/storage/spider/mysql-test/spider/r/spider_fixes.result
@@ -10,25 +10,31 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table and insert
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -50,6 +56,7 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l;
2.13
select table with "order by desc" and "<"
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a < 5 ORDER BY a DESC LIMIT 3;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -58,6 +65,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2 b 2000-01-01 00:00:00
select table with "order by desc" and "<="
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l
WHERE a <= 5 ORDER BY a DESC LIMIT 3;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
@@ -67,7 +75,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2.14
update table with range scan and split_read
+connection master_1;
UPDATE ta_l SET c = '2000-02-02 00:00:00' WHERE a > 1;
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -80,6 +90,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
select table with range scan
TRUNCATE TABLE ta_l;
DROP TABLE IF EXISTS ta_l;
+connection master_1;
CREATE TABLE ta_l (
a int(11) NOT NULL DEFAULT '0',
b char(1) DEFAULT NULL,
@@ -87,50 +98,62 @@ c datetime DEFAULT NULL,
PRIMARY KEY (a, b, c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT5_2_1
INSERT INTO ta_l SELECT a, b, c FROM tb_l;
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a >= 4 AND b = 'd'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a > 4 AND b = 'c'
AND c = '2001-12-31 23:59:59';
a b c
5 c 2001-12-31 23:59:59
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b <= 'd'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b < 'e'
AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND b = 'b'
AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND b = 'b'
AND c = '2000-01-01 00:00:00';
a b c
2 b 2000-01-01 00:00:00
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b >= 'b'
AND b <= 'd' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a = 4 AND b > 'b'
AND b < 'e' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a <= 4 AND a >= 1
AND b >= 'b' AND c = '2003-11-30 05:01:03';
a b c
4 d 2003-11-30 05:01:03
+connection master_1;
SELECT a, b, c FROM ta_l FORCE INDEX(PRIMARY) WHERE a < 4 AND a > 1
AND b >= 'b' AND c = '2000-01-01 00:00:00';
a b c
@@ -138,6 +161,7 @@ a b c
2.16
auto_increment insert with trigger
+connection master_1;
CREATE TABLE ta_l_auto_inc (
a INT AUTO_INCREMENT,
b CHAR(1) DEFAULT 'c',
@@ -151,14 +175,17 @@ c DATETIME,
PRIMARY KEY(a)
) MASTER_1_ENGINE2 MASTER_1_CHARSET2
CREATE TRIGGER ins_ta_l_auto_inc AFTER INSERT ON ta_l_auto_inc FOR EACH ROW BEGIN INSERT INTO tc_l (a, b, c) VALUES (NEW.a, NEW.b, NEW.c); END;;
+connection master_1;
INSERT INTO ta_l_auto_inc (a, b, c) VALUES
(NULL, 's', '2008-12-31 20:59:59');
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM tc_l ORDER BY a;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 s 2008-12-31 20:59:59
2.17
engine-condition-pushdown with "or" and joining
+connection master_1;
SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l WHERE a = 1 OR a IN (SELECT a FROM tb_l);
a b date_format(c, '%Y-%m-%d %H:%i:%s')
1 a 2008-08-01 10:21:39
@@ -169,6 +196,7 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2.23
index merge
+connection master_1;
CREATE TABLE ta_l_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -182,6 +210,7 @@ INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int;
+connection master_1;
SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2)
WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a;
a b c
@@ -191,6 +220,7 @@ a b c
2.24
index scan update without PK
+connection master_1;
DROP TABLE IF EXISTS ta_l_int;
CREATE TABLE ta_l_int (
a INT NOT NULL,
@@ -219,7 +249,9 @@ a b c
16 17 18
INSERT INTO ta_l_int (a, b, c) VALUES (0, 2, 3);
INSERT INTO ta_l_int (a, b, c) VALUES (18, 2, 3);
+connection master_1;
UPDATE ta_l_int SET c = 4 WHERE b = 2;
+connection master_1;
SELECT a, b, c FROM ta_l_int ORDER BY a;
a b c
1 2 4
@@ -243,6 +275,7 @@ a b c
2.25
direct order limit
+connection master_1;
SHOW STATUS LIKE 'Spider_direct_order_limit';
Variable_name Value
Spider_direct_order_limit 2
@@ -257,6 +290,7 @@ Spider_direct_order_limit 3
2.26
lock tables
+connection master_1;
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
CREATE TABLE t1 (
@@ -271,6 +305,9 @@ LOCK TABLES t1 READ, t2 READ;
UNLOCK TABLES;
auto_increment
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -358,6 +395,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t1;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -371,8 +409,10 @@ id
5439
6216
10000
+connection master_1;
read only
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -404,6 +444,7 @@ ERROR HY000: Table 'auto_test_local.t1' is read only
2.27
error mode
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL,
@@ -427,6 +468,7 @@ Error 1146 Table 'auto_test_remote.ter1_1' doesn't exist
3.0
is null
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a VARCHAR(255),
@@ -449,6 +491,7 @@ insert into t1 select a + 128, b + 128, c + 128 from t1;
insert into t1 select a + 256, b + 256, c + 256 from t1;
insert into t1 select a + 512, b + 512, c + 512 from t1;
flush tables;
+connection master_1;
select a from t1 where a is null order by a limit 30;
a
NULL
@@ -515,6 +558,7 @@ NULL
NULL
direct_order_limit
+connection master_1;
TRUNCATE TABLE t1;
insert into t1 values ('1', '1', '1');
insert into t1 select a + 1, b + 1, c + 1 from t1;
@@ -526,6 +570,7 @@ insert into t1 select a, b + 32, c + 32 from t1;
insert into t1 select a, b + 64, c + 64 from t1;
insert into t1 select a, b + 128, c + 128 from t1;
flush tables;
+connection master_1;
select a, b, c from t1 where a = '10' and b <> '100' order by c desc limit 5;
a b c
10 74 74
@@ -542,9 +587,13 @@ a c
10 170
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/r/spider_fixes_part.result b/storage/spider/mysql-test/spider/r/spider_fixes_part.result
index 104ba971df9..faf0b6efbea 100644
--- a/storage/spider/mysql-test/spider/r/spider_fixes_part.result
+++ b/storage/spider/mysql-test/spider/r/spider_fixes_part.result
@@ -10,23 +10,29 @@ child3_3
for slave1_1
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -43,6 +49,7 @@ INSERT INTO tb_l (a, b, c) VALUES
2.17
partition with sort
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -60,7 +67,9 @@ a b date_format(c, '%Y-%m-%d %H:%i:%s')
2.23
partition update with moving partition
+connection master_1;
DROP TABLE IF EXISTS ta_l2;
+connection master_1;
CREATE TABLE ta_l2 (
a INT,
b CHAR(1),
@@ -73,7 +82,9 @@ SELECT a, b, date_format(c, '%Y-%m-%d %H:%i:%s') FROM ta_l2;
a b date_format(c, '%Y-%m-%d %H:%i:%s')
4 B 2010-09-26 00:00:00
index merge with partition
+connection master_1;
DROP TABLE IF EXISTS ta_l_int;
+connection master_1;
CREATE TABLE ta_l_int (
a INT AUTO_INCREMENT,
b INT DEFAULT 10,
@@ -87,6 +98,7 @@ INSERT INTO ta_l_int (a, b, c) SELECT a + 1, b + 1, c + 1 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 2, b + 2, c + 2 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 4, b + 4, c + 4 FROM ta_l_int;
INSERT INTO ta_l_int (a, b, c) SELECT a + 8, b + 8, c + 8 FROM ta_l_int;
+connection master_1;
SELECT a, b, c FROM ta_l_int force index(primary, idx1, idx2)
WHERE a = 5 OR b = 5 OR c = 5 ORDER BY a;
a b c
@@ -96,6 +108,9 @@ a b c
2.26
auto_increment with partition
+connection master_1;
+connection slave1_1;
+connection master_1;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -183,6 +198,7 @@ LAST_INSERT_ID()
SELECT MAX(id) FROM t1;
MAX(id)
10000
+connection slave1_1;
SELECT id FROM t1 ORDER BY id;
id
777
@@ -196,11 +212,16 @@ id
5439
6216
10000
+connection master_1;
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection slave1_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for slave1_1
for master_1
diff --git a/storage/spider/mysql-test/spider/r/vp_fixes.result b/storage/spider/mysql-test/spider/r/vp_fixes.result
index 15dd29aa4d3..cc0e4105d61 100644
--- a/storage/spider/mysql-test/spider/r/vp_fixes.result
+++ b/storage/spider/mysql-test/spider/r/vp_fixes.result
@@ -9,22 +9,27 @@ child3_2
child3_3
drop and create databases
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
CREATE DATABASE auto_test_local;
USE auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
CREATE DATABASE auto_test_remote;
USE auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
CREATE DATABASE auto_test_remote2;
USE auto_test_remote2;
test select 1
+connection master_1;
SELECT 1;
1
1
create table and insert
+connection master_1;
DROP TABLE IF EXISTS tb_l;
CREATE TABLE tb_l (
a INT,
@@ -46,26 +51,34 @@ INSERT INTO ta_l SELECT a, b, c FROM tb_l;
0.9
create different primary key table
+connection master_1;
CREATE TABLE ta_l_int (
a INT DEFAULT 10,
b INT AUTO_INCREMENT,
c INT DEFAULT 11,
PRIMARY KEY(b)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
create un-correspond primary key table
+connection master_1;
DROP TABLE IF EXISTS ta_l_int;
+connection master_1;
CREATE TABLE ta_l_int (
a INT DEFAULT 10,
b INT DEFAULT 12,
c INT DEFAULT 11,
PRIMARY KEY(c)
) MASTER_1_ENGINE MASTER_1_CHARSET MASTER_1_COMMENT4_2_1
+connection master_1;
INSERT INTO ta_l_int (a, b, c) VALUES (2, NULL, 3);
deinit
+connection master_1;
DROP DATABASE IF EXISTS auto_test_local;
+connection child2_1;
DROP DATABASE IF EXISTS auto_test_remote;
+connection child2_2;
DROP DATABASE IF EXISTS auto_test_remote2;
for master_1
for child2
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result
index 0e9b750f77d..2348fd0d9d4 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_deadlock_tokudb.result
@@ -1,9 +1,11 @@
include/master-slave.inc
[connection master]
*** Prepare tables and data ***
+connection master;
CREATE TABLE t1 (a INT NOT NULL, KEY(a)) ENGINE=TokuDB;
CREATE TABLE t2 (a INT) ENGINE=TokuDB;
CREATE TABLE t3 (a INT NOT NULL, KEY(a)) ENGINE=TokuDB;
+connection slave;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -25,6 +27,7 @@ SHOW VARIABLES LIKE 'slave_transaction_retries';
Variable_name Value
slave_transaction_retries 2
include/stop_slave.inc
+connection master;
BEGIN;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
@@ -32,6 +35,7 @@ INSERT INTO t3 VALUES (3);
COMMIT;
*** Test deadlock ***
+connection slave;
BEGIN;
SELECT * FROM t1 FOR UPDATE;
a
@@ -49,6 +53,7 @@ a
include/check_slave_is_running.inc
*** Test lock wait timeout ***
+connection slave;
include/stop_slave.inc
DELETE FROM t2;
CHANGE MASTER TO MASTER_LOG_POS=<master_pos_begin>;
@@ -74,6 +79,7 @@ a
include/check_slave_is_running.inc
*** Test lock wait timeout and purged relay logs ***
+connection slave;
SET @my_max_relay_log_size= @@global.max_relay_log_size;
SET global max_relay_log_size=0;
Warnings:
@@ -106,7 +112,9 @@ a
include/check_slave_is_running.inc
*** Clean up ***
+connection master;
DROP TABLE t1,t2,t3;
+connection slave;
SET global max_relay_log_size= @my_max_relay_log_size;
End of 5.1 tests
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
index b58beb68c8a..b5d9ecbedae 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
@@ -12,6 +12,7 @@ include/master-slave.inc
***** Testing more columns on the Master *****
+connection master;
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
f5 FLOAT DEFAULT '2.00',
@@ -24,10 +25,12 @@ f11 VARBINARY(64))ENGINE=TokuDB;
* Alter Table on Slave and drop columns f5 through f11 *
+connection slave;
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
* Insert data in Master then update and delete some rows*
+connection master;
* Select count and 20 rows from Master *
SELECT COUNT(*) FROM t1;
@@ -57,6 +60,7 @@ f1 f2 f3 f4 f5 f6 f7 f8 f9 hex(f10) hex(f11)
27 27 27 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
29 29 29 second 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
30 30 30 next 2 kaks 2 got stolen from the paradise very fat blob 1555 123456
+connection slave;
* Select count and 20 rows from Slave *
@@ -90,6 +94,7 @@ include/check_slave_is_running.inc
***** Testing Altering table def scenario *****
+connection master;
CREATE TABLE t2 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
/* extra */
f5 DOUBLE DEFAULT '2.00',
@@ -164,6 +169,7 @@ f35 VARCHAR(257)
** Alter tables on slave and drop columns **
+connection slave;
alter table t2 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11, drop
f12;
alter table t3 drop f5, drop f6, drop f8, drop f10, drop f11, drop f12;
@@ -176,6 +182,7 @@ drop f26, drop f27, drop f28, drop f29, drop f30, drop f31, drop f32,
drop f33, drop f34, drop f35;
** Insert Data into Master **
+connection master;
INSERT into t2 set f1=1, f2=1, f3=1, f4='first', f8='f8: medium size blob', f10='f10:
some var char';
INSERT into t2 values (2, 2, 2, 'second',
@@ -340,6 +347,7 @@ Warning 1264 Out of range value for column 'f24' at row 3
** Sync slave with master **
** Do selects from tables **
+connection slave;
select * from t1 order by f3;
f1 f2 f3 f4
2 2 2 second
@@ -401,6 +409,7 @@ f1 f2 f3 f4
1 1 4 fourth
1 1 5 fifth
1 1 6 sixth
+connection master;
** Do updates master **
@@ -418,12 +427,14 @@ delete from t2;
delete from t3;
delete from t4;
delete from t31;
+connection slave;
select * from t31;
f1 f2 f3 f4
** Check slave status **
include/check_slave_is_running.inc
+connection master;
****************************************
* columns in master at middle of table *
@@ -441,14 +452,17 @@ CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
** Connect to master and create table **
+connection master;
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
c CHAR(5), e INT DEFAULT '1')ENGINE=TokuDB;
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
@@ -459,11 +473,14 @@ INSERT INTO t10 () VALUES(1,@b1,DEFAULT,'Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'double' to type 'char(5)''
*** Drop t10 ***
+connection master;
DROP TABLE t10;
+connection slave;
*********************************************
* More columns in master at middle of table *
@@ -477,14 +494,17 @@ CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
) ENGINE=TokuDB;
*** Create t11 on Master ***
+connection master;
CREATE TABLE t11 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=TokuDB;
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
@@ -495,11 +515,14 @@ INSERT INTO t11 () VALUES(1,@b1,'Testing is fun','Kyle',DEFAULT),
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'tinyblob' to type 'varchar(254)''
*** Drop t11 ***
+connection master;
DROP TABLE t11;
+connection slave;
*********************************************
* More columns in master at middle of table *
@@ -513,14 +536,17 @@ CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
) ENGINE=TokuDB;
*** Create t12 on Master ***
+connection master;
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE=TokuDB;
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t12 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -534,6 +560,7 @@ a hex(b) f c e
3 62316231623162316231623162316231 QA test 1
*** Select on Slave ***
+connection slave;
SELECT a,hex(b),c FROM t12 ORDER BY a;
a hex(b) c
1 62316231623162316231623162316231 Kyle
@@ -541,7 +568,9 @@ a hex(b) c
3 62316231623162316231623162316231 QA
*** Drop t12 ***
+connection master;
DROP TABLE t12;
+connection slave;
****************************************************
* - Alter Master adding columns at middle of table *
@@ -556,6 +585,7 @@ CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE=TokuDB;
*** Create t14 on Master ***
+connection master;
CREATE TABLE t14 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -563,9 +593,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
@@ -582,6 +614,7 @@ c1 c2 c3 hex(c4) c5 c6 c7
3 3.00 If is does not, I will open a bug 62316231623162316231623162316231 QA 1 CURRENT_TIMESTAMP
*** Select on Slave ****
+connection slave;
SELECT c1,c2,c3,hex(c4),c5 FROM t14 ORDER BY c1;
c1 c2 c3 hex(c4) c5
1 1.00 Replication Testing Extra Col 62316231623162316231623162316231 Kyle
@@ -594,6 +627,7 @@ c1 c2 c3 hex(c4) c5
****************************************************
*** connect to master and drop columns ***
+connection master;
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c7;
@@ -607,6 +641,7 @@ c1 c3 hex(c4) c5 c6
************
* Bug30415 *
************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1091]
Last_SQL_Error = 'Error 'Can't DROP 'c7'; check that column/key exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
@@ -614,8 +649,10 @@ RESET SLAVE;
*** Drop t14 ***
DROP TABLE t14;
+connection master;
DROP TABLE t14;
RESET MASTER;
+connection slave;
START SLAVE;
*************************************************
@@ -630,6 +667,7 @@ CREATE TABLE t15 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE=TokuDB;
*** Create t15 on Master ***
+connection master;
CREATE TABLE t15 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -637,9 +675,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -656,6 +696,7 @@ c1 hex(c4) c5 c6 c7 c2
*** Expect slave to fail with Error 1054 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1054]
Last_SQL_Error = 'Error 'Unknown column 'c7' in 't15'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c2 DECIMAL(8,2) AFTER c7''
STOP SLAVE;
@@ -663,8 +704,10 @@ RESET SLAVE;
*** Drop t15 ***
DROP TABLE t15;
+connection master;
DROP TABLE t15;
RESET MASTER;
+connection slave;
START SLAVE;
************************************************
@@ -679,6 +722,7 @@ CREATE TABLE t16 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE=TokuDB;
*** Create t16 on Master ***
+connection master;
CREATE TABLE t16 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -686,9 +730,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Create Index and Data Insert ***
+connection master;
CREATE INDEX part_of_c6 ON t16 (c6);
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
@@ -705,6 +751,7 @@ c1 hex(c4) c5 c6 c7
*** BUG 30434 ***
*****************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1072]
Last_SQL_Error = 'Error 'Key column 'c6' doesn't exist in table' on query. Default database: 'test'. Query: 'CREATE INDEX part_of_c6 ON t16 (c6)''
STOP SLAVE;
@@ -712,8 +759,10 @@ RESET SLAVE;
*** Drop t16 ***
DROP TABLE t16;
+connection master;
DROP TABLE t16;
RESET MASTER;
+connection slave;
START SLAVE;
*****************************************************
@@ -728,6 +777,7 @@ CREATE TABLE t17 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE=TokuDB;
*** Create t17 on Master ***
+connection master;
CREATE TABLE t17 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -735,9 +785,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t17 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -750,6 +802,7 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
@@ -757,6 +810,7 @@ c1 hex(c4) c5
3 62316231623162316231623162316231 QA
** Delete from master **
+connection master;
DELETE FROM t17 WHERE c6 = 3;
SELECT c1,hex(c4),c5,c6,c7 FROM t17 ORDER BY c1;
c1 hex(c4) c5 c6 c7
@@ -764,11 +818,14 @@ c1 hex(c4) c5 c6 c7
2 62316231623162316231623162316231 JOE 2 CURRENT_TIMESTAMP
** Check slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t17 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
2 62316231623162316231623162316231 JOE
+connection master;
DROP TABLE t17;
+connection slave;
*****************************************************
@@ -786,6 +843,7 @@ CREATE TABLE t18 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE=TokuDB;
*** Create t18 on Master ***
+connection master;
CREATE TABLE t18 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -793,9 +851,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t18 () VALUES(1,@b1,'Kyle',DEFAULT,DEFAULT),
@@ -808,6 +868,7 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 QA 3 CURRENT_TIMESTAMP
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
@@ -815,6 +876,7 @@ c1 hex(c4) c5
3 62316231623162316231623162316231 QA
** update from master **
+connection master;
UPDATE t18 SET c5 = 'TEST' WHERE c6 = 3;
SELECT c1,hex(c4),c5,c6,c7 FROM t18 ORDER BY c1;
c1 hex(c4) c5 c6 c7
@@ -823,12 +885,15 @@ c1 hex(c4) c5 c6 c7
3 62316231623162316231623162316231 TEST 3 CURRENT_TIMESTAMP
** Check slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t18 ORDER BY c1;
c1 hex(c4) c5
1 62316231623162316231623162316231 Kyle
2 62316231623162316231623162316231 JOE
3 62316231623162316231623162316231 TEST
+connection master;
DROP TABLE t18;
+connection slave;
*****************************************************
@@ -843,6 +908,7 @@ CREATE TABLE t5 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE=TokuDB;
*** Create t5 on Master ***
+connection master;
CREATE TABLE t5 (c1 INT KEY, c4 BLOB, c5 CHAR(5),
c6 LONG,
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
@@ -850,9 +916,11 @@ c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
INSERT INTO t5 () VALUES(1,@b1,'Kyle',UUID(),DEFAULT),
(2,@b1,'JOE',UUID(),DEFAULT),
@@ -864,10 +932,14 @@ c1 hex(c4) c5 c6 c7
3 6231623162316231 QA UUID TIME
** Select * from Slave **
+connection slave;
SELECT c1,hex(c4),c5 FROM t5 ORDER BY c1;
c1 hex(c4) c5
1 6231623162316231 Kyle
2 6231623162316231 JOE
3 6231623162316231 QA
+connection master;
DROP TABLE t5;
+connection slave;
+connection master;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result
index 6212c378f69..5061c1dcdbf 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_extra_col_slave_tokudb.result
@@ -3,7 +3,7 @@ include/master-slave.inc
call mtr.add_suppression("Slave: Unknown table 't6' error.* 1051");
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]*. cannot be converted from type.* error.* 1677");
**** Diff Table Def Start ****
-*** On Slave ***
+connection slave;
STOP SLAVE;
RESET SLAVE;
SET @saved_slave_type_conversions = @@slave_type_conversions;
@@ -13,12 +13,15 @@ d FLOAT DEFAULT '2.00',
e CHAR(4) DEFAULT 'TEST')
ENGINE='TokuDB';
*** Create t1 on Master ***
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t1 () VALUES(1,2,'TEXAS'),(2,1,'AUSTIN'),(3,4,'QA');
SELECT * FROM t1 ORDER BY a;
a b c
@@ -26,6 +29,7 @@ a b c
2 1 AUSTIN
3 4 QA
*** Select from slave ***
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c d e
1 2 TEXAS 2 TEST
@@ -33,7 +37,9 @@ a b c d e
3 4 QA 2 TEST
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
*** Drop t1 ***
+connection master;
DROP TABLE t1;
+connection slave;
*** Create t2 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -42,10 +48,12 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='TokuDB';
*** Create t2 on Master ***
+connection master;
CREATE TABLE t2 (a INT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='TokuDB';
RESET MASTER;
*** Master Data Insert ***
+connection master;
INSERT INTO t2 () VALUES(1,2,'Kyle, TEX'),(2,1,'JOE AUSTIN'),(3,4,'QA TESTING');
SELECT * FROM t2 ORDER BY a;
a b c
@@ -53,6 +61,7 @@ a b c
2 1 JOE AUSTIN
3 4 QA TESTING
*** Start Slave ***
+connection slave;
START SLAVE;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t2' cannot be converted from type 'char(10)' to type 'char(5)''
@@ -60,10 +69,14 @@ STOP SLAVE;
RESET SLAVE;
SELECT * FROM t2 ORDER BY a;
a b c d e
+connection master;
RESET MASTER;
+connection slave;
START SLAVE;
*** Drop t2 ***
+connection master;
DROP TABLE t2;
+connection slave;
*** Create t3 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -72,22 +85,28 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='TokuDB';
*** Create t3 on Master ***
+connection master;
CREATE TABLE t3 (a BLOB, b INT PRIMARY KEY, c CHAR(20)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t3 () VALUES(@b1,2,'Kyle, TEX'),(@b1,1,'JOE AUSTIN'),(@b1,4,'QA TESTING');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t3' cannot be converted from type 'tinyblob' to type 'int(11)''
*** Drop t3 ***
+connection master;
DROP TABLE t3;
+connection slave;
*** Create t4 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -96,21 +115,27 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='TokuDB';
*** Create t4 on Master ***
+connection master;
CREATE TABLE t4 (a DECIMAL(8,2), b INT PRIMARY KEY, c CHAR(20)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t4 () VALUES(100.22,2,'Kyle, TEX'),(200.26,1,'JOE AUSTIN'),
(30000.22,4,'QA TESTING');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'decimal(8,2)' to type 'int(11)''
*** Drop t4 ***
+connection master;
DROP TABLE t4;
+connection slave;
*** Create t5 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -118,45 +143,57 @@ CREATE TABLE t5 (a INT PRIMARY KEY, b CHAR(5),
c FLOAT, d INT, e DOUBLE,
f DECIMAL(8,2))ENGINE='TokuDB';
*** Create t5 on Master ***
+connection master;
CREATE TABLE t5 (a INT PRIMARY KEY, b VARCHAR(6),
c DECIMAL(8,2), d BIT, e BLOB,
f FLOAT) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t5 () VALUES(1,'Kyle',200.23,1,'b1b1',23.00098),
(2,'JOE',300.01,0,'b2b2',1.0000009);
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t5 ***
+connection master;
DROP TABLE t5;
+connection slave;
*** Create t6 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t6 (a INT PRIMARY KEY, b CHAR(5),
c FLOAT, d INT)ENGINE='TokuDB';
*** Create t6 on Master ***
+connection master;
CREATE TABLE t6 (a INT PRIMARY KEY, b VARCHAR(6),
c DECIMAL(8,2), d BIT
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t6 () VALUES(1,'Kyle',200.23,1),
(2,'JOE',300.01,0);
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'varchar(6)' to type 'char(5)''
*** Drop t6 ***
include/rpl_reset.inc
+connection master;
DROP TABLE t6;
+connection slave;
**** Diff Table Def End ****
**** Extra Colums Start ****
*** Create t7 on slave ***
@@ -167,12 +204,15 @@ d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
e CHAR(20) DEFAULT 'Extra Column Testing')
ENGINE='TokuDB';
*** Create t7 on Master ***
+connection master;
CREATE TABLE t7 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t7 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -182,13 +222,16 @@ a b c
2 b1b1 JOE
3 b1b1 QA
*** Select from slave ***
+connection slave;
SELECT * FROM t7 ORDER BY a;
a b c d e
1 b1b1 Kyle 0000-00-00 00:00:00 Extra Column Testing
2 b1b1 JOE 0000-00-00 00:00:00 Extra Column Testing
3 b1b1 QA 0000-00-00 00:00:00 Extra Column Testing
*** Drop t7 ***
+connection master;
DROP TABLE t7;
+connection slave;
*** Create t8 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -196,17 +239,22 @@ CREATE TABLE t8 (a INT KEY, b BLOB, c CHAR(5),
d TIMESTAMP NULL DEFAULT '0000-00-00 00:00:00',
e INT)ENGINE='TokuDB';
*** Create t8 on Master ***
+connection master;
CREATE TABLE t8 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t8 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
*** Drop t8 ***
+connection master;
DROP TABLE t8;
+connection slave;
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t9 (a INT KEY, b BLOB, c CHAR(5),
@@ -218,77 +266,98 @@ g text,
h blob not null,
i blob) ENGINE='TokuDB';
*** Create t9 on Master ***
+connection master;
CREATE TABLE t9 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t9 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
+connection slave;
select * from t9;
a b c d e f g h i
1 b1b1b1b1b1b1b1b1 Kyle 0000-00-00 00:00:00 0 NULL NULL
2 b1b1b1b1b1b1b1b1 JOE 0000-00-00 00:00:00 0 NULL NULL
3 b1b1b1b1b1b1b1b1 QA 0000-00-00 00:00:00 0 NULL NULL
+connection master;
DROP TABLE t9;
+connection slave;
*** Create t10 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t10 (a INT KEY, b BLOB, f DOUBLE DEFAULT '233',
c CHAR(5), e INT DEFAULT '1')ENGINE='TokuDB';
*** Create t10 on Master ***
+connection master;
CREATE TABLE t10 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t10 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t10' cannot be converted from type 'char(5)' to type 'double''
*** Drop t10 ***
+connection master;
DROP TABLE t10;
+connection slave;
*** Create t11 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t11 (a INT KEY, b BLOB, f INT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='TokuDB';
*** Create t11 on Master ***
+connection master;
CREATE TABLE t11 (a INT PRIMARY KEY, b BLOB, c VARCHAR(254)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t11 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t11' cannot be converted from type 'varchar(254)' to type 'int(11)''
*** Drop t11 ***
+connection master;
DROP TABLE t11;
+connection slave;
*** Create t12 on slave ***
STOP SLAVE;
RESET SLAVE;
CREATE TABLE t12 (a INT KEY, b BLOB, f TEXT,
c CHAR(5) DEFAULT 'test', e INT DEFAULT '1')ENGINE='TokuDB';
*** Create t12 on Master ***
+connection master;
CREATE TABLE t12 (a INT PRIMARY KEY, b BLOB, c BLOB
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t12 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -298,13 +367,16 @@ a b c
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ***
+connection slave;
SELECT * FROM t12 ORDER BY a;
a b f c e
1 b1b1b1b1b1b1b1b1 Kyle test 1
2 b1b1b1b1b1b1b1b1 JOE test 1
3 b1b1b1b1b1b1b1b1 QA test 1
*** Drop t12 ***
+connection master;
DROP TABLE t12;
+connection slave;
**** Extra Colums End ****
*** BUG 22177 Start ***
*** Create t13 on slave ***
@@ -315,12 +387,15 @@ d INT DEFAULT '1',
e TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='TokuDB';
*** Create t13 on Master ***
+connection master;
CREATE TABLE t13 (a INT PRIMARY KEY, b BLOB, c CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t13 () VALUES(1,@b1,'Kyle'),(2,@b1,'JOE'),(3,@b1,'QA');
@@ -330,13 +405,16 @@ a b c
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t13 ORDER BY a;
a b c d e
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Drop t13 ***
+connection master;
DROP TABLE t13;
+connection slave;
*** 22117 END ***
*** Alter Master Table Testing Start ***
*** Create t14 on slave ***
@@ -347,12 +425,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='TokuDB';
*** Create t14 on Master ***
+connection master;
CREATE TABLE t14 (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
ALTER TABLE t14 ADD COLUMN c2 DECIMAL(8,2) AFTER c1;
ALTER TABLE t14 ADD COLUMN c3 TEXT AFTER c2;
set @b1 = 'b1b1b1b1';
@@ -366,6 +447,7 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t14 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -379,12 +461,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='TokuDB';
*** Create t14a on Master ***
+connection master;
CREATE TABLE t14a (c1 INT PRIMARY KEY, c4 BLOB, c5 CHAR(5)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t14a () VALUES(1,@b1,'Kyle'),
@@ -396,6 +481,7 @@ c1 c4 c5
2 b1b1b1b1b1b1b1b1 JOE
3 b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t14a ORDER BY c1;
c1 c4 c5 c6 c7
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -404,11 +490,14 @@ c1 c4 c5 c6 c7
STOP SLAVE;
RESET SLAVE;
*** Master Drop c5 ***
+connection master;
ALTER TABLE t14a DROP COLUMN c5;
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t14a () VALUES(4,@b1),
@@ -423,6 +512,7 @@ c1 c4
5 b1b1b1b1b1b1b1b1
6 b1b1b1b1b1b1b1b1
*** Select on Slave ****
+connection slave;
SELECT * FROM t14a ORDER BY c1;
c1 c4 c5 c6 c7
1 b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -431,8 +521,11 @@ c1 c4 c5 c6 c7
4 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
5 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
6 b1b1b1b1b1b1b1b1 NULL 1 CURRENT_TIMESTAMP
+connection master;
DROP TABLE t14a;
+connection slave;
*** connect to master and drop columns ***
+connection master;
ALTER TABLE t14 DROP COLUMN c2;
ALTER TABLE t14 DROP COLUMN c4;
*** Select from Master ***
@@ -442,13 +535,16 @@ c1 c3 c5
2 This Test Should work JOE
3 If is does not, I will open a bug QA
*** Select from Slave ***
+connection slave;
SELECT * FROM t14 ORDER BY c1;
c1 c3 c5 c6 c7
1 Replication Testing Extra Col Kyle 1 CURRENT_TIMESTAMP
2 This Test Should work JOE 1 CURRENT_TIMESTAMP
3 If is does not, I will open a bug QA 1 CURRENT_TIMESTAMP
*** Drop t14 ***
+connection master;
DROP TABLE t14;
+connection slave;
*** Create t15 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -458,15 +554,18 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='TokuDB';
*** Create t15 on Master ***
+connection master;
CREATE TABLE t15 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
c4 BLOB, c5 CHAR(5)) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
call mtr.add_suppression("Error .Unknown table .t6.. on query.* error.* 1051");
call mtr.add_suppression("Error .Duplicate column name .c6.. on query.* error.* 1060");
call mtr.add_suppression("Table definition on master and slave does not match: Column . ...e mismatch.* error.* 1535");
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t15 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
@@ -478,19 +577,23 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Add column on master that is a Extra on Slave ***
+connection master;
ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5;
********************************************
*** Expect slave to fail with Error 1060 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1060]
Last_SQL_Error = 'Error 'Duplicate column name 'c6'' on query. Default database: 'test'. Query: 'ALTER TABLE t15 ADD COLUMN c6 INT AFTER c5''
*** Try to insert in master ****
+connection master;
INSERT INTO t15 () VALUES(5,2.00,'Replication Testing',@b1,'Buda',2);
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6
@@ -499,6 +602,7 @@ c1 c2 c3 c4 c5 c6
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA NULL
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2
*** Try to select from slave ****
+connection slave;
SELECT * FROM t15 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
@@ -506,7 +610,9 @@ c1 c2 c3 c4 c5 c6 c7
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
5 2.00 Replication Testing b1b1b1b1b1b1b1b1 Buda 2 CURRENT_TIMESTAMP
*** DROP TABLE t15 ***
+connection master;
DROP TABLE t15;
+connection slave;
*** Create t16 on slave ***
STOP SLAVE;
RESET SLAVE;
@@ -516,12 +622,15 @@ c6 INT DEFAULT '1',
c7 TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
)ENGINE='TokuDB';
*** Create t16 on Master ***
+connection master;
CREATE TABLE t16 (c1 INT PRIMARY KEY, c2 DECIMAL(8,2), c3 TEXT,
c4 BLOB, c5 CHAR(5))ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
set @b1 = 'b1b1b1b1';
set @b1 = concat(@b1,@b1);
INSERT INTO t16 () VALUES(1,1.00,'Replication Testing Extra Col',@b1,'Kyle'),
@@ -533,12 +642,14 @@ c1 c2 c3 c4 c5
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA
*** Select on Slave ****
+connection slave;
SELECT * FROM t16 ORDER BY c1;
c1 c2 c3 c4 c5 c6 c7
1 1.00 Replication Testing Extra Col b1b1b1b1b1b1b1b1 Kyle 1 CURRENT_TIMESTAMP
2 2.00 This Test Should work b1b1b1b1b1b1b1b1 JOE 1 CURRENT_TIMESTAMP
3 3.00 If is does not, I will open a bug b1b1b1b1b1b1b1b1 QA 1 CURRENT_TIMESTAMP
*** Add Partition on master ***
+connection master;
ALTER TABLE t16 PARTITION BY KEY(c1) PARTITIONS 4;
INSERT INTO t16 () VALUES(4,1.00,'Replication Rocks',@b1,'Omer');
SHOW CREATE TABLE t16;
@@ -554,6 +665,7 @@ t16 CREATE TABLE `t16` (
/*!50100 PARTITION BY KEY (c1)
PARTITIONS 4 */
*** Show table on Slave ****
+connection slave;
SHOW CREATE TABLE t16;
Table Create Table
t16 CREATE TABLE `t16` (
@@ -569,7 +681,9 @@ t16 CREATE TABLE `t16` (
/*!50100 PARTITION BY KEY (c1)
PARTITIONS 4 */
*** DROP TABLE t16 ***
+connection master;
DROP TABLE t16;
+connection slave;
*** Alter Master End ***
*** Create t17 on slave ***
STOP SLAVE;
@@ -579,18 +693,24 @@ d FLOAT DEFAULT '2.00',
e CHAR(5) DEFAULT 'TEST2')
ENGINE='TokuDB';
*** Create t17 on Master ***
+connection master;
CREATE TABLE t17 (a BIGINT PRIMARY KEY, b INT, c CHAR(10)
) ENGINE='TokuDB';
RESET MASTER;
*** Start Slave ***
+connection slave;
START SLAVE;
*** Master Data Insert ***
+connection master;
INSERT INTO t17 () VALUES(9223372036854775807,2,'Kyle, TEX');
********************************************
*** Expect slave to fail with Error 1677 ***
********************************************
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t17' cannot be converted from type 'bigint' to type 'smallint(6)''
** DROP table t17 ***
+connection master;
DROP TABLE t17;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result
index ccfffb53976..e35e29d8248 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_foreign_key_tokudb.result
@@ -18,6 +18,7 @@ SELECT * FROM t2 ORDER BY b;
b c
5 0
6 11
+connection slave;
SELECT * FROM t1 ORDER BY a;
a
10
@@ -28,14 +29,19 @@ SELECT * FROM t2 ORDER BY b;
b c
5 0
6 11
+connection master;
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 'a'
+connection slave;
+connection master;
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS t1,t2,t3;
SET FOREIGN_KEY_CHECKS=1;
+connection slave;
+connection master;
create table t1 (b int primary key) engine = TokuDB;
create table t2 (a int primary key, b int, foreign key (b) references t1(b))
engine = TokuDB;
@@ -44,8 +50,10 @@ insert into t2 set a=1, b=1;
set foreign_key_checks=0;
delete from t1;
must sync w/o a problem (could not with the buggy code)
+connection slave;
select count(*) from t1 /* must be zero */;
count(*)
0
+connection master;
drop table t2,t1;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result
index c65c61a0a65..66aaaa6b6fa 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_not_null_tokudb.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
@@ -12,6 +13,7 @@ CREATE TABLE t4(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1(`a` INT, `b` DATE DEFAULT NULL,
`c` INT DEFAULT NULL,
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
@@ -23,6 +25,7 @@ PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
CREATE TABLE t4(`a` INT, `b` DATE DEFAULT '0000-00-00',
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, 1);
INSERT INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
INSERT INTO t1(a,b) VALUES (3, null);
@@ -40,20 +43,24 @@ INSERT INTO t4(a,b) VALUES (3, null);
INSERT INTO t4(a,c) VALUES (4, 4);
INSERT INTO t4(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:t1, slave:t1]
include/diff_tables.inc [master:t2, slave:t2]
TABLES t2 and t3 must be different.
+connection master;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
2 1111-11-11
3 NULL
+connection slave;
SELECT * FROM t3 ORDER BY a;
a b c
1 NULL 500
2 1111-11-11 500
3 NULL 500
+connection master;
SELECT * FROM t4 ORDER BY a;
a b c
1 NULL 1
@@ -61,6 +68,7 @@ a b c
3 NULL NULL
4 NULL 4
5 NULL NULL
+connection slave;
SELECT * FROM t4 ORDER BY a;
a b
1 NULL
@@ -69,26 +77,33 @@ a b
4 NULL
5 NULL
************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,'1111-11-11', 1);
REPLACE INTO t1(a,b,c) VALUES (2,'1111-11-11', 2);
UPDATE t1 set b= NULL, c= 300 where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, 300);
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:t1, slave:t1]
************* CLEANING *************
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
DROP TABLE t4;
+connection slave;
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT NULL, `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= TokuDB;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1 (`a` INT, `b` BIT DEFAULT b'01', `c` BIT DEFAULT NULL,
PRIMARY KEY (`a`)) ENGINE= TokuDB;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a,b,c) VALUES (1, null, b'01');
INSERT INTO t1(a,b,c) VALUES (2,b'00', b'01');
INSERT INTO t1(a,b) VALUES (3, null);
@@ -96,6 +111,8 @@ INSERT INTO t1(a,c) VALUES (4, b'01');
INSERT INTO t1(a) VALUES (5);
************* SHOWING THE RESULT SETS WITH INSERTS *************
TABLES t1 and t2 must be different.
+connection slave;
+connection master;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
a b+0 c+0
1 NULL 1
@@ -103,6 +120,7 @@ a b+0 c+0
3 NULL NULL
4 NULL 1
5 NULL NULL
+connection slave;
SELECT a,b+0,c+0 FROM t1 ORDER BY a;
a b+0 c+0
1 NULL 1
@@ -111,6 +129,7 @@ a b+0 c+0
4 NULL 1
5 NULL NULL
************* EXECUTION WITH UPDATES and REPLACES *************
+connection master;
DELETE FROM t1;
INSERT INTO t1(a,b,c) VALUES (1,b'00', b'01');
REPLACE INTO t1(a,b,c) VALUES (2,b'00',b'01');
@@ -118,8 +137,11 @@ UPDATE t1 set b= NULL, c= b'00' where a= 1;
REPLACE INTO t1(a,b,c) VALUES (2, NULL, b'00');
************* SHOWING THE RESULT SETS WITH UPDATES and REPLACES *************
TABLES t1 and t2 must be equal otherwise an error will be thrown.
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
################################################################################
# NULL ---> NOT NULL (STRICT MODE)
# UNCOMMENT THIS AFTER FIXING BUG#43992
@@ -127,6 +149,7 @@ DROP TABLE t1;
################################################################################
# NULL ---> NOT NULL (NON-STRICT MODE)
################################################################################
+connection master;
SET SQL_LOG_BIN= 0;
CREATE TABLE t1(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
@@ -135,6 +158,7 @@ PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
CREATE TABLE t3(`a` INT NOT NULL, `b` INT,
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
SET SQL_LOG_BIN= 1;
+connection slave;
CREATE TABLE t1(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT NOT NULL,
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
@@ -145,6 +169,7 @@ CREATE TABLE t3(`a` INT NOT NULL, `b` INT NOT NULL,
`c` INT DEFAULT 500,
PRIMARY KEY(`a`)) ENGINE=TokuDB DEFAULT CHARSET=LATIN1;
************* EXECUTION WITH INSERTS *************
+connection master;
INSERT INTO t1(a) VALUES (1);
INSERT INTO t1(a, b) VALUES (2, NULL);
INSERT INTO t1(a, b) VALUES (3, 1);
@@ -159,26 +184,33 @@ REPLACE INTO t3(a, b) VALUES (5, null);
REPLACE INTO t3(a, b) VALUES (3, null);
UPDATE t3 SET b = NULL where a = 4;
************* SHOWING THE RESULT SETS *************
+connection master;
+connection slave;
+connection master;
SELECT * FROM t1 ORDER BY a;
a b
1 NULL
2 NULL
3 1
+connection slave;
SELECT * FROM t1 ORDER BY a;
a b c
1 0 0
2 0 0
3 1 0
+connection master;
SELECT * FROM t2 ORDER BY a;
a b
1 NULL
2 NULL
3 1
+connection slave;
SELECT * FROM t2 ORDER BY a;
a b c
1 0 NULL
2 0 NULL
3 1 NULL
+connection master;
SELECT * FROM t3 ORDER BY a;
a b
1 NULL
@@ -186,6 +218,7 @@ a b
3 NULL
4 NULL
5 NULL
+connection slave;
SELECT * FROM t3 ORDER BY a;
a b c
1 0 500
@@ -193,7 +226,9 @@ a b c
3 0 500
4 0 500
5 0 500
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result
index e2daa5d1326..97b2b60942d 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb.result
@@ -1,9 +1,15 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
call mtr.add_suppression('Slave: Error dropping database');
include/stop_slave.inc
start slave;
+connection master;
+connection slave;
stop slave sql_thread;
+connection master;
+connection slave;
insert into test0.benchmark set state='slave is processing load';
start slave sql_thread;
use test0;
@@ -17,6 +23,7 @@ select ts from test0.benchmark where state like 'slave is supposed to finish wit
select ts from test0.benchmark where state like 'slave ends load' into @s_1;
select ts from test0.benchmark where state like 'slave is processing load' into @s_0;
select time_to_sec(@m_1) - time_to_sec(@m_0) as 'delta.out';
+connection master;
include/diff_tables.inc [master:test15.ti_nk, slave:test15.ti_nk]
include/diff_tables.inc [master:test15.ti_wk, slave:test15.ti_wk]
include/diff_tables.inc [master:test14.ti_nk, slave:test14.ti_nk]
@@ -49,4 +56,6 @@ include/diff_tables.inc [master:test1.ti_nk, slave:test1.ti_nk]
include/diff_tables.inc [master:test1.ti_wk, slave:test1.ti_wk]
include/diff_tables.inc [master:test0.ti_nk, slave:test0.ti_nk]
include/diff_tables.inc [master:test0.ti_wk, slave:test0.ti_wk]
+connection master;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
index cd8608f4387..c9b6ea8f1a9 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_delete_pk.result
@@ -1,17 +1,29 @@
include/master-slave.inc
[connection master]
+connection master;
drop table if exists t;
+connection slave;
+connection master;
create table t (a bigint not null, primary key(a)) engine=tokudb;
insert into t values (1);
insert into t values (2),(3);
insert into t values (4);
+connection master;
+connection slave;
+connection master;
include/diff_tables.inc [master:test.t, slave:test.t]
+connection master;
delete from t where a=2;
select unix_timestamp() into @tstart;
+connection master;
+connection slave;
+connection master;
select unix_timestamp() into @tend;
select @tend-@tstart <= 5;
@tend-@tstart <= 5
1
include/diff_tables.inc [master:test.t, slave:test.t]
+connection master;
drop table if exists t;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
index 1ba442ecde2..8ae4e9401a5 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_update_pk_uc0_lookup0.result
@@ -1,18 +1,29 @@
include/master-slave.inc
[connection master]
+connection master;
drop table if exists t;
+connection slave;
+connection master;
create table t (a bigint not null, b bigint not null, primary key(a)) engine=tokudb;
insert into t values (1,0);
insert into t values (2,0),(3,0);
insert into t values (4,0);
+connection master;
+connection slave;
+connection master;
include/diff_tables.inc [master:test.t, slave:test.t]
+connection master;
update t set b=b+1 where a=2;
update t set b=b+2 where a=1;
update t set b=b+3 where a=4;
update t set b=b+4 where a=3;
update t set b=b+1 where 1<=a and a<=3;
select unix_timestamp() into @tstart;
+connection master;
+connection slave;
+connection master;
select unix_timestamp() into @tend;
+connection slave;
select * from t;
a b
1 3
@@ -20,5 +31,7 @@ a b
3 5
4 3
include/diff_tables.inc [master:test.t, slave:test.t]
+connection master;
drop table if exists t;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
index 608e85249fb..2636ec21095 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_parallel_tokudb_write_pk.result
@@ -1,11 +1,19 @@
include/master-slave.inc
[connection master]
+connection master;
drop table if exists t;
+connection slave;
+connection master;
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
insert into t values (2),(3);
insert into t values (4);
+connection slave;
+connection slave;
+connection master;
include/diff_tables.inc [master:test.t, slave:test.t]
+connection master;
drop table if exists t;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result
index 4f289345a4b..37cacd8101f 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_partition_tokudb.result
@@ -93,6 +93,8 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection slave;
+connection slave;
show create table test.byrange_tbl;
Table Create Table
byrange_tbl CREATE TABLE `byrange_tbl` (
@@ -140,6 +142,7 @@ SELECT * FROM test.regular_tbl ORDER BY fkid DESC LIMIT 2;
id dt user uuidf fkid filler
1 date-time USER UUID 300 Partitioned table! Going to test replication for MySQL
2 date-time USER UUID 299 Partitioned table! Going to test replication for MySQL
+connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_byrange;
DROP TABLE test.regular_tbl;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result
index 2eb4bce3efe..f014ca6a90d 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_relay_space_tokudb.result
@@ -14,10 +14,12 @@ name age id
Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
+connection slave;
SELECT * FROM t1 ORDER BY id;
name age id
Andy 31 00000001
Jacob 2 00000002
Caleb 1 00000003
+connection master;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result
index f137414c6c9..9785ad7ebdf 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_basic_3tokudb.result
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
+connection slave;
+connection slave;
+connection master;
CREATE TABLE t1 (C1 CHAR(1), C2 CHAR(1), INDEX (C1)) ENGINE = 'TokuDB' ;
SELECT * FROM t1;
C1 C2
+connection slave;
SELECT * FROM t1;
C1 C2
+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;
@@ -15,6 +20,7 @@ A C
X X
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A A
@@ -23,6 +29,7 @@ A C
X X
X Y
X Z
+connection master;
DELETE FROM t1 WHERE C1 = C2;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
@@ -30,12 +37,14 @@ A B
A C
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A B
A C
X Y
X Z
+connection master;
UPDATE t1 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
@@ -43,16 +52,19 @@ A B
A I
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY C1,C2;
C1 C2
A B
A I
X Y
X Z
+connection slave;
include/assert.inc [Counter for COM_COMMIT is consistent with the number of actual commits]
include/assert.inc [Counter for COM_INSERT is consistent with the number of actual inserts]
include/assert.inc [Counter for COM_DELETE is consistent with the number of actual deletes]
include/assert.inc [Counter for COM_UPDATE is consistent with the number of actual updates]
+connection master;
UPDATE t1 SET c2 = 'Q' WHERE c1 = 'A' AND c2 = 'N';
SELECT * FROM t1 ORDER BY c1,c2;
C1 C2
@@ -60,12 +72,14 @@ A B
A I
X Y
X Z
+connection slave;
SELECT * FROM t1 ORDER BY c1,c2;
C1 C2
A B
A I
X Y
X Z
+connection master;
CREATE TABLE t2 (c1 INT, c12 char(1), c2 INT, PRIMARY KEY (c1)) ENGINE = 'TokuDB' ;
INSERT INTO t2
VALUES (1,'A',2), (2,'A',4), (3,'A',9), (4,'A',15), (5,'A',25),
@@ -88,6 +102,7 @@ c1 c12 c2
5 A 25
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 2
@@ -106,6 +121,7 @@ c1 c12 c2
5 A 25
8 A 64
9 A 81
+connection master;
UPDATE t2 SET c2 = c1*c1 WHERE c2 != c1*c1;
SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
c1 c12 c2
@@ -118,6 +134,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 WHERE c2 = c1 * c1 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -129,6 +146,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection master;
UPDATE t2 SET c12 = 'Q' WHERE c1 = 1 AND c2 = 999;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
@@ -141,6 +159,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -152,6 +171,7 @@ c1 c12 c2
7 A 49
8 A 64
9 A 81
+connection master;
DELETE FROM t2 WHERE c1 % 4 = 0;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
@@ -162,6 +182,7 @@ c1 c12 c2
6 A 36
7 A 49
9 A 81
+connection slave;
SELECT * FROM t2 ORDER BY c1,c2;
c1 c12 c2
1 A 1
@@ -171,7 +192,9 @@ c1 c12 c2
6 A 36
7 A 49
9 A 81
+connection master;
UPDATE t2 SET c12='X';
+connection master;
CREATE TABLE t3 (C1 CHAR(1), C2 CHAR(1), pk1 INT, C3 CHAR(1), pk2 INT, PRIMARY KEY (pk1,pk2)) ENGINE = 'TokuDB' ;
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);
@@ -183,6 +206,7 @@ A C 1 B 2
X X 3 B 1
X Y 2 B 1
X Z 2 B 2
+connection slave;
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
A A 3 B 2
@@ -191,6 +215,7 @@ A C 1 B 2
X X 3 B 1
X Y 2 B 1
X Z 2 B 2
+connection master;
DELETE FROM t3 WHERE C1 = C2;
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
@@ -198,12 +223,14 @@ A B 1 B 1
A C 1 B 2
X Y 2 B 1
X Z 2 B 2
+connection slave;
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
+connection master;
UPDATE t3 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t3 ORDER BY C1,C2;
C1 C2 pk1 C3 pk2
@@ -211,12 +238,14 @@ A B 1 B 1
A I 1 B 2
X Y 2 B 1
X Z 2 B 2
+connection slave;
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
+connection master;
CREATE TABLE t6 (C1 CHAR(1), C2 CHAR(1), C3 INT) ENGINE = 'TokuDB';
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);
@@ -228,6 +257,7 @@ X X 3
A C 4
X Z 5
A A 6
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
@@ -236,6 +266,7 @@ X X 3
A C 4
X Z 5
A A 6
+connection master;
DELETE FROM t6 WHERE C1 = C2;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
@@ -243,12 +274,14 @@ A B 1
X Y 2
A C 4
X Z 5
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
X Y 2
A C 4
X Z 5
+connection master;
UPDATE t6 SET C2 = 'I' WHERE C1 = 'A' AND C2 = 'C';
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
@@ -256,12 +289,14 @@ A B 1
X Y 2
A I 4
X Z 5
+connection slave;
SELECT * FROM t6 ORDER BY C3;
C1 C2 C3
A B 1
X Y 2
A I 4
X Z 5
+connection master;
CREATE TABLE t5 (C1 CHAR(1), C2 CHAR(1), C3 INT PRIMARY KEY) ENGINE = 'TokuDB' ;
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);
@@ -310,6 +345,7 @@ 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
+connection slave;
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
@@ -354,19 +390,24 @@ 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
+connection slave;
SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
+connection master;
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 = 'TokuDB' ;
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
+connection slave;
SELECT C1,HEX(B1),HEX(B2) FROM t4 ORDER BY C1;
C1 HEX(B1) HEX(B2)
1 NULL 0
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
+connection master;
CREATE TABLE t7 (C1 INT PRIMARY KEY, C2 INT) ENGINE = 'TokuDB' ;
---- on slave: original values ---
+connection slave;
+--- original values ---
INSERT INTO t7 VALUES (1,3), (2,6), (3,9);
SELECT * FROM t7 ORDER BY C1;
C1 C2
@@ -374,21 +415,23 @@ C1 C2
2 6
3 9
set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master: new values inserted ---
+connection 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
+connection slave;
set @@global.slave_exec_mode= default;
---- on slave: old values should be overwritten by replicated values ---
+--- old values should be overwritten by replicated values ---
SELECT * FROM t7 ORDER BY C1;
C1 C2
1 2
2 4
3 6
---- on master ---
+connection master;
CREATE TABLE t8 (a INT PRIMARY KEY, b INT UNIQUE, c INT UNIQUE) ENGINE = 'TokuDB' ;
INSERT INTO t8 VALUES (99,99,99);
INSERT INTO t8 VALUES (99,22,33);
@@ -400,7 +443,7 @@ ERROR 23000: Duplicate entry '99' for key 'c'
SELECT * FROM t8 ORDER BY a;
a b c
99 99 99
---- on slave ---
+connection slave;
SELECT * FROM t8 ORDER BY a;
a b c
99 99 99
@@ -412,10 +455,10 @@ a b c
3 6 9
99 99 99
set @@global.slave_exec_mode= 'IDEMPOTENT';
---- on master ---
+connection master;
INSERT INTO t8 VALUES (2,4,8);
+connection slave;
set @@global.slave_exec_mode= default;
---- on slave ---
SELECT * FROM t8 ORDER BY a;
a b c
1 2 3
@@ -423,100 +466,135 @@ a b c
3 6 9
99 99 99
**** Test for BUG#31552 ****
-**** On Master ****
+connection master;
DELETE FROM t1;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
INSERT INTO t1 VALUES ('K','K'), ('L','L'), ('M','M');
-**** On Master ****
+connection slave;
set @@global.slave_exec_mode= 'IDEMPOTENT';
DELETE FROM t1 WHERE C1 = 'L';
+connection master;
DELETE FROM t1;
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
+connection slave;
set @@global.slave_exec_mode= default;
include/check_slave_is_running.inc
SELECT COUNT(*) FROM t1 ORDER BY c1,c2;
COUNT(*) 0
**** Test for BUG#37076 ****
-**** On Master ****
+connection master;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a TIMESTAMP, b DATETIME, c DATE);
INSERT INTO t1 VALUES(
'2005-11-14 01:01:01', '2005-11-14 01:01:02', '2005-11-14');
-**** On Slave ****
+connection slave;
SELECT * FROM t1;
a b c
2005-11-14 01:01:01 2005-11-14 01:01:02 2005-11-14
+connection master;
DROP TABLE IF EXISTS t1,t2,t3,t4,t5,t6,t7,t8;
+connection slave;
+connection master;
CREATE TABLE t1 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
CREATE TABLE t2 (i INT NOT NULL,
c CHAR(16) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
+connection slave;
ALTER TABLE t2 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t3 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
+connection slave;
ALTER TABLE t3 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t4 (i INT NOT NULL,
c CHAR(128) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
CREATE TABLE t5 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
+connection slave;
ALTER TABLE t5 MODIFY c CHAR(16) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t6 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
+connection slave;
ALTER TABLE t6 MODIFY c CHAR(128) CHARACTER SET utf8 NOT NULL;
+connection master;
CREATE TABLE t7 (i INT NOT NULL,
c CHAR(255) CHARACTER SET utf8 NOT NULL,
j INT NOT NULL) ENGINE = 'TokuDB' ;
+connection slave;
SET @saved_slave_type_conversions = @@slave_type_conversions;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_NON_LOSSY';
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t1 VALUES (1, "", 1);
INSERT INTO t1 VALUES (2, repeat(_utf8'a', 16), 2);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t2 VALUES (1, "", 1);
INSERT INTO t2 VALUES (2, repeat(_utf8'a', 16), 2);
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column 1 size mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Could not execute Delete_rows event on table test.t1.* error.* 1032");
call mtr.add_suppression("Slave SQL.*Column 1 of table .test.t.. cannot be converted from type.*, error.* 1677");
include/rpl_reset.inc
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t4 VALUES (1, "", 1);
INSERT INTO t4 VALUES (2, repeat(_utf8'a', 128), 2);
+connection slave;
include/diff_tables.inc [master:t4, slave:t4]
[expecting slave to stop]
+connection master;
INSERT INTO t5 VALUES (1, "", 1);
INSERT INTO t5 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'char(255)' to type 'char(16)''
include/rpl_reset.inc
[expecting slave to stop]
+connection master;
INSERT INTO t6 VALUES (1, "", 1);
INSERT INTO t6 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/wait_for_slave_sql_error.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t6' cannot be converted from type 'char(255)' to type 'char(128)''
include/rpl_reset.inc
[expecting slave to replicate correctly]
+connection master;
INSERT INTO t7 VALUES (1, "", 1);
INSERT INTO t7 VALUES (2, repeat(_utf8'a', 255), 2);
+connection slave;
include/diff_tables.inc [master:t7, slave:t7]
+connection master;
drop table t1, t2, t3, t4, t5, t6, t7;
+connection slave;
+connection master;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE='TokuDB';
INSERT INTO t1 VALUES (1), (2), (3);
UPDATE t1 SET a = 10;
ERROR 23000: Duplicate entry '10' for key 'PRIMARY'
INSERT INTO t1 VALUES (4);
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
+connection master;
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
`pk` int(11) NOT NULL AUTO_INCREMENT,
@@ -568,10 +646,13 @@ UPDATE t1 SET `pk` = 6 ORDER BY `int_key` LIMIT 6;
ERROR 23000: Duplicate entry '6' for key 'PRIMARY'
DELETE FROM t2 WHERE `pk` < 7 LIMIT 1;
UPDATE t1 SET `int_key` = 4 ORDER BY `pk` LIMIT 6;
+connection slave;
*** results: t2 must be consistent ****
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1, t2;
EOF OF TESTS
+connection master;
CREATE TABLE t1 (a int) ENGINE='TokuDB';
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -585,10 +666,16 @@ UPDATE t1 SET a = 9 WHERE a < 3;
INSERT INTO t1 ( a ) VALUES ( 3 );
UPDATE t1 SET a = 0 WHERE a < 4;
UPDATE t1 SET a = 8 WHERE a < 5;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
+connection master;
+connection slave;
SET @saved_slave_type_conversions = @@SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = 'ALL_LOSSY';
+connection master;
CREATE TABLE t1 (a bit) ENGINE='TokuDB';
INSERT IGNORE INTO t1 VALUES (NULL);
INSERT INTO t1 ( a ) VALUES ( 0 );
@@ -629,7 +716,10 @@ DELETE FROM t1 WHERE a < 3 LIMIT 0;
UPDATE t1 SET a = 8 WHERE a = 5 LIMIT 2;
INSERT INTO t1 ( a ) VALUES ( 1 );
UPDATE t1 SET a = 9 WHERE a < 5 LIMIT 3;
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
drop table t1;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result
index 4fb33dc4b6b..084089078cc 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_blob_tokudb.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
***** Table Create Section ****
@@ -24,6 +25,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
+connection slave;
**** Data Insert Validation Slave Section test.t1 ****
@@ -36,6 +38,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
LENGTH(data)
16384
+connection master;
**** Data Update Section test.t1 ****
@@ -50,6 +53,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
+connection slave;
**** Data Update Validation Slave Section test.t1 ****
@@ -59,6 +63,7 @@ LENGTH(data)
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
LENGTH(data)
17408
+connection master;
**** End Test Section test.t1 ****
@@ -109,6 +114,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
+connection slave;
**** Data Insert Validation Slave Section test.t2 ****
@@ -120,6 +126,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 20000 b2 30000 dd2
+connection master;
**** Data Update Section test.t2 ****
@@ -136,6 +143,7 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
+connection slave;
**** Data Update Validation Slave Section test.t2 ****
@@ -147,7 +155,9 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
FROM test.t2 WHERE c1=2;
c1 LENGTH(c2) SUBSTR(c2,1+2*900,2) LENGTH(c4) SUBSTR(c4,1+3*900,3)
2 2256 b1 3000 dd1
+connection master;
DROP TABLE IF EXISTS test.t1;
DROP TABLE IF EXISTS test.t2;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result
index 8cbbda48c1f..372d1eb4c51 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_log_tokudb.result
@@ -1,13 +1,16 @@
include/master-slave.inc
[connection master]
+connection slave;
include/stop_slave.inc
include/wait_for_slave_to_stop.inc
reset master;
reset slave;
start slave;
include/wait_for_slave_to_start.inc
+connection slave;
set @save_slave_ddl_exec_mode=@@global.slave_ddl_exec_mode;
set @@global.slave_ddl_exec_mode=STRICT;
+connection master;
create table t1(n int not null auto_increment primary key)ENGINE=TokuDB;
insert into t1 values (NULL);
drop table t1;
@@ -49,6 +52,7 @@ master-bin.000001 # Write_rows_v1 # # table_id: # flags: STMT_END_F
master-bin.000001 # Xid # # COMMIT /* XID */
flush logs;
create table t3 (a int)ENGINE=TokuDB;
+connection master;
select * from t1 order by 1 asc;
word
Aarhus
@@ -120,6 +124,7 @@ Aberdeen
Abernathy
aberrant
aberration
+connection slave;
select * from t1 order by 1 asc;
word
Aarhus
@@ -194,6 +199,7 @@ aberration
flush logs;
include/stop_slave.inc
include/start_slave.inc
+connection master;
create table t2 (n int)ENGINE=TokuDB;
insert into t2 values (1);
include/show_binlog_events.inc
@@ -228,6 +234,7 @@ show binary logs;
Log_name File_size
master-bin.000001 #
master-bin.000002 #
+connection slave;
show binary logs;
Log_name File_size
slave-bin.000001 #
@@ -263,10 +270,12 @@ slave-bin.000002 # Xid # # COMMIT /* XID */
include/check_slave_is_running.inc
show binlog events in 'slave-bin.000005' from 4;
ERROR HY000: Error when executing command SHOW BINLOG EVENTS: Could not find target log
+connection master;
DROP TABLE t1;
DROP TABLE t2;
DROP TABLE t3;
include/rpl_reset.inc
+connection master;
create table t1(a int auto_increment primary key, b int);
insert into t1 values (NULL, 1);
set insert_id=5;
@@ -289,5 +298,7 @@ a b
5 1
6 1
drop table t1;
+connection slave;
set @@global.slave_ddl_exec_mode=@save_slave_ddl_exec_mode;
+connection master;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result
index faebaba2add..b4b3fffc696 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_rec_comp_tokudb.result
@@ -2,27 +2,39 @@ include/master-slave.inc
[connection master]
## case #1 - last_null_bit_pos==0 in record_compare without X bit
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 varchar(1) DEFAULT '', c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0, c8 bigint(20) DEFAULT 0) ENGINE=TokuDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #1.1 - last_null_bit_pos==0 in record_compare with X bit
## (1 column less and no varchar)
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 bigint(20) DEFAULT 0, c2 bigint(20) DEFAULT 0, c3 bigint(20) DEFAULT 0, c4 bigint(20) DEFAULT 0, c5 bigint(20) DEFAULT 0, c6 bigint(20) DEFAULT 0, c7 bigint(20) DEFAULT 0) ENGINE=TokuDB DEFAULT CHARSET=latin1;
INSERT INTO t1 ( c5, c6 ) VALUES ( 1 , 35 );
INSERT INTO t1 ( c5, c6 ) VALUES ( NULL, 35 );
UPDATE t1 SET c5 = 'a';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
## case #2 - X bit is wrongly set.
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 int, c2 varchar(1) default '') ENGINE=TokuDB DEFAULT CHARSET= latin1;
INSERT INTO t1(c1) VALUES (10);
INSERT INTO t1(c1) VALUES (NULL);
UPDATE t1 SET c1= 0;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result
index dbe82cfe8ac..44aacc95124 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_sp007_tokudb.result
@@ -12,32 +12,24 @@ INSERT INTO test.t1 VALUES (14);
ROLLBACK to savepoint t1_save;
COMMIT;
END|
-
-< ---- Master selects-- >
--------------------------
CALL test.p1(12);
SELECT * FROM test.t1;
num
12
-
-< ---- Slave selects-- >
-------------------------
+connection slave;
SELECT * FROM test.t1;
num
12
-
-< ---- Master selects-- >
--------------------------
+connection master;
CALL test.p1(13);
SELECT * FROM test.t1;
num
13
-
-< ---- Slave selects-- >
-------------------------
+connection slave;
SELECT * FROM test.t1;
num
13
+connection master;
DROP PROCEDURE test.p1;
DROP TABLE test.t1;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result
index d25adb366d5..165df929809 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_row_tabledefs_3tokudb.result
@@ -1,9 +1,12 @@
include/master-slave.inc
[connection master]
+connection master;
+connection slave;
STOP SLAVE;
SET @my_sql_mode= @@global.sql_mode;
SET GLOBAL SQL_MODE='STRICT_ALL_TABLES';
START SLAVE;
+connection master;
CREATE TABLE t1_int (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
CREATE TABLE t1_bit (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
CREATE TABLE t1_char (a INT PRIMARY KEY, b INT) ENGINE=TokuDB;
@@ -16,6 +19,7 @@ CREATE TABLE t6 (a INT, b INT, c INT) ENGINE=TokuDB;
CREATE TABLE t7 (a INT NOT NULL) ENGINE=TokuDB;
CREATE TABLE t8 (a INT NOT NULL) ENGINE=TokuDB;
CREATE TABLE t9 (a INT) ENGINE=TokuDB;
+connection slave;
ALTER TABLE t1_int ADD x INT DEFAULT 42;
ALTER TABLE t1_bit
ADD x BIT(3) DEFAULT b'011',
@@ -37,7 +41,7 @@ set @@global.slave_exec_mode= 'IDEMPOTENT';
INSERT INTO t1_int VALUES (2, 4, 4711);
INSERT INTO t1_char VALUES (2, 4, 'Foo is a bar');
INSERT INTO t1_bit VALUES (2, 4, b'101', b'11100', b'01');
-**** On Master ****
+connection master;
INSERT INTO t1_int VALUES (1,2);
INSERT INTO t1_int VALUES (2,5);
INSERT INTO t1_bit VALUES (1,2);
@@ -56,7 +60,7 @@ SELECT * FROM t1_char ORDER BY a;
a b
1 2
2 5
-**** On Slave ****
+connection slave;
set @@global.slave_exec_mode= default;
SELECT a,b,x FROM t1_int ORDER BY a;
a b x
@@ -70,7 +74,7 @@ SELECT a,b,x FROM t1_char ORDER BY a;
a b x
1 2 Just a test
2 5 Foo is a bar
-**** On Master ****
+connection master;
UPDATE t1_int SET b=2*b WHERE a=2;
UPDATE t1_char SET b=2*b WHERE a=2;
UPDATE t1_bit SET b=2*b WHERE a=2;
@@ -86,7 +90,7 @@ SELECT * FROM t1_char ORDER BY a;
a b
1 2
2 10
-**** On Slave ****
+connection slave;
SELECT a,b,x FROM t1_int ORDER BY a;
a b x
1 2 42
@@ -99,38 +103,59 @@ SELECT a,b,x FROM t1_char ORDER BY a;
a b x
1 2 Just a test
2 10 Foo is a bar
+connection master;
INSERT INTO t9 VALUES (2);
+connection slave;
+connection master;
INSERT INTO t1_nodef VALUES (1,2);
+connection slave;
select count(*) from t1_nodef;
count(*)
1
+connection master;
INSERT INTO t9 VALUES (2);
-**** On Master ****
+connection slave;
+connection master;
INSERT INTO t2 VALUES (2,4);
SELECT * FROM t2;
a b
2 4
-**** On Slave ****
+connection slave;
SELECT * FROM t2;
a
2
include/check_slave_is_running.inc
+connection master;
INSERT INTO t9 VALUES (4);
+connection slave;
+connection master;
INSERT INTO t4 VALUES (4);
+connection slave;
call mtr.add_suppression("Slave SQL.*Table definition on master and slave does not match: Column [012] type mismatch.* error.* 1535");
call mtr.add_suppression("Slave SQL.*Column [0-9] of table .test.t[0-9]. cannot be converted from type.* error.* 1677");
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 0 of table 'test.t4' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (5);
+connection slave;
+connection master;
INSERT INTO t5 VALUES (5,10,25);
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 1 of table 'test.t5' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (6);
+connection slave;
+connection master;
INSERT INTO t6 VALUES (6,12,36);
+connection slave;
include/wait_for_slave_sql_error_and_skip.inc [errno=1677]
Last_SQL_Error = 'Column 2 of table 'test.t6' cannot be converted from type 'int' to type 'float''
+connection master;
INSERT INTO t9 VALUES (6);
+connection slave;
include/check_slave_is_running.inc
+connection master;
INSERT INTO t7 VALUES (1),(2),(3);
INSERT INTO t8 VALUES (1),(2),(3);
SELECT * FROM t7 ORDER BY a;
@@ -143,6 +168,7 @@ a
1
2
3
+connection slave;
SELECT * FROM t7 ORDER BY a;
a e1 e2 e3 e4 e5 e6 e7 e8
1 NULL NULL NULL NULL NULL NULL NULL NULL
@@ -153,37 +179,40 @@ a e1 e2 e3 e4 e5 e6 e7 e8
1 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0
-**** On Master ****
+connection master;
TRUNCATE t1_nodef;
SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1;
-**** On Slave ****
+connection slave;
+connection slave;
INSERT INTO t1_nodef VALUES (1,2,3,4,5);
INSERT INTO t1_nodef VALUES (2,4,6,8,10);
-**** On Master ****
+connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef ORDER BY a;
a b
1 4
2 4
-**** On Slave ****
+connection slave;
SELECT * FROM t1_nodef ORDER BY a;
a b x y z
1 4 3 4 5
2 4 6 8 10
-**** On Master ****
+connection master;
DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef ORDER BY a;
a b
1 4
-**** On Slave ****
+connection slave;
SELECT * FROM t1_nodef ORDER BY a;
a b x y z
1 4 3 4 5
**** Cleanup ****
+connection master;
DROP TABLE IF EXISTS t1_int,t1_bit,t1_char,t1_nodef;
DROP TABLE IF EXISTS t2,t3,t4,t5,t6,t7,t8,t9;
+connection slave;
SET @@global.sql_mode= @my_sql_mode;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result
index 5e7c3c94b14..19ca9b2c59e 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_set_null_tokudb.result
@@ -1,22 +1,34 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 BIT, c2 INT) Engine=TokuDB;
INSERT INTO `t1` VALUES ( 1, 1 );
UPDATE t1 SET c1=NULL where c2=1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DELETE FROM t1 WHERE c2=1 LIMIT 1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_reset.inc
+connection master;
CREATE TABLE t1 (c1 CHAR) Engine=TokuDB;
INSERT INTO t1 ( c1 ) VALUES ( 'w' ) ;
SELECT * FROM t1;
c1
w
UPDATE t1 SET c1=NULL WHERE c1='w';
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DELETE FROM t1 LIMIT 2;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result
index 63ca932bf57..9151f407548 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_stm_tokudb.result
@@ -1,5 +1,6 @@
include/master-slave.inc
[connection master]
+connection master;
CREATE TABLE t4 (
id INT(5) unsigned NOT NULL auto_increment,
name varchar(15) NOT NULL default '',
@@ -15,10 +16,12 @@ SELECT * FROM t4;
id name number
1 XXX 12345
2 XXY 12345
+connection slave;
SELECT * FROM t4;
id name number
1 XXX 12345
2 XXY 12345
+connection master;
LOAD DATA
INFILE '../../std_data/loaddata_pair.dat'
REPLACE INTO TABLE t4
@@ -27,18 +30,26 @@ SELECT * FROM t4;
id name number
4 XXX 12345
5 XXY 12345
+connection slave;
SELECT * FROM t4;
id name number
4 XXX 12345
5 XXY 12345
+connection master;
+connection slave;
+connection master;
FLUSH LOGS;
+connection slave;
FLUSH LOGS;
+connection master;
DROP DATABASE IF EXISTS mysqltest1;
CREATE DATABASE mysqltest1;
CREATE TEMPORARY TABLE mysqltest1.tmp (f1 BIGINT) ENGINE=InnoDB;
CREATE TABLE mysqltest1.t1 (f1 BIGINT) ENGINE="TokuDB";
SET AUTOCOMMIT = 0;
+connection slave;
-------- switch to slave --------
+connection slave;
ALTER TABLE mysqltest1.t1 ENGINE = MyISAM;
SHOW CREATE TABLE mysqltest1.t1;
Table Create Table
@@ -46,6 +57,7 @@ t1 CREATE TABLE `t1` (
`f1` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
-------- switch to master --------
+connection master;
INSERT INTO mysqltest1.t1 SET f1= 1;
DROP TEMPORARY TABLE mysqltest1.tmp;
ROLLBACK;
@@ -67,7 +79,9 @@ tmp2 CREATE TEMPORARY TABLE `tmp2` (
SELECT COUNT(*) FROM mysqltest1.t1;
COUNT(*)
0
+connection slave;
-------- switch to slave --------
+connection slave;
SHOW CREATE TABLE mysqltest1.tmp;
ERROR 42S02: Table 'mysqltest1.tmp' doesn't exist
SHOW CREATE TABLE mysqltest1.tmp2;
@@ -78,6 +92,7 @@ COUNT(*)
2
FLUSH LOGS;
-------- switch to master --------
+connection master;
FLUSH LOGS;
DROP TEMPORARY TABLE IF EXISTS mysqltest1.tmp2;
DROP DATABASE mysqltest1;
@@ -101,11 +116,15 @@ INSERT INTO t1 (b) VALUES (1),(2),(3);
BEGIN;
INSERT INTO t1(b) VALUES (4);
-------- switch to master1 --------
+connection master1;
RENAME TABLE t1 TO t3, t2 TO t1;;
-------- switch to master --------
+connection master;
COMMIT;
-------- switch to master1 --------
+connection master1;
-------- switch to master --------
+connection master;
SELECT * FROM t1;
id b
SELECT * FROM t3;
@@ -114,7 +133,9 @@ id b
2 2
3 3
4 4
+connection slave;
-------- switch to slave --------
+connection slave;
SELECT * FROM t1;
id b
SELECT * FROM t3;
@@ -124,6 +145,7 @@ id b
3 3
4 4
-------- switch to master --------
+connection master;
DROP TABLE t1;
DROP TABLE t3;
End of 6.0 tests
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result
index f5b84a27f72..7bde36ad5e3 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug28430.result
@@ -102,6 +102,8 @@ Master bykey 500
CALL test.proc_byrange();
SELECT count(*) as "Master byrange" FROM test.byrange_tbl;
Master byrange 500
+connection slave;
+connection slave;
show create table test.byrange_tbl;
Table byrange_tbl
Create Table CREATE TABLE `byrange_tbl` (
@@ -133,6 +135,7 @@ SELECT count(*) "Slave bykey" FROM test.bykey_tbl;
Slave bykey 500
SELECT count(*) "Slave byrange" FROM test.byrange_tbl;
Slave byrange 500
+connection master;
DROP PROCEDURE test.proc_norm;
DROP PROCEDURE test.proc_bykey;
DROP PROCEDURE test.proc_byrange;
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result
index ac9aa2460f7..f3ffc908504 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_bug30888.result
@@ -27,6 +27,8 @@ SET del_count = del_count - 2;
END WHILE;
END|
CALL test.proc_norm();
+connection slave;
+connection master;
DROP PROCEDURE test.proc_norm;
DROP TABLE test.regular_tbl;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result
index b5ceeba165c..d6d4aebd523 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_ddl.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-==========MASTER==========
+connection master;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -10,7 +10,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-==========SLAVE===========
+connection slave;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -20,6 +20,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
+connection master;
******************** DDL for database ********************
DROP DATABASE IF EXISTS test_rpl;
@@ -29,14 +30,14 @@ ALTER DATABASE test_rpl_1 CHARACTER SET latin1 COLLATE latin1_general_ci;
DROP DATABASE test_rpl_1;
CREATE DATABASE test_rpl CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER DATABASE test_rpl CHARACTER SET latin1 COLLATE latin1_swedish_ci;
-==========MASTER==========
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
-==========SLAVE===========
+connection slave;
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
+connection master;
USE test_rpl;
******************** DDL for tables ********************
@@ -47,7 +48,6 @@ ALTER TABLE t0 ADD INDEX index1 (b);
ALTER TABLE t0 DROP COLUMN c;
RENAME TABLE t0 TO t1;
CREATE TABLE t2 LIKE t1;
-==========MASTER==========
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -64,7 +64,7 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`),
KEY `index1` (`b`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE TABLE t1;
Table Create Table
@@ -82,12 +82,12 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`),
KEY `index1` (`b`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection master;
******************** DDL for indexes ********************
ALTER TABLE t2 ADD COLUMN d datetime;
CREATE INDEX index2 on t2 (d);
CREATE INDEX index3 on t2 (a, d);
-==========MASTER==========
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
@@ -107,7 +107,7 @@ t2 CREATE TABLE `t2` (
KEY `index2` (`d`),
KEY `index3` (`a`,`d`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE TABLE t1;
Table Create Table
@@ -128,6 +128,7 @@ t2 CREATE TABLE `t2` (
KEY `index2` (`d`),
KEY `index3` (`a`,`d`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection master;
ALTER TABLE t2 DROP COLUMN d;
@@ -170,5 +171,8 @@ master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; CREATE INDEX index3 on t2 (a, d)
master-bin.000001 # Gtid # # GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; ALTER TABLE t2 DROP COLUMN d
+connection slave;
+connection master;
drop database test_rpl;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
index 30c3d188f9a..75e2e61a363 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_mixed_dml.result
@@ -1,6 +1,6 @@
include/master-slave.inc
[connection master]
-==========MASTER==========
+connection master;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -10,7 +10,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
-==========SLAVE===========
+connection slave;
show global variables like 'binlog_format%';
Variable_name Value
binlog_format MIXED
@@ -20,6 +20,7 @@ binlog_format MIXED
select @@global.binlog_format, @@session.binlog_format;
@@global.binlog_format @@session.binlog_format
MIXED MIXED
+connection master;
CREATE DATABASE test_rpl;
******************** PREPARE TESTING ********************
@@ -33,7 +34,6 @@ INSERT INTO t2 VALUES(1, 't2, text 1');
******************** DELETE ********************
DELETE FROM t1 WHERE a = 1;
DELETE FROM t2 WHERE b <> UUID();
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -45,7 +45,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -58,6 +58,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -68,7 +69,6 @@ INSERT INTO t2 SELECT * FROM t1;
INSERT INTO t2 VALUES (1, 't1, text 1') ON DUPLICATE KEY UPDATE b = 't2, text 1';
DELETE FROM t1 WHERE a = 2;
DELETE FROM t2 WHERE a = 2;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -81,7 +81,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -95,6 +95,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -105,7 +106,6 @@ a b
10 line A
20 line B
30 line C
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
3
@@ -119,7 +119,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -134,6 +134,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -145,7 +146,6 @@ REPLACE INTO t1 VALUES(1, 't1, text 11');
REPLACE INTO t1 VALUES(2, UUID());
REPLACE INTO t1 SET a=3, b='t1, text 33';
DELETE FROM t1 WHERE a = 2;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
2
@@ -158,7 +158,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -172,6 +172,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -211,7 +212,6 @@ DELETE FROM t2;
******************** TRUNCATE ********************
INSERT INTO t1 VALUES(1, 't1, text 1');
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -223,7 +223,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -236,8 +236,8 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
TRUNCATE t1;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
0
@@ -248,7 +248,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -260,6 +260,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -267,7 +268,6 @@ DELETE FROM t2;
INSERT INTO t1 VALUES(1, 't1, text 1');
INSERT INTO t2 VALUES(1, 't2, text 1');
UPDATE t1 SET b = 't1, text 1 updated' WHERE a = 1;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -280,7 +280,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -294,8 +294,8 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 t2, text 1
+connection master;
UPDATE t1, t2 SET t1.b = 'test', t2.b = 'test';
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -308,7 +308,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -322,6 +322,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -341,7 +342,6 @@ USE test_rpl;
START TRANSACTION;
INSERT INTO t1 VALUES (1, 'start');
COMMIT;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -353,7 +353,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -366,10 +366,10 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (2, 'rollback');
ROLLBACK;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -381,7 +381,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -394,12 +394,12 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (3, 'before savepoint s1');
SAVEPOINT s1;
INSERT INTO t1 VALUES (4, 'after savepoint s1');
ROLLBACK TO SAVEPOINT s1;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
2
@@ -412,7 +412,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -425,6 +425,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
START TRANSACTION;
INSERT INTO t1 VALUES (5, 'before savepoint s2');
SAVEPOINT s2;
@@ -433,7 +434,6 @@ INSERT INTO t1 VALUES (7, CONCAT('with UUID() ',UUID()));
RELEASE SAVEPOINT s2;
COMMIT;
DELETE FROM t1 WHERE a = 7;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
4
@@ -448,7 +448,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -464,6 +464,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -479,73 +480,73 @@ SET TRANSACTION ISOLATION LEVEL SERIALIZABLE;
******************** CREATE USER ********************
CREATE USER 'user_test_rpl'@'localhost' IDENTIFIED BY PASSWORD '*1111111111111111111111111111111111111111';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
+connection master;
******************** GRANT ********************
GRANT SELECT ON *.* TO 'user_test_rpl'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 Y
+connection master;
******************** REVOKE ********************
REVOKE SELECT ON *.* FROM 'user_test_rpl'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *1111111111111111111111111111111111111111 N
+connection master;
******************** SET PASSWORD ********************
SET PASSWORD FOR 'user_test_rpl'@'localhost' = '*0000000000000000000000000000000000000000';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *0000000000000000000000000000000000000000 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl *0000000000000000000000000000000000000000 N
+connection master;
******************** RENAME USER ********************
RENAME USER 'user_test_rpl'@'localhost' TO 'user_test_rpl_2'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
localhost user_test_rpl_2 *0000000000000000000000000000000000000000 N
+connection master;
******************** DROP USER ********************
DROP USER 'user_test_rpl_2'@'localhost';
-==========MASTER==========
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT host, user, password, select_priv FROM mysql.user WHERE user LIKE 'user_test_rpl%';
host user password select_priv
+connection master;
INSERT INTO t1 VALUES(100, 'test');
******************** ANALYZE ********************
@@ -580,14 +581,14 @@ SHOW VARIABLES LIKE 'test_rpl_var';
Variable_name Value
******************** SHOW ********************
-==========MASTER==========
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
-==========SLAVE===========
+connection slave;
SHOW DATABASES LIKE 'test_rpl%';
Database (test_rpl%)
test_rpl
+connection master;
******************** PROCEDURE ********************
CREATE PROCEDURE p1 ()
@@ -603,7 +604,6 @@ CALL p1();
INSERT INTO t1 VALUES(202, 'test 202');
CALL p2();
DELETE FROM t1 WHERE a = 202;
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
2
@@ -616,7 +616,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -630,6 +630,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
ALTER PROCEDURE p1 COMMENT 'p1';
DROP PROCEDURE p1;
DROP PROCEDURE p2;
@@ -642,7 +643,6 @@ FOR EACH ROW BEGIN
INSERT INTO t2 SET a = NEW.a, b = NEW.b;
END|
INSERT INTO t1 VALUES (1, 'test');
-==========MASTER==========
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -655,7 +655,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -669,6 +669,7 @@ COUNT(*)
SELECT * FROM t2 ORDER BY a;
a b
1 test
+connection master;
DELETE FROM t1;
DELETE FROM t2;
DROP TRIGGER tr1;
@@ -678,16 +679,15 @@ DROP TRIGGER tr1;
GRANT EVENT ON *.* TO 'root'@'localhost';
INSERT INTO t1 VALUES(1, 'test1');
CREATE EVENT e1 ON SCHEDULE EVERY '1' SECOND COMMENT 'e_second_comment' DO DELETE FROM t1;
-==========MASTER==========
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e1 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========MASTER==========
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -699,7 +699,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -712,7 +712,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========MASTER==========
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -724,7 +724,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -737,17 +737,17 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
ALTER EVENT e1 RENAME TO e2;
-==========MASTER==========
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL ENABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
test_rpl e2 root@localhost SYSTEM RECURRING NULL 1 # # NULL SLAVESIDE_DISABLED 1 latin1 latin1_swedish_ci latin1_swedish_ci
-==========MASTER==========
+connection master;
SELECT COUNT(*) FROM t1;
COUNT(*)
1
@@ -759,7 +759,7 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
-==========SLAVE===========
+connection slave;
USE test_rpl;
SELECT COUNT(*) FROM t1;
COUNT(*)
@@ -772,14 +772,15 @@ COUNT(*)
0
SELECT * FROM t2 ORDER BY a;
a b
+connection master;
DROP EVENT e2;
-==========MASTER==========
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW EVENTS;
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
+connection master;
DELETE FROM t1;
DELETE FROM t2;
@@ -788,14 +789,13 @@ INSERT INTO t1 VALUES(1, 'test1');
INSERT INTO t1 VALUES(2, 'test2');
CREATE VIEW v1 AS SELECT * FROM t1 WHERE a = 1;
CREATE VIEW v2 AS SELECT * FROM t1 WHERE b <> UUID();
-==========MASTER==========
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 1) latin1 latin1_swedish_ci
SELECT * FROM v1 ORDER BY a;
a b
1 test1
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@@ -803,15 +803,15 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM v1 ORDER BY a;
a b
1 test1
+connection master;
ALTER VIEW v1 AS SELECT * FROM t1 WHERE a = 2;
-==========MASTER==========
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b` from `t1` where (`t1`.`a` = 2) latin1 latin1_swedish_ci
SELECT * FROM v1 ORDER BY a;
a b
2 test2
-==========SLAVE===========
+connection slave;
USE test_rpl;
SHOW CREATE VIEW v1;
View Create View character_set_client collation_connection
@@ -819,6 +819,7 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VI
SELECT * FROM v1 ORDER BY a;
a b
2 test2
+connection master;
DROP VIEW v1;
DROP VIEW v2;
DELETE FROM t1;
@@ -1128,5 +1129,8 @@ master-bin.000001 # Xid # # COMMIT /* XID */
master-bin.000001 # Gtid # # BEGIN GTID #-#-#
master-bin.000001 # Query # # use `test_rpl`; DELETE FROM t2
master-bin.000001 # Xid # # COMMIT /* XID */
+connection slave;
+connection master;
drop database test_rpl;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result
index 3bcd3e8ccdd..dc6200117fd 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_tokudb_read_only_ft.result
@@ -1,14 +1,23 @@
include/master-slave.inc
[connection master]
+connection master;
drop table if exists t;
+connection slave;
+connection master;
create table t (a bigint not null, primary key(a)) engine=tokudb;
select unix_timestamp() into @tstart;
insert into t values (1);
insert into t values (2),(3);
insert into t values (4);
+connection slave;
+connection master;
select unix_timestamp()-@tstart <= 10;
unix_timestamp()-@tstart <= 10
0
+connection slave;
+connection master;
include/diff_tables.inc [master:test.t, slave:test.t]
+connection master;
drop table if exists t;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result
index 5915abe9e94..5d3737817a1 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_truncate_3tokudb.result
@@ -1,35 +1,47 @@
include/master-slave.inc
[connection master]
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT, b LONG) ENGINE=TokuDB;
INSERT INTO t1 VALUES (1,1), (2,2);
-**** On Master ****
+connection slave;
+connection master;
TRUNCATE TABLE t1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
-**** On Master ****
+connection master;
SET @count := 1;
CREATE TABLE t2 (a INT, b LONG) ENGINE=TokuDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
-**** On Master ****
+connection slave;
+connection master;
TRUNCATE TABLE t1;
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
+connection slave;
include/rpl_reset.inc
-**** On Master ****
+connection master;
CREATE TABLE t1 (a INT, b LONG) ENGINE=TokuDB;
INSERT INTO t1 VALUES (1,1), (2,2);
-**** On Master ****
+connection slave;
+connection master;
DELETE FROM t1;
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
==== Test using a table with delete triggers ====
-**** On Master ****
+connection master;
SET @count := 1;
CREATE TABLE t2 (a INT, b LONG) ENGINE=TokuDB;
CREATE TRIGGER trg1 BEFORE DELETE ON t1 FOR EACH ROW SET @count := @count + 1;
-**** On Master ****
+connection slave;
+connection master;
DELETE FROM t1;
+connection slave;
include/diff_tables.inc [master:t2, slave:t2]
+connection master;
DROP TABLE t1,t2;
+connection slave;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result b/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result
index daceec6180a..636792ce4db 100644
--- a/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result
+++ b/storage/tokudb/mysql-test/rpl/r/rpl_typeconv_tokudb.result
@@ -1,10 +1,15 @@
include/master-slave.inc
[connection master]
+connection slave;
SET @saved_slave_type_conversions = @@GLOBAL.SLAVE_TYPE_CONVERSIONS;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = '';
+connection master;
CREATE TABLE t1(b1 BIT(1), b2 BIT(2), b3 BIT(3)) ENGINE=TokuDB;
INSERT INTO t1 VALUES (b'0', b'01', b'101');
+connection slave;
include/diff_tables.inc [master:t1, slave:t1]
+connection master;
DROP TABLE t1;
+connection slave;
SET GLOBAL SLAVE_TYPE_CONVERSIONS = @saved_slave_type_conversions;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result b/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result
index 78a66421446..aa95091b40b 100644
--- a/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result
+++ b/storage/tokudb/mysql-test/rpl/r/tokudb_innodb_xa_crash.result
@@ -2,12 +2,15 @@ include/master-slave.inc
[connection master]
CREATE TABLE t1(`a` INT) ENGINE=TokuDB;
CREATE TABLE t2(`a` INT) ENGINE=InnoDB;
+connection master;
begin;
insert into t1 values (1);
insert into t2 values (1);
commit;
+connection slave;
TABLES t1 and t2 must be equal otherwise an error will be thrown.
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
+connection master;
drop table t1,t2;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-0.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-0.result
index 6e6874f6d8b..9cec96096e0 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-0.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-0.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
insert into s values (10000,0),(10000,1),(10000,2),(10000,3),(10000,4),(10000,5),(10000,6),(10000,7),(10000,8),(10000,9);
@@ -10004,6 +10006,7 @@ insert into s values (2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9)
insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9);
set tokudb_create_index_online=1;
create index i_a on s(a);
+connection conn1;
delete from s where a=10000;
delete from s where a=9999;
delete from s where a=9998;
@@ -20004,10 +20007,12 @@ delete from s where a=4;
delete from s where a=3;
delete from s where a=2;
delete from s where a=1;
+connection default;
select count(*) from s use index();
count(*)
0
select count(*) from s use index(i_a);
count(*)
0
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-1.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-1.result
index a45809b719a..112a09c9a69 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-1.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
begin;
@@ -10006,6 +10008,7 @@ insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9)
commit;
set tokudb_create_index_online=1;
create index i_a on s(a) clustering=yes;
+connection conn1;
delete from s where a=10000;
delete from s where a=9999;
delete from s where a=9998;
@@ -20006,10 +20009,12 @@ delete from s where a=4;
delete from s where a=3;
delete from s where a=2;
delete from s where a=1;
+connection default;
select count(*) from s use index();
count(*)
0
select count(*) from s use index(i_a);
count(*)
0
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-fast.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-fast.result
index ecb2d225181..b6ca720e135 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-fast.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-fast.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
insert into s values (10000,0),(10000,1),(10000,2),(10000,3),(10000,4),(10000,5),(10000,6),(10000,7),(10000,8),(10000,9);
@@ -10003,6 +10005,7 @@ insert into s values (3,0),(3,1),(3,2),(3,3),(3,4),(3,5),(3,6),(3,7),(3,8),(3,9)
insert into s values (2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9);
insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9);
create index i_a on s(a);
+connection conn1;
delete from s where a=10000;
show create table s;
Table Create Table
@@ -90003,10 +90006,12 @@ s CREATE TABLE `s` (
`b` int(11) DEFAULT NULL,
KEY `i_a` (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection default;
select count(*) from s use index();
count(*)
0
select count(*) from s use index(i_a);
count(*)
0
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-slow.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-slow.result
index e1e298eb29f..0ef9595d546 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-del-slow.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-del-slow.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
insert into s values (10000,0),(10000,1),(10000,2),(10000,3),(10000,4),(10000,5),(10000,6),(10000,7),(10000,8),(10000,9);
@@ -10004,6 +10006,7 @@ insert into s values (2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9)
insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9);
set tokudb_create_index_online=1;
create index i_a on s(a);
+connection conn1;
delete from s where a=10000;
show create table s;
Table Create Table
@@ -90004,10 +90007,12 @@ s CREATE TABLE `s` (
`b` int(11) DEFAULT NULL,
KEY `i_a` (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection default;
select count(*) from s use index();
count(*)
0
select count(*) from s use index(i_a);
count(*)
0
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-0.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-0.result
index 78515053ff6..cff2c3b705a 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-0.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-0.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
insert into s values (10000,0),(10000,1),(10000,2),(10000,3),(10000,4),(10000,5),(10000,6),(10000,7),(10000,8),(10000,9);
@@ -10004,6 +10006,7 @@ insert into s values (2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9)
insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9);
set tokudb_create_index_online=1;
create index i_a on s(a);
+connection conn1;
insert into s values (1000000000,10000);
insert into s values (1000000000,9999);
insert into s values (1000000000,9998);
@@ -20004,10 +20007,12 @@ insert into s values (1000000000,4);
insert into s values (1000000000,3);
insert into s values (1000000000,2);
insert into s values (1000000000,1);
+connection default;
select count(*) from s use index();
count(*)
110000
select count(*) from s use index(i_a);
count(*)
110000
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-1.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-1.result
index 4d2e5ed6b76..51803eb956b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-1.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
begin;
@@ -10006,6 +10008,7 @@ insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9)
commit;
set tokudb_create_index_online=1;
create index i_a on s(a) clustering=yes;
+connection conn1;
insert into s values (1000000000,10000);
insert into s values (1000000000,9999);
insert into s values (1000000000,9998);
@@ -20006,10 +20009,12 @@ insert into s values (1000000000,4);
insert into s values (1000000000,3);
insert into s values (1000000000,2);
insert into s values (1000000000,1);
+connection default;
select count(*) from s use index();
count(*)
110000
select count(*) from s use index(i_a);
count(*)
110000
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-2.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-2.result
index 1c8b7df1ebd..927a321972f 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-2.result
@@ -1,17 +1,22 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int auto_increment, b int, c int, primary key (a));
# populate table s
# done inserting elements
set tokudb_create_index_online=1;
create index i_a on s(c);
+connection conn1;
# starting insert while create index is happening
# done with insert
+connection default;
select count(*) from s use index(primary);
count(*)
100000
select count(*) from s use index(i_a);
count(*)
100000
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-bigchar.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-bigchar.result
index e250e9a3c7a..c0b293edb22 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-bigchar.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-insert-bigchar.result
@@ -1,9 +1,12 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b varchar(2000));
set tokudb_create_index_online=1;
create index i_a on s(b) clustering=yes;
+connection conn1;
insert into s values (1000000000,repeat('a', 2000));
insert into s values (1000000000,repeat('a', 2000));
insert into s values (1000000000,repeat('a', 2000));
@@ -10004,10 +10007,12 @@ insert into s values (1000000000,repeat('a', 2000));
insert into s values (1000000000,repeat('a', 2000));
insert into s values (1000000000,repeat('a', 2000));
insert into s values (1000000000,repeat('a', 2000));
+connection default;
select count(*) from s use index();
count(*)
110000
select count(*) from s use index(i_a);
count(*)
110000
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-update-0.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-update-0.result
index 8ec9af009bb..5a82eb269f0 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-update-0.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-update-0.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
insert into s values (10000,0),(10000,1),(10000,2),(10000,3),(10000,4),(10000,5),(10000,6),(10000,7),(10000,8),(10000,9);
@@ -10004,6 +10006,7 @@ insert into s values (2,0),(2,1),(2,2),(2,3),(2,4),(2,5),(2,6),(2,7),(2,8),(2,9)
insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9);
set tokudb_create_index_online=1;
create index i_a on s(a);
+connection conn1;
update s set a=20000+10000 where a=10000;
update s set a=20000+9999 where a=9999;
update s set a=20000+9998 where a=9998;
@@ -20004,4 +20007,6 @@ update s set a=20000+4 where a=4;
update s set a=20000+3 where a=3;
update s set a=20000+2 where a=2;
update s set a=20000+1 where a=1;
+connection default;
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/hotindex-update-1.result b/storage/tokudb/mysql-test/tokudb/r/hotindex-update-1.result
index 7561c61f10b..d27ce0d2c9a 100644
--- a/storage/tokudb/mysql-test/tokudb/r/hotindex-update-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/hotindex-update-1.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
drop table if exists s;
create table s (a int, b int);
begin;
@@ -10006,6 +10008,7 @@ insert into s values (1,0),(1,1),(1,2),(1,3),(1,4),(1,5),(1,6),(1,7),(1,8),(1,9)
commit;
set tokudb_create_index_online=1;
create index i_a on s(a) clustering=yes;
+connection conn1;
update s set a=20000+10000 where a=10000;
update s set a=20000+9999 where a=9999;
update s set a=20000+9998 where a=9998;
@@ -20006,4 +20009,6 @@ update s set a=20000+4 where a=4;
update s set a=20000+3 where a=3;
update s set a=20000+2 where a=2;
update s set a=20000+1 where a=1;
+connection default;
+disconnect conn1;
drop table s;
diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result
index 13cdad7a438..379cdf90990 100644
--- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result
+++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result
@@ -8,11 +8,14 @@ select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
+connect conn_a,localhost,root,,;
set autocommit=0;
set tokudb_prelock_empty=OFF;
insert into t values (1);
+connect conn_b,localhost,root,,;
set autocommit=0;
insert into t values (1);
+connection default;
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
@@ -23,13 +26,18 @@ select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TRX_ID MYSQL_ID
TRX_ID MYSQL_ID
+connection conn_a;
commit;
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
+connection conn_b;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
+connection default;
+disconnect conn_a;
+disconnect conn_b;
select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result
index a07f7ba52fe..83949d632c3 100644
--- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result
+++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_locks.result
@@ -8,10 +8,12 @@ locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right lo
insert into t values (1);
insert into t values (3);
insert into t values (5);
+connect conn_a,localhost,root,,;
set autocommit=0;
insert into t values (2);
insert into t values (4);
insert into t values (6);
+connection default;
select * from information_schema.tokudb_locks order by locks_trx_id,locks_key_left;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
@@ -20,9 +22,12 @@ TRX_ID MYSQL_ID ./test/t-main 0005000000 0005000000 test t main
TRX_ID MYSQL_ID ./test/t-main 0002000000 0002000000 test t main
TRX_ID MYSQL_ID ./test/t-main 0004000000 0004000000 test t main
TRX_ID MYSQL_ID ./test/t-main 0006000000 0006000000 test t main
+connection conn_a;
commit;
+connection default;
commit;
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
commit;
+disconnect conn_a;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result
index 63e4816e16e..8dc79147cfc 100644
--- a/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result
+++ b/storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result
@@ -12,12 +12,17 @@ TXN_ID_DEFAULT CLIENT_ID_DEFAULT
commit;
select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
+connect conn_a,localhost,root,,;
set autocommit=0;
insert into t values (2);
+connection default;
select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TXN_ID_A CLIENT_ID_A
+connection conn_a;
commit;
+connection default;
select trx_id,trx_mysql_thread_id from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
+disconnect conn_a;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/lockretry-insert.writelocktable.result b/storage/tokudb/mysql-test/tokudb/r/lockretry-insert.writelocktable.result
index 439c032639d..072c7769f69 100644
--- a/storage/tokudb/mysql-test/tokudb/r/lockretry-insert.writelocktable.result
+++ b/storage/tokudb/mysql-test/tokudb/r/lockretry-insert.writelocktable.result
@@ -1,5004 +1,9008 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=TokuDB;
+connect conn1,localhost,root,,;
+connection default;
SET AUTOCOMMIT=OFF;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (1000);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (999);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (998);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (997);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (996);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (995);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (994);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (993);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (992);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (991);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (990);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (989);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (988);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (987);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (986);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (985);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (984);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (983);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (982);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (981);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (980);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (979);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (978);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (977);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (976);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (975);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (974);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (973);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (972);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (971);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (970);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (969);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (968);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (967);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (966);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (965);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (964);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (963);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (962);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (961);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (960);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (959);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (958);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (957);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (956);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (955);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (954);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (953);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (952);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (951);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (950);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (949);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (948);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (947);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (946);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (945);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (944);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (943);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (942);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (941);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (940);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (939);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (938);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (937);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (936);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (935);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (934);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (933);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (932);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (931);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (930);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (929);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (928);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (927);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (926);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (925);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (924);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (923);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (922);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (921);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (920);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (919);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (918);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (917);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (916);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (915);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (914);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (913);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (912);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (911);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (910);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (909);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (908);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (907);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (906);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (905);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (904);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (903);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (902);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (901);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (900);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (899);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (898);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (897);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (896);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (895);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (894);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (893);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (892);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (891);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (890);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (889);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (888);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (887);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (886);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (885);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (884);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (883);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (882);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (881);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (880);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (879);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (878);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (877);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (876);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (875);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (874);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (873);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (872);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (871);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (870);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (869);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (868);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (867);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (866);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (865);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (864);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (863);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (862);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (861);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (860);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (859);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (858);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (857);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (856);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (855);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (854);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (853);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (852);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (851);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (850);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (849);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (848);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (847);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (846);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (845);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (844);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (843);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (842);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (841);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (840);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (839);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (838);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (837);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (836);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (835);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (834);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (833);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (832);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (831);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (830);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (829);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (828);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (827);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (826);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (825);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (824);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (823);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (822);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (821);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (820);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (819);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (818);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (817);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (816);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (815);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (814);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (813);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (812);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (811);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (810);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (809);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (808);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (807);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (806);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (805);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (804);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (803);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (802);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (801);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (800);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (799);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (798);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (797);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (796);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (795);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (794);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (793);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (792);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (791);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (790);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (789);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (788);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (787);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (786);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (785);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (784);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (783);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (782);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (781);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (780);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (779);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (778);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (777);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (776);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (775);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (774);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (773);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (772);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (771);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (770);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (769);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (768);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (767);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (766);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (765);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (764);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (763);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (762);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (761);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (760);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (759);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (758);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (757);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (756);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (755);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (754);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (753);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (752);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (751);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (750);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (749);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (748);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (747);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (746);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (745);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (744);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (743);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (742);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (741);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (740);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (739);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (738);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (737);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (736);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (735);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (734);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (733);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (732);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (731);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (730);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (729);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (728);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (727);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (726);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (725);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (724);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (723);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (722);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (721);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (720);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (719);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (718);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (717);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (716);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (715);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (714);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (713);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (712);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (711);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (710);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (709);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (708);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (707);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (706);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (705);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (704);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (703);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (702);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (701);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (700);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (699);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (698);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (697);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (696);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (695);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (694);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (693);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (692);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (691);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (690);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (689);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (688);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (687);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (686);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (685);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (684);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (683);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (682);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (681);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (680);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (679);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (678);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (677);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (676);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (675);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (674);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (673);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (672);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (671);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (670);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (669);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (668);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (667);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (666);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (665);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (664);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (663);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (662);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (661);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (660);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (659);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (658);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (657);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (656);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (655);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (654);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (653);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (652);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (651);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (650);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (649);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (648);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (647);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (646);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (645);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (644);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (643);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (642);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (641);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (640);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (639);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (638);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (637);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (636);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (635);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (634);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (633);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (632);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (631);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (630);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (629);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (628);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (627);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (626);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (625);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (624);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (623);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (622);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (621);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (620);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (619);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (618);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (617);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (616);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (615);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (614);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (613);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (612);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (611);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (610);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (609);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (608);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (607);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (606);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (605);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (604);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (603);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (602);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (601);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (600);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (599);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (598);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (597);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (596);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (595);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (594);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (593);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (592);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (591);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (590);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (589);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (588);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (587);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (586);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (585);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (584);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (583);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (582);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (581);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (580);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (579);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (578);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (577);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (576);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (575);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (574);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (573);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (572);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (571);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (570);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (569);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (568);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (567);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (566);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (565);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (564);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (563);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (562);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (561);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (560);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (559);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (558);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (557);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (556);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (555);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (554);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (553);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (552);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (551);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (550);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (549);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (548);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (547);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (546);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (545);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (544);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (543);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (542);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (541);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (540);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (539);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (538);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (537);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (536);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (535);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (534);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (533);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (532);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (531);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (530);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (529);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (528);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (527);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (526);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (525);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (524);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (523);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (522);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (521);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (520);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (519);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (518);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (517);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (516);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (515);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (514);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (513);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (512);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (511);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (510);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (509);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (508);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (507);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (506);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (505);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (504);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (503);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (502);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (501);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (500);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (499);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (498);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (497);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (496);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (495);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (494);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (493);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (492);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (491);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (490);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (489);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (488);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (487);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (486);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (485);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (484);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (483);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (482);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (481);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (480);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (479);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (478);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (477);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (476);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (475);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (474);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (473);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (472);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (471);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (470);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (469);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (468);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (467);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (466);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (465);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (464);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (463);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (462);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (461);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (460);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (459);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (458);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (457);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (456);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (455);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (454);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (453);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (452);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (451);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (450);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (449);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (448);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (447);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (446);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (445);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (444);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (443);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (442);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (441);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (440);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (439);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (438);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (437);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (436);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (435);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (434);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (433);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (432);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (431);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (430);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (429);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (428);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (427);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (426);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (425);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (424);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (423);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (422);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (421);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (420);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (419);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (418);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (417);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (416);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (415);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (414);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (413);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (412);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (411);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (410);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (409);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (408);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (407);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (406);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (405);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (404);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (403);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (402);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (401);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (400);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (399);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (398);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (397);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (396);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (395);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (394);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (393);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (392);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (391);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (390);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (389);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (388);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (387);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (386);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (385);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (384);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (383);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (382);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (381);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (380);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (379);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (378);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (377);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (376);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (375);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (374);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (373);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (372);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (371);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (370);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (369);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (368);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (367);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (366);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (365);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (364);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (363);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (362);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (361);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (360);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (359);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (358);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (357);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (356);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (355);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (354);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (353);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (352);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (351);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (350);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (349);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (348);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (347);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (346);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (345);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (344);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (343);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (342);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (341);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (340);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (339);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (338);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (337);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (336);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (335);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (334);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (333);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (332);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (331);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (330);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (329);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (328);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (327);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (326);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (325);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (324);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (323);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (322);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (321);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (320);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (319);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (318);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (317);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (316);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (315);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (314);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (313);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (312);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (311);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (310);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (309);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (308);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (307);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (306);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (305);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (304);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (303);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (302);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (301);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (300);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (299);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (298);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (297);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (296);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (295);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (294);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (293);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (292);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (291);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (290);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (289);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (288);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (287);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (286);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (285);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (284);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (283);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (282);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (281);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (280);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (279);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (278);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (277);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (276);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (275);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (274);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (273);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (272);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (271);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (270);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (269);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (268);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (267);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (266);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (265);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (264);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (263);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (262);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (261);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (260);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (259);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (258);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (257);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (256);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (255);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (254);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (253);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (252);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (251);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (250);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (249);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (248);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (247);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (246);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (245);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (244);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (243);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (242);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (241);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (240);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (239);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (238);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (237);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (236);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (235);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (234);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (233);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (232);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (231);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (230);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (229);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (228);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (227);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (226);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (225);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (224);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (223);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (222);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (221);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (220);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (219);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (218);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (217);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (216);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (215);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (214);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (213);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (212);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (211);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (210);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (209);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (208);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (207);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (206);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (205);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (204);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (203);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (202);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (201);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (200);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (199);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (198);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (197);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (196);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (195);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (194);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (193);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (192);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (191);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (190);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (189);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (188);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (187);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (186);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (185);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (184);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (183);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (182);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (181);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (180);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (179);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (178);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (177);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (176);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (175);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (174);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (173);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (172);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (171);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (170);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (169);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (168);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (167);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (166);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (165);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (164);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (163);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (162);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (161);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (160);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (159);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (158);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (157);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (156);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (155);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (154);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (153);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (152);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (151);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (150);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (149);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (148);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (147);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (146);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (145);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (144);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (143);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (142);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (141);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (140);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (139);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (138);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (137);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (136);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (135);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (134);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (133);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (132);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (131);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (130);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (129);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (128);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (127);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (126);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (125);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (124);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (123);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (122);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (121);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (120);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (119);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (118);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (117);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (116);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (115);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (114);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (113);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (112);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (111);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (110);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (109);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (108);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (107);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (106);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (105);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (104);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (103);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (102);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (101);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (100);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (99);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (98);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (97);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (96);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (95);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (94);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (93);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (92);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (91);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (90);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (89);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (88);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (87);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (86);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (85);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (84);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (83);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (82);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (81);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (80);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (79);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (78);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (77);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (76);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (75);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (74);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (73);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (72);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (71);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (70);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (69);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (68);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (67);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (66);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (65);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (64);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (63);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (62);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (61);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (60);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (59);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (58);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (57);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (56);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (55);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (54);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (53);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (52);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (51);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (50);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (49);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (48);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (47);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (46);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (45);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (44);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (43);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (42);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (41);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (40);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (39);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (38);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (37);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (36);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (35);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (34);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (33);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (32);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (31);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (30);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (29);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (28);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (27);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (26);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (25);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (24);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (23);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (22);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (21);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (20);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (19);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (18);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (17);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (16);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (15);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (14);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (13);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (12);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (11);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (10);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (9);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (8);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (7);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (6);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (5);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (4);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (3);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (2);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+connection default;
BEGIN;
INSERT INTO t1 VALUES (1);
+connection conn1;
LOCK TABLES t1 WRITE;
+connection default;
COMMIT;
+connection conn1;
UNLOCK TABLES;
+disconnect conn1;
+connection default;
DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert.result b/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert.result
index d8dad90efdc..7a25b98e52e 100644
--- a/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert.result
+++ b/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert.result
@@ -1,3003 +1,7006 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=TokuDB;
+connect conn1,localhost,root,,;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (1000);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (999);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (998);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (997);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (996);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (995);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (994);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (993);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (992);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (991);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (990);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (989);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (988);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (987);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (986);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (985);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (984);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (983);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (982);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (981);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (980);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (979);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (978);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (977);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (976);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (975);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (974);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (973);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (972);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (971);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (970);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (969);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (968);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (967);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (966);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (965);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (964);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (963);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (962);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (961);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (960);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (959);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (958);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (957);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (956);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (955);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (954);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (953);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (952);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (951);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (950);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (949);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (948);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (947);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (946);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (945);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (944);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (943);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (942);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (941);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (940);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (939);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (938);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (937);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (936);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (935);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (934);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (933);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (932);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (931);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (930);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (929);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (928);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (927);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (926);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (925);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (924);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (923);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (922);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (921);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (920);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (919);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (918);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (917);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (916);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (915);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (914);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (913);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (912);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (911);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (910);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (909);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (908);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (907);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (906);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (905);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (904);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (903);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (902);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (901);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (900);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (899);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (898);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (897);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (896);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (895);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (894);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (893);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (892);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (891);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (890);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (889);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (888);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (887);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (886);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (885);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (884);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (883);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (882);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (881);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (880);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (879);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (878);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (877);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (876);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (875);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (874);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (873);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (872);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (871);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (870);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (869);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (868);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (867);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (866);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (865);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (864);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (863);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (862);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (861);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (860);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (859);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (858);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (857);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (856);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (855);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (854);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (853);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (852);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (851);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (850);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (849);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (848);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (847);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (846);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (845);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (844);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (843);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (842);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (841);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (840);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (839);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (838);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (837);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (836);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (835);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (834);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (833);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (832);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (831);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (830);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (829);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (828);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (827);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (826);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (825);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (824);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (823);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (822);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (821);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (820);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (819);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (818);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (817);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (816);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (815);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (814);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (813);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (812);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (811);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (810);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (809);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (808);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (807);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (806);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (805);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (804);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (803);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (802);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (801);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (800);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (799);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (798);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (797);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (796);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (795);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (794);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (793);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (792);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (791);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (790);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (789);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (788);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (787);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (786);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (785);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (784);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (783);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (782);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (781);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (780);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (779);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (778);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (777);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (776);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (775);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (774);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (773);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (772);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (771);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (770);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (769);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (768);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (767);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (766);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (765);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (764);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (763);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (762);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (761);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (760);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (759);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (758);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (757);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (756);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (755);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (754);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (753);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (752);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (751);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (750);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (749);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (748);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (747);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (746);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (745);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (744);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (743);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (742);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (741);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (740);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (739);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (738);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (737);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (736);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (735);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (734);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (733);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (732);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (731);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (730);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (729);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (728);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (727);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (726);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (725);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (724);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (723);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (722);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (721);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (720);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (719);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (718);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (717);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (716);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (715);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (714);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (713);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (712);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (711);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (710);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (709);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (708);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (707);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (706);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (705);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (704);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (703);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (702);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (701);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (700);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (699);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (698);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (697);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (696);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (695);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (694);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (693);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (692);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (691);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (690);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (689);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (688);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (687);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (686);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (685);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (684);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (683);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (682);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (681);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (680);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (679);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (678);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (677);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (676);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (675);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (674);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (673);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (672);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (671);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (670);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (669);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (668);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (667);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (666);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (665);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (664);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (663);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (662);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (661);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (660);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (659);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (658);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (657);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (656);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (655);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (654);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (653);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (652);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (651);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (650);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (649);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (648);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (647);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (646);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (645);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (644);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (643);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (642);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (641);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (640);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (639);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (638);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (637);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (636);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (635);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (634);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (633);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (632);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (631);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (630);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (629);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (628);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (627);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (626);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (625);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (624);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (623);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (622);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (621);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (620);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (619);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (618);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (617);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (616);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (615);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (614);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (613);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (612);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (611);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (610);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (609);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (608);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (607);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (606);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (605);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (604);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (603);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (602);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (601);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (600);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (599);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (598);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (597);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (596);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (595);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (594);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (593);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (592);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (591);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (590);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (589);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (588);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (587);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (586);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (585);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (584);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (583);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (582);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (581);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (580);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (579);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (578);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (577);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (576);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (575);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (574);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (573);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (572);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (571);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (570);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (569);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (568);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (567);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (566);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (565);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (564);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (563);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (562);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (561);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (560);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (559);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (558);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (557);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (556);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (555);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (554);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (553);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (552);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (551);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (550);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (549);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (548);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (547);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (546);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (545);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (544);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (543);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (542);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (541);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (540);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (539);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (538);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (537);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (536);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (535);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (534);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (533);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (532);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (531);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (530);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (529);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (528);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (527);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (526);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (525);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (524);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (523);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (522);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (521);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (520);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (519);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (518);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (517);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (516);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (515);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (514);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (513);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (512);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (511);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (510);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (509);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (508);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (507);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (506);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (505);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (504);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (503);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (502);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (501);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (500);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (499);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (498);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (497);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (496);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (495);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (494);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (493);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (492);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (491);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (490);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (489);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (488);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (487);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (486);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (485);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (484);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (483);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (482);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (481);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (480);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (479);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (478);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (477);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (476);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (475);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (474);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (473);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (472);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (471);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (470);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (469);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (468);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (467);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (466);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (465);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (464);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (463);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (462);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (461);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (460);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (459);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (458);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (457);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (456);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (455);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (454);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (453);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (452);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (451);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (450);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (449);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (448);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (447);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (446);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (445);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (444);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (443);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (442);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (441);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (440);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (439);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (438);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (437);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (436);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (435);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (434);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (433);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (432);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (431);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (430);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (429);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (428);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (427);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (426);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (425);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (424);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (423);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (422);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (421);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (420);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (419);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (418);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (417);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (416);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (415);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (414);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (413);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (412);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (411);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (410);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (409);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (408);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (407);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (406);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (405);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (404);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (403);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (402);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (401);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (400);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (399);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (398);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (397);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (396);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (395);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (394);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (393);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (392);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (391);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (390);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (389);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (388);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (387);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (386);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (385);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (384);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (383);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (382);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (381);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (380);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (379);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (378);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (377);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (376);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (375);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (374);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (373);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (372);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (371);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (370);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (369);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (368);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (367);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (366);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (365);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (364);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (363);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (362);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (361);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (360);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (359);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (358);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (357);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (356);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (355);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (354);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (353);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (352);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (351);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (350);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (349);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (348);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (347);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (346);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (345);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (344);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (343);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (342);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (341);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (340);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (339);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (338);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (337);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (336);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (335);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (334);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (333);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (332);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (331);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (330);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (329);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (328);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (327);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (326);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (325);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (324);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (323);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (322);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (321);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (320);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (319);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (318);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (317);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (316);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (315);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (314);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (313);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (312);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (311);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (310);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (309);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (308);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (307);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (306);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (305);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (304);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (303);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (302);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (301);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (300);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (299);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (298);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (297);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (296);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (295);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (294);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (293);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (292);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (291);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (290);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (289);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (288);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (287);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (286);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (285);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (284);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (283);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (282);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (281);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (280);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (279);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (278);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (277);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (276);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (275);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (274);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (273);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (272);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (271);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (270);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (269);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (268);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (267);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (266);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (265);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (264);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (263);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (262);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (261);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (260);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (259);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (258);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (257);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (256);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (255);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (254);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (253);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (252);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (251);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (250);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (249);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (248);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (247);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (246);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (245);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (244);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (243);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (242);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (241);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (240);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (239);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (238);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (237);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (236);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (235);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (234);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (233);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (232);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (231);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (230);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (229);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (228);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (227);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (226);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (225);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (224);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (223);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (222);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (221);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (220);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (219);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (218);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (217);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (216);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (215);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (214);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (213);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (212);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (211);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (210);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (209);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (208);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (207);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (206);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (205);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (204);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (203);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (202);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (201);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (200);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (199);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (198);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (197);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (196);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (195);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (194);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (193);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (192);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (191);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (190);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (189);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (188);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (187);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (186);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (185);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (184);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (183);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (182);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (181);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (180);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (179);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (178);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (177);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (176);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (175);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (174);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (173);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (172);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (171);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (170);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (169);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (168);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (167);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (166);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (165);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (164);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (163);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (162);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (161);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (160);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (159);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (158);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (157);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (156);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (155);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (154);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (153);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (152);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (151);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (150);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (149);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (148);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (147);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (146);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (145);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (144);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (143);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (142);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (141);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (140);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (139);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (138);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (137);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (136);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (135);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (134);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (133);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (132);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (131);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (130);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (129);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (128);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (127);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (126);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (125);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (124);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (123);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (122);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (121);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (120);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (119);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (118);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (117);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (116);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (115);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (114);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (113);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (112);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (111);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (110);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (109);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (108);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (107);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (106);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (105);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (104);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (103);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (102);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (101);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (100);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (99);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (98);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (97);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (96);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (95);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (94);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (93);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (92);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (91);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (90);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (89);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (88);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (87);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (86);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (85);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (84);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (83);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (82);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (81);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (80);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (79);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (78);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (77);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (76);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (75);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (74);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (73);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (72);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (71);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (70);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (69);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (68);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (67);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (66);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (65);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (64);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (63);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (62);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (61);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (60);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (59);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (58);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (57);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (56);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (55);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (54);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (53);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (52);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (51);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (50);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (49);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (48);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (47);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (46);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (45);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (44);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (43);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (42);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (41);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (40);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (39);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (38);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (37);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (36);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (35);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (34);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (33);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (32);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (31);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (30);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (29);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (28);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (27);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (26);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (25);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (24);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (23);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (22);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (21);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (20);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (19);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (18);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (17);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (16);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (15);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (14);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (13);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (12);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (11);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (10);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (9);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (8);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (7);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (6);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (5);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (4);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (3);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (2);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
+connection conn1;
INSERT INTO t1 VALUES (1);
+connection default;
UNLOCK TABLES;
+connection conn1;
+disconnect conn1;
+connection default;
DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert2.result b/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert2.result
index 36073f932d4..6f23f8abbbd 100644
--- a/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/lockretry-writelocktable.insert2.result
@@ -1,4003 +1,8006 @@
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=TokuDB;
+connect conn1,localhost,root,,;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-1000);
+connection conn1;
INSERT INTO t1 VALUES (1000);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-999);
+connection conn1;
INSERT INTO t1 VALUES (999);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-998);
+connection conn1;
INSERT INTO t1 VALUES (998);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-997);
+connection conn1;
INSERT INTO t1 VALUES (997);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-996);
+connection conn1;
INSERT INTO t1 VALUES (996);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-995);
+connection conn1;
INSERT INTO t1 VALUES (995);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-994);
+connection conn1;
INSERT INTO t1 VALUES (994);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-993);
+connection conn1;
INSERT INTO t1 VALUES (993);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-992);
+connection conn1;
INSERT INTO t1 VALUES (992);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-991);
+connection conn1;
INSERT INTO t1 VALUES (991);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-990);
+connection conn1;
INSERT INTO t1 VALUES (990);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-989);
+connection conn1;
INSERT INTO t1 VALUES (989);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-988);
+connection conn1;
INSERT INTO t1 VALUES (988);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-987);
+connection conn1;
INSERT INTO t1 VALUES (987);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-986);
+connection conn1;
INSERT INTO t1 VALUES (986);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-985);
+connection conn1;
INSERT INTO t1 VALUES (985);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-984);
+connection conn1;
INSERT INTO t1 VALUES (984);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-983);
+connection conn1;
INSERT INTO t1 VALUES (983);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-982);
+connection conn1;
INSERT INTO t1 VALUES (982);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-981);
+connection conn1;
INSERT INTO t1 VALUES (981);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-980);
+connection conn1;
INSERT INTO t1 VALUES (980);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-979);
+connection conn1;
INSERT INTO t1 VALUES (979);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-978);
+connection conn1;
INSERT INTO t1 VALUES (978);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-977);
+connection conn1;
INSERT INTO t1 VALUES (977);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-976);
+connection conn1;
INSERT INTO t1 VALUES (976);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-975);
+connection conn1;
INSERT INTO t1 VALUES (975);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-974);
+connection conn1;
INSERT INTO t1 VALUES (974);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-973);
+connection conn1;
INSERT INTO t1 VALUES (973);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-972);
+connection conn1;
INSERT INTO t1 VALUES (972);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-971);
+connection conn1;
INSERT INTO t1 VALUES (971);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-970);
+connection conn1;
INSERT INTO t1 VALUES (970);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-969);
+connection conn1;
INSERT INTO t1 VALUES (969);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-968);
+connection conn1;
INSERT INTO t1 VALUES (968);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-967);
+connection conn1;
INSERT INTO t1 VALUES (967);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-966);
+connection conn1;
INSERT INTO t1 VALUES (966);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-965);
+connection conn1;
INSERT INTO t1 VALUES (965);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-964);
+connection conn1;
INSERT INTO t1 VALUES (964);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-963);
+connection conn1;
INSERT INTO t1 VALUES (963);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-962);
+connection conn1;
INSERT INTO t1 VALUES (962);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-961);
+connection conn1;
INSERT INTO t1 VALUES (961);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-960);
+connection conn1;
INSERT INTO t1 VALUES (960);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-959);
+connection conn1;
INSERT INTO t1 VALUES (959);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-958);
+connection conn1;
INSERT INTO t1 VALUES (958);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-957);
+connection conn1;
INSERT INTO t1 VALUES (957);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-956);
+connection conn1;
INSERT INTO t1 VALUES (956);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-955);
+connection conn1;
INSERT INTO t1 VALUES (955);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-954);
+connection conn1;
INSERT INTO t1 VALUES (954);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-953);
+connection conn1;
INSERT INTO t1 VALUES (953);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-952);
+connection conn1;
INSERT INTO t1 VALUES (952);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-951);
+connection conn1;
INSERT INTO t1 VALUES (951);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-950);
+connection conn1;
INSERT INTO t1 VALUES (950);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-949);
+connection conn1;
INSERT INTO t1 VALUES (949);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-948);
+connection conn1;
INSERT INTO t1 VALUES (948);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-947);
+connection conn1;
INSERT INTO t1 VALUES (947);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-946);
+connection conn1;
INSERT INTO t1 VALUES (946);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-945);
+connection conn1;
INSERT INTO t1 VALUES (945);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-944);
+connection conn1;
INSERT INTO t1 VALUES (944);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-943);
+connection conn1;
INSERT INTO t1 VALUES (943);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-942);
+connection conn1;
INSERT INTO t1 VALUES (942);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-941);
+connection conn1;
INSERT INTO t1 VALUES (941);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-940);
+connection conn1;
INSERT INTO t1 VALUES (940);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-939);
+connection conn1;
INSERT INTO t1 VALUES (939);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-938);
+connection conn1;
INSERT INTO t1 VALUES (938);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-937);
+connection conn1;
INSERT INTO t1 VALUES (937);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-936);
+connection conn1;
INSERT INTO t1 VALUES (936);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-935);
+connection conn1;
INSERT INTO t1 VALUES (935);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-934);
+connection conn1;
INSERT INTO t1 VALUES (934);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-933);
+connection conn1;
INSERT INTO t1 VALUES (933);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-932);
+connection conn1;
INSERT INTO t1 VALUES (932);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-931);
+connection conn1;
INSERT INTO t1 VALUES (931);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-930);
+connection conn1;
INSERT INTO t1 VALUES (930);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-929);
+connection conn1;
INSERT INTO t1 VALUES (929);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-928);
+connection conn1;
INSERT INTO t1 VALUES (928);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-927);
+connection conn1;
INSERT INTO t1 VALUES (927);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-926);
+connection conn1;
INSERT INTO t1 VALUES (926);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-925);
+connection conn1;
INSERT INTO t1 VALUES (925);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-924);
+connection conn1;
INSERT INTO t1 VALUES (924);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-923);
+connection conn1;
INSERT INTO t1 VALUES (923);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-922);
+connection conn1;
INSERT INTO t1 VALUES (922);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-921);
+connection conn1;
INSERT INTO t1 VALUES (921);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-920);
+connection conn1;
INSERT INTO t1 VALUES (920);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-919);
+connection conn1;
INSERT INTO t1 VALUES (919);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-918);
+connection conn1;
INSERT INTO t1 VALUES (918);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-917);
+connection conn1;
INSERT INTO t1 VALUES (917);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-916);
+connection conn1;
INSERT INTO t1 VALUES (916);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-915);
+connection conn1;
INSERT INTO t1 VALUES (915);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-914);
+connection conn1;
INSERT INTO t1 VALUES (914);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-913);
+connection conn1;
INSERT INTO t1 VALUES (913);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-912);
+connection conn1;
INSERT INTO t1 VALUES (912);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-911);
+connection conn1;
INSERT INTO t1 VALUES (911);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-910);
+connection conn1;
INSERT INTO t1 VALUES (910);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-909);
+connection conn1;
INSERT INTO t1 VALUES (909);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-908);
+connection conn1;
INSERT INTO t1 VALUES (908);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-907);
+connection conn1;
INSERT INTO t1 VALUES (907);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-906);
+connection conn1;
INSERT INTO t1 VALUES (906);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-905);
+connection conn1;
INSERT INTO t1 VALUES (905);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-904);
+connection conn1;
INSERT INTO t1 VALUES (904);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-903);
+connection conn1;
INSERT INTO t1 VALUES (903);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-902);
+connection conn1;
INSERT INTO t1 VALUES (902);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-901);
+connection conn1;
INSERT INTO t1 VALUES (901);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-900);
+connection conn1;
INSERT INTO t1 VALUES (900);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-899);
+connection conn1;
INSERT INTO t1 VALUES (899);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-898);
+connection conn1;
INSERT INTO t1 VALUES (898);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-897);
+connection conn1;
INSERT INTO t1 VALUES (897);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-896);
+connection conn1;
INSERT INTO t1 VALUES (896);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-895);
+connection conn1;
INSERT INTO t1 VALUES (895);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-894);
+connection conn1;
INSERT INTO t1 VALUES (894);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-893);
+connection conn1;
INSERT INTO t1 VALUES (893);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-892);
+connection conn1;
INSERT INTO t1 VALUES (892);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-891);
+connection conn1;
INSERT INTO t1 VALUES (891);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-890);
+connection conn1;
INSERT INTO t1 VALUES (890);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-889);
+connection conn1;
INSERT INTO t1 VALUES (889);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-888);
+connection conn1;
INSERT INTO t1 VALUES (888);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-887);
+connection conn1;
INSERT INTO t1 VALUES (887);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-886);
+connection conn1;
INSERT INTO t1 VALUES (886);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-885);
+connection conn1;
INSERT INTO t1 VALUES (885);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-884);
+connection conn1;
INSERT INTO t1 VALUES (884);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-883);
+connection conn1;
INSERT INTO t1 VALUES (883);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-882);
+connection conn1;
INSERT INTO t1 VALUES (882);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-881);
+connection conn1;
INSERT INTO t1 VALUES (881);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-880);
+connection conn1;
INSERT INTO t1 VALUES (880);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-879);
+connection conn1;
INSERT INTO t1 VALUES (879);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-878);
+connection conn1;
INSERT INTO t1 VALUES (878);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-877);
+connection conn1;
INSERT INTO t1 VALUES (877);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-876);
+connection conn1;
INSERT INTO t1 VALUES (876);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-875);
+connection conn1;
INSERT INTO t1 VALUES (875);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-874);
+connection conn1;
INSERT INTO t1 VALUES (874);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-873);
+connection conn1;
INSERT INTO t1 VALUES (873);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-872);
+connection conn1;
INSERT INTO t1 VALUES (872);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-871);
+connection conn1;
INSERT INTO t1 VALUES (871);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-870);
+connection conn1;
INSERT INTO t1 VALUES (870);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-869);
+connection conn1;
INSERT INTO t1 VALUES (869);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-868);
+connection conn1;
INSERT INTO t1 VALUES (868);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-867);
+connection conn1;
INSERT INTO t1 VALUES (867);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-866);
+connection conn1;
INSERT INTO t1 VALUES (866);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-865);
+connection conn1;
INSERT INTO t1 VALUES (865);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-864);
+connection conn1;
INSERT INTO t1 VALUES (864);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-863);
+connection conn1;
INSERT INTO t1 VALUES (863);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-862);
+connection conn1;
INSERT INTO t1 VALUES (862);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-861);
+connection conn1;
INSERT INTO t1 VALUES (861);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-860);
+connection conn1;
INSERT INTO t1 VALUES (860);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-859);
+connection conn1;
INSERT INTO t1 VALUES (859);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-858);
+connection conn1;
INSERT INTO t1 VALUES (858);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-857);
+connection conn1;
INSERT INTO t1 VALUES (857);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-856);
+connection conn1;
INSERT INTO t1 VALUES (856);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-855);
+connection conn1;
INSERT INTO t1 VALUES (855);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-854);
+connection conn1;
INSERT INTO t1 VALUES (854);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-853);
+connection conn1;
INSERT INTO t1 VALUES (853);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-852);
+connection conn1;
INSERT INTO t1 VALUES (852);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-851);
+connection conn1;
INSERT INTO t1 VALUES (851);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-850);
+connection conn1;
INSERT INTO t1 VALUES (850);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-849);
+connection conn1;
INSERT INTO t1 VALUES (849);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-848);
+connection conn1;
INSERT INTO t1 VALUES (848);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-847);
+connection conn1;
INSERT INTO t1 VALUES (847);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-846);
+connection conn1;
INSERT INTO t1 VALUES (846);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-845);
+connection conn1;
INSERT INTO t1 VALUES (845);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-844);
+connection conn1;
INSERT INTO t1 VALUES (844);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-843);
+connection conn1;
INSERT INTO t1 VALUES (843);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-842);
+connection conn1;
INSERT INTO t1 VALUES (842);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-841);
+connection conn1;
INSERT INTO t1 VALUES (841);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-840);
+connection conn1;
INSERT INTO t1 VALUES (840);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-839);
+connection conn1;
INSERT INTO t1 VALUES (839);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-838);
+connection conn1;
INSERT INTO t1 VALUES (838);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-837);
+connection conn1;
INSERT INTO t1 VALUES (837);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-836);
+connection conn1;
INSERT INTO t1 VALUES (836);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-835);
+connection conn1;
INSERT INTO t1 VALUES (835);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-834);
+connection conn1;
INSERT INTO t1 VALUES (834);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-833);
+connection conn1;
INSERT INTO t1 VALUES (833);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-832);
+connection conn1;
INSERT INTO t1 VALUES (832);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-831);
+connection conn1;
INSERT INTO t1 VALUES (831);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-830);
+connection conn1;
INSERT INTO t1 VALUES (830);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-829);
+connection conn1;
INSERT INTO t1 VALUES (829);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-828);
+connection conn1;
INSERT INTO t1 VALUES (828);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-827);
+connection conn1;
INSERT INTO t1 VALUES (827);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-826);
+connection conn1;
INSERT INTO t1 VALUES (826);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-825);
+connection conn1;
INSERT INTO t1 VALUES (825);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-824);
+connection conn1;
INSERT INTO t1 VALUES (824);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-823);
+connection conn1;
INSERT INTO t1 VALUES (823);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-822);
+connection conn1;
INSERT INTO t1 VALUES (822);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-821);
+connection conn1;
INSERT INTO t1 VALUES (821);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-820);
+connection conn1;
INSERT INTO t1 VALUES (820);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-819);
+connection conn1;
INSERT INTO t1 VALUES (819);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-818);
+connection conn1;
INSERT INTO t1 VALUES (818);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-817);
+connection conn1;
INSERT INTO t1 VALUES (817);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-816);
+connection conn1;
INSERT INTO t1 VALUES (816);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-815);
+connection conn1;
INSERT INTO t1 VALUES (815);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-814);
+connection conn1;
INSERT INTO t1 VALUES (814);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-813);
+connection conn1;
INSERT INTO t1 VALUES (813);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-812);
+connection conn1;
INSERT INTO t1 VALUES (812);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-811);
+connection conn1;
INSERT INTO t1 VALUES (811);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-810);
+connection conn1;
INSERT INTO t1 VALUES (810);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-809);
+connection conn1;
INSERT INTO t1 VALUES (809);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-808);
+connection conn1;
INSERT INTO t1 VALUES (808);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-807);
+connection conn1;
INSERT INTO t1 VALUES (807);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-806);
+connection conn1;
INSERT INTO t1 VALUES (806);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-805);
+connection conn1;
INSERT INTO t1 VALUES (805);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-804);
+connection conn1;
INSERT INTO t1 VALUES (804);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-803);
+connection conn1;
INSERT INTO t1 VALUES (803);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-802);
+connection conn1;
INSERT INTO t1 VALUES (802);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-801);
+connection conn1;
INSERT INTO t1 VALUES (801);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-800);
+connection conn1;
INSERT INTO t1 VALUES (800);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-799);
+connection conn1;
INSERT INTO t1 VALUES (799);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-798);
+connection conn1;
INSERT INTO t1 VALUES (798);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-797);
+connection conn1;
INSERT INTO t1 VALUES (797);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-796);
+connection conn1;
INSERT INTO t1 VALUES (796);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-795);
+connection conn1;
INSERT INTO t1 VALUES (795);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-794);
+connection conn1;
INSERT INTO t1 VALUES (794);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-793);
+connection conn1;
INSERT INTO t1 VALUES (793);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-792);
+connection conn1;
INSERT INTO t1 VALUES (792);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-791);
+connection conn1;
INSERT INTO t1 VALUES (791);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-790);
+connection conn1;
INSERT INTO t1 VALUES (790);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-789);
+connection conn1;
INSERT INTO t1 VALUES (789);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-788);
+connection conn1;
INSERT INTO t1 VALUES (788);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-787);
+connection conn1;
INSERT INTO t1 VALUES (787);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-786);
+connection conn1;
INSERT INTO t1 VALUES (786);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-785);
+connection conn1;
INSERT INTO t1 VALUES (785);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-784);
+connection conn1;
INSERT INTO t1 VALUES (784);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-783);
+connection conn1;
INSERT INTO t1 VALUES (783);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-782);
+connection conn1;
INSERT INTO t1 VALUES (782);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-781);
+connection conn1;
INSERT INTO t1 VALUES (781);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-780);
+connection conn1;
INSERT INTO t1 VALUES (780);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-779);
+connection conn1;
INSERT INTO t1 VALUES (779);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-778);
+connection conn1;
INSERT INTO t1 VALUES (778);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-777);
+connection conn1;
INSERT INTO t1 VALUES (777);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-776);
+connection conn1;
INSERT INTO t1 VALUES (776);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-775);
+connection conn1;
INSERT INTO t1 VALUES (775);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-774);
+connection conn1;
INSERT INTO t1 VALUES (774);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-773);
+connection conn1;
INSERT INTO t1 VALUES (773);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-772);
+connection conn1;
INSERT INTO t1 VALUES (772);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-771);
+connection conn1;
INSERT INTO t1 VALUES (771);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-770);
+connection conn1;
INSERT INTO t1 VALUES (770);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-769);
+connection conn1;
INSERT INTO t1 VALUES (769);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-768);
+connection conn1;
INSERT INTO t1 VALUES (768);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-767);
+connection conn1;
INSERT INTO t1 VALUES (767);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-766);
+connection conn1;
INSERT INTO t1 VALUES (766);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-765);
+connection conn1;
INSERT INTO t1 VALUES (765);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-764);
+connection conn1;
INSERT INTO t1 VALUES (764);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-763);
+connection conn1;
INSERT INTO t1 VALUES (763);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-762);
+connection conn1;
INSERT INTO t1 VALUES (762);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-761);
+connection conn1;
INSERT INTO t1 VALUES (761);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-760);
+connection conn1;
INSERT INTO t1 VALUES (760);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-759);
+connection conn1;
INSERT INTO t1 VALUES (759);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-758);
+connection conn1;
INSERT INTO t1 VALUES (758);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-757);
+connection conn1;
INSERT INTO t1 VALUES (757);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-756);
+connection conn1;
INSERT INTO t1 VALUES (756);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-755);
+connection conn1;
INSERT INTO t1 VALUES (755);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-754);
+connection conn1;
INSERT INTO t1 VALUES (754);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-753);
+connection conn1;
INSERT INTO t1 VALUES (753);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-752);
+connection conn1;
INSERT INTO t1 VALUES (752);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-751);
+connection conn1;
INSERT INTO t1 VALUES (751);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-750);
+connection conn1;
INSERT INTO t1 VALUES (750);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-749);
+connection conn1;
INSERT INTO t1 VALUES (749);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-748);
+connection conn1;
INSERT INTO t1 VALUES (748);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-747);
+connection conn1;
INSERT INTO t1 VALUES (747);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-746);
+connection conn1;
INSERT INTO t1 VALUES (746);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-745);
+connection conn1;
INSERT INTO t1 VALUES (745);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-744);
+connection conn1;
INSERT INTO t1 VALUES (744);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-743);
+connection conn1;
INSERT INTO t1 VALUES (743);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-742);
+connection conn1;
INSERT INTO t1 VALUES (742);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-741);
+connection conn1;
INSERT INTO t1 VALUES (741);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-740);
+connection conn1;
INSERT INTO t1 VALUES (740);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-739);
+connection conn1;
INSERT INTO t1 VALUES (739);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-738);
+connection conn1;
INSERT INTO t1 VALUES (738);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-737);
+connection conn1;
INSERT INTO t1 VALUES (737);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-736);
+connection conn1;
INSERT INTO t1 VALUES (736);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-735);
+connection conn1;
INSERT INTO t1 VALUES (735);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-734);
+connection conn1;
INSERT INTO t1 VALUES (734);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-733);
+connection conn1;
INSERT INTO t1 VALUES (733);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-732);
+connection conn1;
INSERT INTO t1 VALUES (732);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-731);
+connection conn1;
INSERT INTO t1 VALUES (731);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-730);
+connection conn1;
INSERT INTO t1 VALUES (730);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-729);
+connection conn1;
INSERT INTO t1 VALUES (729);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-728);
+connection conn1;
INSERT INTO t1 VALUES (728);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-727);
+connection conn1;
INSERT INTO t1 VALUES (727);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-726);
+connection conn1;
INSERT INTO t1 VALUES (726);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-725);
+connection conn1;
INSERT INTO t1 VALUES (725);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-724);
+connection conn1;
INSERT INTO t1 VALUES (724);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-723);
+connection conn1;
INSERT INTO t1 VALUES (723);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-722);
+connection conn1;
INSERT INTO t1 VALUES (722);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-721);
+connection conn1;
INSERT INTO t1 VALUES (721);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-720);
+connection conn1;
INSERT INTO t1 VALUES (720);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-719);
+connection conn1;
INSERT INTO t1 VALUES (719);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-718);
+connection conn1;
INSERT INTO t1 VALUES (718);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-717);
+connection conn1;
INSERT INTO t1 VALUES (717);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-716);
+connection conn1;
INSERT INTO t1 VALUES (716);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-715);
+connection conn1;
INSERT INTO t1 VALUES (715);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-714);
+connection conn1;
INSERT INTO t1 VALUES (714);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-713);
+connection conn1;
INSERT INTO t1 VALUES (713);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-712);
+connection conn1;
INSERT INTO t1 VALUES (712);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-711);
+connection conn1;
INSERT INTO t1 VALUES (711);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-710);
+connection conn1;
INSERT INTO t1 VALUES (710);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-709);
+connection conn1;
INSERT INTO t1 VALUES (709);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-708);
+connection conn1;
INSERT INTO t1 VALUES (708);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-707);
+connection conn1;
INSERT INTO t1 VALUES (707);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-706);
+connection conn1;
INSERT INTO t1 VALUES (706);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-705);
+connection conn1;
INSERT INTO t1 VALUES (705);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-704);
+connection conn1;
INSERT INTO t1 VALUES (704);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-703);
+connection conn1;
INSERT INTO t1 VALUES (703);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-702);
+connection conn1;
INSERT INTO t1 VALUES (702);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-701);
+connection conn1;
INSERT INTO t1 VALUES (701);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-700);
+connection conn1;
INSERT INTO t1 VALUES (700);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-699);
+connection conn1;
INSERT INTO t1 VALUES (699);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-698);
+connection conn1;
INSERT INTO t1 VALUES (698);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-697);
+connection conn1;
INSERT INTO t1 VALUES (697);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-696);
+connection conn1;
INSERT INTO t1 VALUES (696);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-695);
+connection conn1;
INSERT INTO t1 VALUES (695);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-694);
+connection conn1;
INSERT INTO t1 VALUES (694);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-693);
+connection conn1;
INSERT INTO t1 VALUES (693);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-692);
+connection conn1;
INSERT INTO t1 VALUES (692);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-691);
+connection conn1;
INSERT INTO t1 VALUES (691);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-690);
+connection conn1;
INSERT INTO t1 VALUES (690);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-689);
+connection conn1;
INSERT INTO t1 VALUES (689);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-688);
+connection conn1;
INSERT INTO t1 VALUES (688);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-687);
+connection conn1;
INSERT INTO t1 VALUES (687);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-686);
+connection conn1;
INSERT INTO t1 VALUES (686);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-685);
+connection conn1;
INSERT INTO t1 VALUES (685);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-684);
+connection conn1;
INSERT INTO t1 VALUES (684);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-683);
+connection conn1;
INSERT INTO t1 VALUES (683);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-682);
+connection conn1;
INSERT INTO t1 VALUES (682);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-681);
+connection conn1;
INSERT INTO t1 VALUES (681);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-680);
+connection conn1;
INSERT INTO t1 VALUES (680);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-679);
+connection conn1;
INSERT INTO t1 VALUES (679);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-678);
+connection conn1;
INSERT INTO t1 VALUES (678);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-677);
+connection conn1;
INSERT INTO t1 VALUES (677);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-676);
+connection conn1;
INSERT INTO t1 VALUES (676);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-675);
+connection conn1;
INSERT INTO t1 VALUES (675);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-674);
+connection conn1;
INSERT INTO t1 VALUES (674);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-673);
+connection conn1;
INSERT INTO t1 VALUES (673);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-672);
+connection conn1;
INSERT INTO t1 VALUES (672);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-671);
+connection conn1;
INSERT INTO t1 VALUES (671);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-670);
+connection conn1;
INSERT INTO t1 VALUES (670);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-669);
+connection conn1;
INSERT INTO t1 VALUES (669);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-668);
+connection conn1;
INSERT INTO t1 VALUES (668);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-667);
+connection conn1;
INSERT INTO t1 VALUES (667);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-666);
+connection conn1;
INSERT INTO t1 VALUES (666);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-665);
+connection conn1;
INSERT INTO t1 VALUES (665);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-664);
+connection conn1;
INSERT INTO t1 VALUES (664);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-663);
+connection conn1;
INSERT INTO t1 VALUES (663);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-662);
+connection conn1;
INSERT INTO t1 VALUES (662);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-661);
+connection conn1;
INSERT INTO t1 VALUES (661);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-660);
+connection conn1;
INSERT INTO t1 VALUES (660);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-659);
+connection conn1;
INSERT INTO t1 VALUES (659);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-658);
+connection conn1;
INSERT INTO t1 VALUES (658);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-657);
+connection conn1;
INSERT INTO t1 VALUES (657);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-656);
+connection conn1;
INSERT INTO t1 VALUES (656);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-655);
+connection conn1;
INSERT INTO t1 VALUES (655);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-654);
+connection conn1;
INSERT INTO t1 VALUES (654);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-653);
+connection conn1;
INSERT INTO t1 VALUES (653);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-652);
+connection conn1;
INSERT INTO t1 VALUES (652);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-651);
+connection conn1;
INSERT INTO t1 VALUES (651);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-650);
+connection conn1;
INSERT INTO t1 VALUES (650);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-649);
+connection conn1;
INSERT INTO t1 VALUES (649);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-648);
+connection conn1;
INSERT INTO t1 VALUES (648);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-647);
+connection conn1;
INSERT INTO t1 VALUES (647);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-646);
+connection conn1;
INSERT INTO t1 VALUES (646);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-645);
+connection conn1;
INSERT INTO t1 VALUES (645);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-644);
+connection conn1;
INSERT INTO t1 VALUES (644);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-643);
+connection conn1;
INSERT INTO t1 VALUES (643);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-642);
+connection conn1;
INSERT INTO t1 VALUES (642);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-641);
+connection conn1;
INSERT INTO t1 VALUES (641);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-640);
+connection conn1;
INSERT INTO t1 VALUES (640);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-639);
+connection conn1;
INSERT INTO t1 VALUES (639);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-638);
+connection conn1;
INSERT INTO t1 VALUES (638);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-637);
+connection conn1;
INSERT INTO t1 VALUES (637);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-636);
+connection conn1;
INSERT INTO t1 VALUES (636);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-635);
+connection conn1;
INSERT INTO t1 VALUES (635);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-634);
+connection conn1;
INSERT INTO t1 VALUES (634);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-633);
+connection conn1;
INSERT INTO t1 VALUES (633);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-632);
+connection conn1;
INSERT INTO t1 VALUES (632);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-631);
+connection conn1;
INSERT INTO t1 VALUES (631);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-630);
+connection conn1;
INSERT INTO t1 VALUES (630);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-629);
+connection conn1;
INSERT INTO t1 VALUES (629);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-628);
+connection conn1;
INSERT INTO t1 VALUES (628);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-627);
+connection conn1;
INSERT INTO t1 VALUES (627);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-626);
+connection conn1;
INSERT INTO t1 VALUES (626);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-625);
+connection conn1;
INSERT INTO t1 VALUES (625);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-624);
+connection conn1;
INSERT INTO t1 VALUES (624);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-623);
+connection conn1;
INSERT INTO t1 VALUES (623);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-622);
+connection conn1;
INSERT INTO t1 VALUES (622);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-621);
+connection conn1;
INSERT INTO t1 VALUES (621);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-620);
+connection conn1;
INSERT INTO t1 VALUES (620);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-619);
+connection conn1;
INSERT INTO t1 VALUES (619);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-618);
+connection conn1;
INSERT INTO t1 VALUES (618);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-617);
+connection conn1;
INSERT INTO t1 VALUES (617);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-616);
+connection conn1;
INSERT INTO t1 VALUES (616);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-615);
+connection conn1;
INSERT INTO t1 VALUES (615);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-614);
+connection conn1;
INSERT INTO t1 VALUES (614);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-613);
+connection conn1;
INSERT INTO t1 VALUES (613);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-612);
+connection conn1;
INSERT INTO t1 VALUES (612);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-611);
+connection conn1;
INSERT INTO t1 VALUES (611);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-610);
+connection conn1;
INSERT INTO t1 VALUES (610);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-609);
+connection conn1;
INSERT INTO t1 VALUES (609);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-608);
+connection conn1;
INSERT INTO t1 VALUES (608);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-607);
+connection conn1;
INSERT INTO t1 VALUES (607);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-606);
+connection conn1;
INSERT INTO t1 VALUES (606);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-605);
+connection conn1;
INSERT INTO t1 VALUES (605);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-604);
+connection conn1;
INSERT INTO t1 VALUES (604);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-603);
+connection conn1;
INSERT INTO t1 VALUES (603);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-602);
+connection conn1;
INSERT INTO t1 VALUES (602);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-601);
+connection conn1;
INSERT INTO t1 VALUES (601);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-600);
+connection conn1;
INSERT INTO t1 VALUES (600);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-599);
+connection conn1;
INSERT INTO t1 VALUES (599);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-598);
+connection conn1;
INSERT INTO t1 VALUES (598);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-597);
+connection conn1;
INSERT INTO t1 VALUES (597);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-596);
+connection conn1;
INSERT INTO t1 VALUES (596);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-595);
+connection conn1;
INSERT INTO t1 VALUES (595);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-594);
+connection conn1;
INSERT INTO t1 VALUES (594);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-593);
+connection conn1;
INSERT INTO t1 VALUES (593);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-592);
+connection conn1;
INSERT INTO t1 VALUES (592);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-591);
+connection conn1;
INSERT INTO t1 VALUES (591);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-590);
+connection conn1;
INSERT INTO t1 VALUES (590);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-589);
+connection conn1;
INSERT INTO t1 VALUES (589);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-588);
+connection conn1;
INSERT INTO t1 VALUES (588);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-587);
+connection conn1;
INSERT INTO t1 VALUES (587);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-586);
+connection conn1;
INSERT INTO t1 VALUES (586);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-585);
+connection conn1;
INSERT INTO t1 VALUES (585);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-584);
+connection conn1;
INSERT INTO t1 VALUES (584);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-583);
+connection conn1;
INSERT INTO t1 VALUES (583);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-582);
+connection conn1;
INSERT INTO t1 VALUES (582);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-581);
+connection conn1;
INSERT INTO t1 VALUES (581);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-580);
+connection conn1;
INSERT INTO t1 VALUES (580);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-579);
+connection conn1;
INSERT INTO t1 VALUES (579);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-578);
+connection conn1;
INSERT INTO t1 VALUES (578);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-577);
+connection conn1;
INSERT INTO t1 VALUES (577);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-576);
+connection conn1;
INSERT INTO t1 VALUES (576);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-575);
+connection conn1;
INSERT INTO t1 VALUES (575);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-574);
+connection conn1;
INSERT INTO t1 VALUES (574);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-573);
+connection conn1;
INSERT INTO t1 VALUES (573);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-572);
+connection conn1;
INSERT INTO t1 VALUES (572);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-571);
+connection conn1;
INSERT INTO t1 VALUES (571);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-570);
+connection conn1;
INSERT INTO t1 VALUES (570);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-569);
+connection conn1;
INSERT INTO t1 VALUES (569);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-568);
+connection conn1;
INSERT INTO t1 VALUES (568);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-567);
+connection conn1;
INSERT INTO t1 VALUES (567);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-566);
+connection conn1;
INSERT INTO t1 VALUES (566);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-565);
+connection conn1;
INSERT INTO t1 VALUES (565);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-564);
+connection conn1;
INSERT INTO t1 VALUES (564);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-563);
+connection conn1;
INSERT INTO t1 VALUES (563);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-562);
+connection conn1;
INSERT INTO t1 VALUES (562);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-561);
+connection conn1;
INSERT INTO t1 VALUES (561);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-560);
+connection conn1;
INSERT INTO t1 VALUES (560);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-559);
+connection conn1;
INSERT INTO t1 VALUES (559);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-558);
+connection conn1;
INSERT INTO t1 VALUES (558);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-557);
+connection conn1;
INSERT INTO t1 VALUES (557);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-556);
+connection conn1;
INSERT INTO t1 VALUES (556);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-555);
+connection conn1;
INSERT INTO t1 VALUES (555);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-554);
+connection conn1;
INSERT INTO t1 VALUES (554);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-553);
+connection conn1;
INSERT INTO t1 VALUES (553);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-552);
+connection conn1;
INSERT INTO t1 VALUES (552);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-551);
+connection conn1;
INSERT INTO t1 VALUES (551);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-550);
+connection conn1;
INSERT INTO t1 VALUES (550);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-549);
+connection conn1;
INSERT INTO t1 VALUES (549);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-548);
+connection conn1;
INSERT INTO t1 VALUES (548);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-547);
+connection conn1;
INSERT INTO t1 VALUES (547);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-546);
+connection conn1;
INSERT INTO t1 VALUES (546);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-545);
+connection conn1;
INSERT INTO t1 VALUES (545);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-544);
+connection conn1;
INSERT INTO t1 VALUES (544);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-543);
+connection conn1;
INSERT INTO t1 VALUES (543);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-542);
+connection conn1;
INSERT INTO t1 VALUES (542);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-541);
+connection conn1;
INSERT INTO t1 VALUES (541);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-540);
+connection conn1;
INSERT INTO t1 VALUES (540);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-539);
+connection conn1;
INSERT INTO t1 VALUES (539);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-538);
+connection conn1;
INSERT INTO t1 VALUES (538);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-537);
+connection conn1;
INSERT INTO t1 VALUES (537);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-536);
+connection conn1;
INSERT INTO t1 VALUES (536);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-535);
+connection conn1;
INSERT INTO t1 VALUES (535);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-534);
+connection conn1;
INSERT INTO t1 VALUES (534);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-533);
+connection conn1;
INSERT INTO t1 VALUES (533);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-532);
+connection conn1;
INSERT INTO t1 VALUES (532);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-531);
+connection conn1;
INSERT INTO t1 VALUES (531);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-530);
+connection conn1;
INSERT INTO t1 VALUES (530);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-529);
+connection conn1;
INSERT INTO t1 VALUES (529);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-528);
+connection conn1;
INSERT INTO t1 VALUES (528);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-527);
+connection conn1;
INSERT INTO t1 VALUES (527);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-526);
+connection conn1;
INSERT INTO t1 VALUES (526);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-525);
+connection conn1;
INSERT INTO t1 VALUES (525);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-524);
+connection conn1;
INSERT INTO t1 VALUES (524);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-523);
+connection conn1;
INSERT INTO t1 VALUES (523);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-522);
+connection conn1;
INSERT INTO t1 VALUES (522);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-521);
+connection conn1;
INSERT INTO t1 VALUES (521);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-520);
+connection conn1;
INSERT INTO t1 VALUES (520);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-519);
+connection conn1;
INSERT INTO t1 VALUES (519);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-518);
+connection conn1;
INSERT INTO t1 VALUES (518);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-517);
+connection conn1;
INSERT INTO t1 VALUES (517);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-516);
+connection conn1;
INSERT INTO t1 VALUES (516);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-515);
+connection conn1;
INSERT INTO t1 VALUES (515);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-514);
+connection conn1;
INSERT INTO t1 VALUES (514);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-513);
+connection conn1;
INSERT INTO t1 VALUES (513);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-512);
+connection conn1;
INSERT INTO t1 VALUES (512);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-511);
+connection conn1;
INSERT INTO t1 VALUES (511);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-510);
+connection conn1;
INSERT INTO t1 VALUES (510);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-509);
+connection conn1;
INSERT INTO t1 VALUES (509);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-508);
+connection conn1;
INSERT INTO t1 VALUES (508);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-507);
+connection conn1;
INSERT INTO t1 VALUES (507);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-506);
+connection conn1;
INSERT INTO t1 VALUES (506);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-505);
+connection conn1;
INSERT INTO t1 VALUES (505);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-504);
+connection conn1;
INSERT INTO t1 VALUES (504);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-503);
+connection conn1;
INSERT INTO t1 VALUES (503);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-502);
+connection conn1;
INSERT INTO t1 VALUES (502);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-501);
+connection conn1;
INSERT INTO t1 VALUES (501);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-500);
+connection conn1;
INSERT INTO t1 VALUES (500);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-499);
+connection conn1;
INSERT INTO t1 VALUES (499);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-498);
+connection conn1;
INSERT INTO t1 VALUES (498);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-497);
+connection conn1;
INSERT INTO t1 VALUES (497);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-496);
+connection conn1;
INSERT INTO t1 VALUES (496);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-495);
+connection conn1;
INSERT INTO t1 VALUES (495);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-494);
+connection conn1;
INSERT INTO t1 VALUES (494);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-493);
+connection conn1;
INSERT INTO t1 VALUES (493);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-492);
+connection conn1;
INSERT INTO t1 VALUES (492);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-491);
+connection conn1;
INSERT INTO t1 VALUES (491);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-490);
+connection conn1;
INSERT INTO t1 VALUES (490);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-489);
+connection conn1;
INSERT INTO t1 VALUES (489);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-488);
+connection conn1;
INSERT INTO t1 VALUES (488);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-487);
+connection conn1;
INSERT INTO t1 VALUES (487);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-486);
+connection conn1;
INSERT INTO t1 VALUES (486);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-485);
+connection conn1;
INSERT INTO t1 VALUES (485);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-484);
+connection conn1;
INSERT INTO t1 VALUES (484);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-483);
+connection conn1;
INSERT INTO t1 VALUES (483);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-482);
+connection conn1;
INSERT INTO t1 VALUES (482);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-481);
+connection conn1;
INSERT INTO t1 VALUES (481);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-480);
+connection conn1;
INSERT INTO t1 VALUES (480);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-479);
+connection conn1;
INSERT INTO t1 VALUES (479);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-478);
+connection conn1;
INSERT INTO t1 VALUES (478);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-477);
+connection conn1;
INSERT INTO t1 VALUES (477);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-476);
+connection conn1;
INSERT INTO t1 VALUES (476);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-475);
+connection conn1;
INSERT INTO t1 VALUES (475);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-474);
+connection conn1;
INSERT INTO t1 VALUES (474);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-473);
+connection conn1;
INSERT INTO t1 VALUES (473);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-472);
+connection conn1;
INSERT INTO t1 VALUES (472);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-471);
+connection conn1;
INSERT INTO t1 VALUES (471);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-470);
+connection conn1;
INSERT INTO t1 VALUES (470);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-469);
+connection conn1;
INSERT INTO t1 VALUES (469);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-468);
+connection conn1;
INSERT INTO t1 VALUES (468);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-467);
+connection conn1;
INSERT INTO t1 VALUES (467);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-466);
+connection conn1;
INSERT INTO t1 VALUES (466);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-465);
+connection conn1;
INSERT INTO t1 VALUES (465);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-464);
+connection conn1;
INSERT INTO t1 VALUES (464);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-463);
+connection conn1;
INSERT INTO t1 VALUES (463);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-462);
+connection conn1;
INSERT INTO t1 VALUES (462);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-461);
+connection conn1;
INSERT INTO t1 VALUES (461);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-460);
+connection conn1;
INSERT INTO t1 VALUES (460);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-459);
+connection conn1;
INSERT INTO t1 VALUES (459);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-458);
+connection conn1;
INSERT INTO t1 VALUES (458);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-457);
+connection conn1;
INSERT INTO t1 VALUES (457);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-456);
+connection conn1;
INSERT INTO t1 VALUES (456);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-455);
+connection conn1;
INSERT INTO t1 VALUES (455);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-454);
+connection conn1;
INSERT INTO t1 VALUES (454);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-453);
+connection conn1;
INSERT INTO t1 VALUES (453);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-452);
+connection conn1;
INSERT INTO t1 VALUES (452);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-451);
+connection conn1;
INSERT INTO t1 VALUES (451);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-450);
+connection conn1;
INSERT INTO t1 VALUES (450);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-449);
+connection conn1;
INSERT INTO t1 VALUES (449);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-448);
+connection conn1;
INSERT INTO t1 VALUES (448);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-447);
+connection conn1;
INSERT INTO t1 VALUES (447);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-446);
+connection conn1;
INSERT INTO t1 VALUES (446);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-445);
+connection conn1;
INSERT INTO t1 VALUES (445);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-444);
+connection conn1;
INSERT INTO t1 VALUES (444);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-443);
+connection conn1;
INSERT INTO t1 VALUES (443);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-442);
+connection conn1;
INSERT INTO t1 VALUES (442);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-441);
+connection conn1;
INSERT INTO t1 VALUES (441);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-440);
+connection conn1;
INSERT INTO t1 VALUES (440);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-439);
+connection conn1;
INSERT INTO t1 VALUES (439);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-438);
+connection conn1;
INSERT INTO t1 VALUES (438);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-437);
+connection conn1;
INSERT INTO t1 VALUES (437);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-436);
+connection conn1;
INSERT INTO t1 VALUES (436);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-435);
+connection conn1;
INSERT INTO t1 VALUES (435);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-434);
+connection conn1;
INSERT INTO t1 VALUES (434);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-433);
+connection conn1;
INSERT INTO t1 VALUES (433);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-432);
+connection conn1;
INSERT INTO t1 VALUES (432);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-431);
+connection conn1;
INSERT INTO t1 VALUES (431);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-430);
+connection conn1;
INSERT INTO t1 VALUES (430);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-429);
+connection conn1;
INSERT INTO t1 VALUES (429);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-428);
+connection conn1;
INSERT INTO t1 VALUES (428);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-427);
+connection conn1;
INSERT INTO t1 VALUES (427);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-426);
+connection conn1;
INSERT INTO t1 VALUES (426);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-425);
+connection conn1;
INSERT INTO t1 VALUES (425);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-424);
+connection conn1;
INSERT INTO t1 VALUES (424);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-423);
+connection conn1;
INSERT INTO t1 VALUES (423);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-422);
+connection conn1;
INSERT INTO t1 VALUES (422);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-421);
+connection conn1;
INSERT INTO t1 VALUES (421);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-420);
+connection conn1;
INSERT INTO t1 VALUES (420);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-419);
+connection conn1;
INSERT INTO t1 VALUES (419);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-418);
+connection conn1;
INSERT INTO t1 VALUES (418);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-417);
+connection conn1;
INSERT INTO t1 VALUES (417);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-416);
+connection conn1;
INSERT INTO t1 VALUES (416);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-415);
+connection conn1;
INSERT INTO t1 VALUES (415);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-414);
+connection conn1;
INSERT INTO t1 VALUES (414);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-413);
+connection conn1;
INSERT INTO t1 VALUES (413);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-412);
+connection conn1;
INSERT INTO t1 VALUES (412);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-411);
+connection conn1;
INSERT INTO t1 VALUES (411);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-410);
+connection conn1;
INSERT INTO t1 VALUES (410);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-409);
+connection conn1;
INSERT INTO t1 VALUES (409);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-408);
+connection conn1;
INSERT INTO t1 VALUES (408);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-407);
+connection conn1;
INSERT INTO t1 VALUES (407);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-406);
+connection conn1;
INSERT INTO t1 VALUES (406);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-405);
+connection conn1;
INSERT INTO t1 VALUES (405);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-404);
+connection conn1;
INSERT INTO t1 VALUES (404);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-403);
+connection conn1;
INSERT INTO t1 VALUES (403);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-402);
+connection conn1;
INSERT INTO t1 VALUES (402);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-401);
+connection conn1;
INSERT INTO t1 VALUES (401);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-400);
+connection conn1;
INSERT INTO t1 VALUES (400);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-399);
+connection conn1;
INSERT INTO t1 VALUES (399);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-398);
+connection conn1;
INSERT INTO t1 VALUES (398);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-397);
+connection conn1;
INSERT INTO t1 VALUES (397);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-396);
+connection conn1;
INSERT INTO t1 VALUES (396);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-395);
+connection conn1;
INSERT INTO t1 VALUES (395);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-394);
+connection conn1;
INSERT INTO t1 VALUES (394);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-393);
+connection conn1;
INSERT INTO t1 VALUES (393);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-392);
+connection conn1;
INSERT INTO t1 VALUES (392);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-391);
+connection conn1;
INSERT INTO t1 VALUES (391);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-390);
+connection conn1;
INSERT INTO t1 VALUES (390);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-389);
+connection conn1;
INSERT INTO t1 VALUES (389);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-388);
+connection conn1;
INSERT INTO t1 VALUES (388);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-387);
+connection conn1;
INSERT INTO t1 VALUES (387);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-386);
+connection conn1;
INSERT INTO t1 VALUES (386);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-385);
+connection conn1;
INSERT INTO t1 VALUES (385);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-384);
+connection conn1;
INSERT INTO t1 VALUES (384);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-383);
+connection conn1;
INSERT INTO t1 VALUES (383);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-382);
+connection conn1;
INSERT INTO t1 VALUES (382);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-381);
+connection conn1;
INSERT INTO t1 VALUES (381);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-380);
+connection conn1;
INSERT INTO t1 VALUES (380);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-379);
+connection conn1;
INSERT INTO t1 VALUES (379);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-378);
+connection conn1;
INSERT INTO t1 VALUES (378);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-377);
+connection conn1;
INSERT INTO t1 VALUES (377);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-376);
+connection conn1;
INSERT INTO t1 VALUES (376);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-375);
+connection conn1;
INSERT INTO t1 VALUES (375);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-374);
+connection conn1;
INSERT INTO t1 VALUES (374);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-373);
+connection conn1;
INSERT INTO t1 VALUES (373);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-372);
+connection conn1;
INSERT INTO t1 VALUES (372);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-371);
+connection conn1;
INSERT INTO t1 VALUES (371);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-370);
+connection conn1;
INSERT INTO t1 VALUES (370);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-369);
+connection conn1;
INSERT INTO t1 VALUES (369);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-368);
+connection conn1;
INSERT INTO t1 VALUES (368);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-367);
+connection conn1;
INSERT INTO t1 VALUES (367);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-366);
+connection conn1;
INSERT INTO t1 VALUES (366);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-365);
+connection conn1;
INSERT INTO t1 VALUES (365);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-364);
+connection conn1;
INSERT INTO t1 VALUES (364);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-363);
+connection conn1;
INSERT INTO t1 VALUES (363);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-362);
+connection conn1;
INSERT INTO t1 VALUES (362);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-361);
+connection conn1;
INSERT INTO t1 VALUES (361);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-360);
+connection conn1;
INSERT INTO t1 VALUES (360);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-359);
+connection conn1;
INSERT INTO t1 VALUES (359);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-358);
+connection conn1;
INSERT INTO t1 VALUES (358);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-357);
+connection conn1;
INSERT INTO t1 VALUES (357);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-356);
+connection conn1;
INSERT INTO t1 VALUES (356);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-355);
+connection conn1;
INSERT INTO t1 VALUES (355);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-354);
+connection conn1;
INSERT INTO t1 VALUES (354);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-353);
+connection conn1;
INSERT INTO t1 VALUES (353);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-352);
+connection conn1;
INSERT INTO t1 VALUES (352);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-351);
+connection conn1;
INSERT INTO t1 VALUES (351);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-350);
+connection conn1;
INSERT INTO t1 VALUES (350);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-349);
+connection conn1;
INSERT INTO t1 VALUES (349);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-348);
+connection conn1;
INSERT INTO t1 VALUES (348);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-347);
+connection conn1;
INSERT INTO t1 VALUES (347);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-346);
+connection conn1;
INSERT INTO t1 VALUES (346);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-345);
+connection conn1;
INSERT INTO t1 VALUES (345);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-344);
+connection conn1;
INSERT INTO t1 VALUES (344);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-343);
+connection conn1;
INSERT INTO t1 VALUES (343);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-342);
+connection conn1;
INSERT INTO t1 VALUES (342);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-341);
+connection conn1;
INSERT INTO t1 VALUES (341);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-340);
+connection conn1;
INSERT INTO t1 VALUES (340);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-339);
+connection conn1;
INSERT INTO t1 VALUES (339);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-338);
+connection conn1;
INSERT INTO t1 VALUES (338);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-337);
+connection conn1;
INSERT INTO t1 VALUES (337);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-336);
+connection conn1;
INSERT INTO t1 VALUES (336);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-335);
+connection conn1;
INSERT INTO t1 VALUES (335);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-334);
+connection conn1;
INSERT INTO t1 VALUES (334);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-333);
+connection conn1;
INSERT INTO t1 VALUES (333);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-332);
+connection conn1;
INSERT INTO t1 VALUES (332);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-331);
+connection conn1;
INSERT INTO t1 VALUES (331);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-330);
+connection conn1;
INSERT INTO t1 VALUES (330);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-329);
+connection conn1;
INSERT INTO t1 VALUES (329);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-328);
+connection conn1;
INSERT INTO t1 VALUES (328);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-327);
+connection conn1;
INSERT INTO t1 VALUES (327);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-326);
+connection conn1;
INSERT INTO t1 VALUES (326);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-325);
+connection conn1;
INSERT INTO t1 VALUES (325);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-324);
+connection conn1;
INSERT INTO t1 VALUES (324);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-323);
+connection conn1;
INSERT INTO t1 VALUES (323);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-322);
+connection conn1;
INSERT INTO t1 VALUES (322);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-321);
+connection conn1;
INSERT INTO t1 VALUES (321);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-320);
+connection conn1;
INSERT INTO t1 VALUES (320);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-319);
+connection conn1;
INSERT INTO t1 VALUES (319);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-318);
+connection conn1;
INSERT INTO t1 VALUES (318);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-317);
+connection conn1;
INSERT INTO t1 VALUES (317);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-316);
+connection conn1;
INSERT INTO t1 VALUES (316);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-315);
+connection conn1;
INSERT INTO t1 VALUES (315);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-314);
+connection conn1;
INSERT INTO t1 VALUES (314);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-313);
+connection conn1;
INSERT INTO t1 VALUES (313);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-312);
+connection conn1;
INSERT INTO t1 VALUES (312);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-311);
+connection conn1;
INSERT INTO t1 VALUES (311);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-310);
+connection conn1;
INSERT INTO t1 VALUES (310);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-309);
+connection conn1;
INSERT INTO t1 VALUES (309);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-308);
+connection conn1;
INSERT INTO t1 VALUES (308);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-307);
+connection conn1;
INSERT INTO t1 VALUES (307);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-306);
+connection conn1;
INSERT INTO t1 VALUES (306);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-305);
+connection conn1;
INSERT INTO t1 VALUES (305);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-304);
+connection conn1;
INSERT INTO t1 VALUES (304);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-303);
+connection conn1;
INSERT INTO t1 VALUES (303);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-302);
+connection conn1;
INSERT INTO t1 VALUES (302);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-301);
+connection conn1;
INSERT INTO t1 VALUES (301);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-300);
+connection conn1;
INSERT INTO t1 VALUES (300);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-299);
+connection conn1;
INSERT INTO t1 VALUES (299);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-298);
+connection conn1;
INSERT INTO t1 VALUES (298);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-297);
+connection conn1;
INSERT INTO t1 VALUES (297);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-296);
+connection conn1;
INSERT INTO t1 VALUES (296);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-295);
+connection conn1;
INSERT INTO t1 VALUES (295);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-294);
+connection conn1;
INSERT INTO t1 VALUES (294);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-293);
+connection conn1;
INSERT INTO t1 VALUES (293);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-292);
+connection conn1;
INSERT INTO t1 VALUES (292);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-291);
+connection conn1;
INSERT INTO t1 VALUES (291);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-290);
+connection conn1;
INSERT INTO t1 VALUES (290);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-289);
+connection conn1;
INSERT INTO t1 VALUES (289);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-288);
+connection conn1;
INSERT INTO t1 VALUES (288);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-287);
+connection conn1;
INSERT INTO t1 VALUES (287);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-286);
+connection conn1;
INSERT INTO t1 VALUES (286);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-285);
+connection conn1;
INSERT INTO t1 VALUES (285);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-284);
+connection conn1;
INSERT INTO t1 VALUES (284);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-283);
+connection conn1;
INSERT INTO t1 VALUES (283);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-282);
+connection conn1;
INSERT INTO t1 VALUES (282);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-281);
+connection conn1;
INSERT INTO t1 VALUES (281);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-280);
+connection conn1;
INSERT INTO t1 VALUES (280);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-279);
+connection conn1;
INSERT INTO t1 VALUES (279);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-278);
+connection conn1;
INSERT INTO t1 VALUES (278);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-277);
+connection conn1;
INSERT INTO t1 VALUES (277);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-276);
+connection conn1;
INSERT INTO t1 VALUES (276);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-275);
+connection conn1;
INSERT INTO t1 VALUES (275);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-274);
+connection conn1;
INSERT INTO t1 VALUES (274);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-273);
+connection conn1;
INSERT INTO t1 VALUES (273);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-272);
+connection conn1;
INSERT INTO t1 VALUES (272);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-271);
+connection conn1;
INSERT INTO t1 VALUES (271);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-270);
+connection conn1;
INSERT INTO t1 VALUES (270);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-269);
+connection conn1;
INSERT INTO t1 VALUES (269);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-268);
+connection conn1;
INSERT INTO t1 VALUES (268);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-267);
+connection conn1;
INSERT INTO t1 VALUES (267);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-266);
+connection conn1;
INSERT INTO t1 VALUES (266);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-265);
+connection conn1;
INSERT INTO t1 VALUES (265);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-264);
+connection conn1;
INSERT INTO t1 VALUES (264);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-263);
+connection conn1;
INSERT INTO t1 VALUES (263);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-262);
+connection conn1;
INSERT INTO t1 VALUES (262);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-261);
+connection conn1;
INSERT INTO t1 VALUES (261);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-260);
+connection conn1;
INSERT INTO t1 VALUES (260);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-259);
+connection conn1;
INSERT INTO t1 VALUES (259);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-258);
+connection conn1;
INSERT INTO t1 VALUES (258);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-257);
+connection conn1;
INSERT INTO t1 VALUES (257);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-256);
+connection conn1;
INSERT INTO t1 VALUES (256);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-255);
+connection conn1;
INSERT INTO t1 VALUES (255);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-254);
+connection conn1;
INSERT INTO t1 VALUES (254);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-253);
+connection conn1;
INSERT INTO t1 VALUES (253);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-252);
+connection conn1;
INSERT INTO t1 VALUES (252);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-251);
+connection conn1;
INSERT INTO t1 VALUES (251);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-250);
+connection conn1;
INSERT INTO t1 VALUES (250);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-249);
+connection conn1;
INSERT INTO t1 VALUES (249);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-248);
+connection conn1;
INSERT INTO t1 VALUES (248);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-247);
+connection conn1;
INSERT INTO t1 VALUES (247);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-246);
+connection conn1;
INSERT INTO t1 VALUES (246);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-245);
+connection conn1;
INSERT INTO t1 VALUES (245);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-244);
+connection conn1;
INSERT INTO t1 VALUES (244);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-243);
+connection conn1;
INSERT INTO t1 VALUES (243);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-242);
+connection conn1;
INSERT INTO t1 VALUES (242);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-241);
+connection conn1;
INSERT INTO t1 VALUES (241);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-240);
+connection conn1;
INSERT INTO t1 VALUES (240);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-239);
+connection conn1;
INSERT INTO t1 VALUES (239);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-238);
+connection conn1;
INSERT INTO t1 VALUES (238);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-237);
+connection conn1;
INSERT INTO t1 VALUES (237);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-236);
+connection conn1;
INSERT INTO t1 VALUES (236);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-235);
+connection conn1;
INSERT INTO t1 VALUES (235);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-234);
+connection conn1;
INSERT INTO t1 VALUES (234);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-233);
+connection conn1;
INSERT INTO t1 VALUES (233);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-232);
+connection conn1;
INSERT INTO t1 VALUES (232);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-231);
+connection conn1;
INSERT INTO t1 VALUES (231);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-230);
+connection conn1;
INSERT INTO t1 VALUES (230);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-229);
+connection conn1;
INSERT INTO t1 VALUES (229);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-228);
+connection conn1;
INSERT INTO t1 VALUES (228);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-227);
+connection conn1;
INSERT INTO t1 VALUES (227);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-226);
+connection conn1;
INSERT INTO t1 VALUES (226);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-225);
+connection conn1;
INSERT INTO t1 VALUES (225);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-224);
+connection conn1;
INSERT INTO t1 VALUES (224);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-223);
+connection conn1;
INSERT INTO t1 VALUES (223);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-222);
+connection conn1;
INSERT INTO t1 VALUES (222);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-221);
+connection conn1;
INSERT INTO t1 VALUES (221);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-220);
+connection conn1;
INSERT INTO t1 VALUES (220);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-219);
+connection conn1;
INSERT INTO t1 VALUES (219);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-218);
+connection conn1;
INSERT INTO t1 VALUES (218);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-217);
+connection conn1;
INSERT INTO t1 VALUES (217);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-216);
+connection conn1;
INSERT INTO t1 VALUES (216);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-215);
+connection conn1;
INSERT INTO t1 VALUES (215);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-214);
+connection conn1;
INSERT INTO t1 VALUES (214);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-213);
+connection conn1;
INSERT INTO t1 VALUES (213);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-212);
+connection conn1;
INSERT INTO t1 VALUES (212);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-211);
+connection conn1;
INSERT INTO t1 VALUES (211);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-210);
+connection conn1;
INSERT INTO t1 VALUES (210);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-209);
+connection conn1;
INSERT INTO t1 VALUES (209);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-208);
+connection conn1;
INSERT INTO t1 VALUES (208);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-207);
+connection conn1;
INSERT INTO t1 VALUES (207);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-206);
+connection conn1;
INSERT INTO t1 VALUES (206);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-205);
+connection conn1;
INSERT INTO t1 VALUES (205);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-204);
+connection conn1;
INSERT INTO t1 VALUES (204);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-203);
+connection conn1;
INSERT INTO t1 VALUES (203);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-202);
+connection conn1;
INSERT INTO t1 VALUES (202);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-201);
+connection conn1;
INSERT INTO t1 VALUES (201);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-200);
+connection conn1;
INSERT INTO t1 VALUES (200);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-199);
+connection conn1;
INSERT INTO t1 VALUES (199);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-198);
+connection conn1;
INSERT INTO t1 VALUES (198);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-197);
+connection conn1;
INSERT INTO t1 VALUES (197);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-196);
+connection conn1;
INSERT INTO t1 VALUES (196);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-195);
+connection conn1;
INSERT INTO t1 VALUES (195);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-194);
+connection conn1;
INSERT INTO t1 VALUES (194);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-193);
+connection conn1;
INSERT INTO t1 VALUES (193);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-192);
+connection conn1;
INSERT INTO t1 VALUES (192);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-191);
+connection conn1;
INSERT INTO t1 VALUES (191);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-190);
+connection conn1;
INSERT INTO t1 VALUES (190);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-189);
+connection conn1;
INSERT INTO t1 VALUES (189);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-188);
+connection conn1;
INSERT INTO t1 VALUES (188);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-187);
+connection conn1;
INSERT INTO t1 VALUES (187);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-186);
+connection conn1;
INSERT INTO t1 VALUES (186);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-185);
+connection conn1;
INSERT INTO t1 VALUES (185);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-184);
+connection conn1;
INSERT INTO t1 VALUES (184);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-183);
+connection conn1;
INSERT INTO t1 VALUES (183);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-182);
+connection conn1;
INSERT INTO t1 VALUES (182);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-181);
+connection conn1;
INSERT INTO t1 VALUES (181);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-180);
+connection conn1;
INSERT INTO t1 VALUES (180);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-179);
+connection conn1;
INSERT INTO t1 VALUES (179);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-178);
+connection conn1;
INSERT INTO t1 VALUES (178);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-177);
+connection conn1;
INSERT INTO t1 VALUES (177);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-176);
+connection conn1;
INSERT INTO t1 VALUES (176);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-175);
+connection conn1;
INSERT INTO t1 VALUES (175);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-174);
+connection conn1;
INSERT INTO t1 VALUES (174);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-173);
+connection conn1;
INSERT INTO t1 VALUES (173);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-172);
+connection conn1;
INSERT INTO t1 VALUES (172);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-171);
+connection conn1;
INSERT INTO t1 VALUES (171);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-170);
+connection conn1;
INSERT INTO t1 VALUES (170);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-169);
+connection conn1;
INSERT INTO t1 VALUES (169);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-168);
+connection conn1;
INSERT INTO t1 VALUES (168);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-167);
+connection conn1;
INSERT INTO t1 VALUES (167);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-166);
+connection conn1;
INSERT INTO t1 VALUES (166);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-165);
+connection conn1;
INSERT INTO t1 VALUES (165);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-164);
+connection conn1;
INSERT INTO t1 VALUES (164);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-163);
+connection conn1;
INSERT INTO t1 VALUES (163);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-162);
+connection conn1;
INSERT INTO t1 VALUES (162);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-161);
+connection conn1;
INSERT INTO t1 VALUES (161);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-160);
+connection conn1;
INSERT INTO t1 VALUES (160);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-159);
+connection conn1;
INSERT INTO t1 VALUES (159);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-158);
+connection conn1;
INSERT INTO t1 VALUES (158);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-157);
+connection conn1;
INSERT INTO t1 VALUES (157);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-156);
+connection conn1;
INSERT INTO t1 VALUES (156);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-155);
+connection conn1;
INSERT INTO t1 VALUES (155);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-154);
+connection conn1;
INSERT INTO t1 VALUES (154);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-153);
+connection conn1;
INSERT INTO t1 VALUES (153);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-152);
+connection conn1;
INSERT INTO t1 VALUES (152);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-151);
+connection conn1;
INSERT INTO t1 VALUES (151);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-150);
+connection conn1;
INSERT INTO t1 VALUES (150);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-149);
+connection conn1;
INSERT INTO t1 VALUES (149);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-148);
+connection conn1;
INSERT INTO t1 VALUES (148);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-147);
+connection conn1;
INSERT INTO t1 VALUES (147);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-146);
+connection conn1;
INSERT INTO t1 VALUES (146);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-145);
+connection conn1;
INSERT INTO t1 VALUES (145);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-144);
+connection conn1;
INSERT INTO t1 VALUES (144);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-143);
+connection conn1;
INSERT INTO t1 VALUES (143);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-142);
+connection conn1;
INSERT INTO t1 VALUES (142);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-141);
+connection conn1;
INSERT INTO t1 VALUES (141);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-140);
+connection conn1;
INSERT INTO t1 VALUES (140);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-139);
+connection conn1;
INSERT INTO t1 VALUES (139);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-138);
+connection conn1;
INSERT INTO t1 VALUES (138);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-137);
+connection conn1;
INSERT INTO t1 VALUES (137);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-136);
+connection conn1;
INSERT INTO t1 VALUES (136);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-135);
+connection conn1;
INSERT INTO t1 VALUES (135);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-134);
+connection conn1;
INSERT INTO t1 VALUES (134);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-133);
+connection conn1;
INSERT INTO t1 VALUES (133);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-132);
+connection conn1;
INSERT INTO t1 VALUES (132);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-131);
+connection conn1;
INSERT INTO t1 VALUES (131);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-130);
+connection conn1;
INSERT INTO t1 VALUES (130);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-129);
+connection conn1;
INSERT INTO t1 VALUES (129);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-128);
+connection conn1;
INSERT INTO t1 VALUES (128);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-127);
+connection conn1;
INSERT INTO t1 VALUES (127);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-126);
+connection conn1;
INSERT INTO t1 VALUES (126);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-125);
+connection conn1;
INSERT INTO t1 VALUES (125);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-124);
+connection conn1;
INSERT INTO t1 VALUES (124);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-123);
+connection conn1;
INSERT INTO t1 VALUES (123);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-122);
+connection conn1;
INSERT INTO t1 VALUES (122);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-121);
+connection conn1;
INSERT INTO t1 VALUES (121);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-120);
+connection conn1;
INSERT INTO t1 VALUES (120);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-119);
+connection conn1;
INSERT INTO t1 VALUES (119);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-118);
+connection conn1;
INSERT INTO t1 VALUES (118);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-117);
+connection conn1;
INSERT INTO t1 VALUES (117);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-116);
+connection conn1;
INSERT INTO t1 VALUES (116);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-115);
+connection conn1;
INSERT INTO t1 VALUES (115);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-114);
+connection conn1;
INSERT INTO t1 VALUES (114);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-113);
+connection conn1;
INSERT INTO t1 VALUES (113);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-112);
+connection conn1;
INSERT INTO t1 VALUES (112);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-111);
+connection conn1;
INSERT INTO t1 VALUES (111);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-110);
+connection conn1;
INSERT INTO t1 VALUES (110);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-109);
+connection conn1;
INSERT INTO t1 VALUES (109);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-108);
+connection conn1;
INSERT INTO t1 VALUES (108);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-107);
+connection conn1;
INSERT INTO t1 VALUES (107);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-106);
+connection conn1;
INSERT INTO t1 VALUES (106);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-105);
+connection conn1;
INSERT INTO t1 VALUES (105);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-104);
+connection conn1;
INSERT INTO t1 VALUES (104);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-103);
+connection conn1;
INSERT INTO t1 VALUES (103);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-102);
+connection conn1;
INSERT INTO t1 VALUES (102);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-101);
+connection conn1;
INSERT INTO t1 VALUES (101);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-100);
+connection conn1;
INSERT INTO t1 VALUES (100);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-99);
+connection conn1;
INSERT INTO t1 VALUES (99);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-98);
+connection conn1;
INSERT INTO t1 VALUES (98);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-97);
+connection conn1;
INSERT INTO t1 VALUES (97);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-96);
+connection conn1;
INSERT INTO t1 VALUES (96);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-95);
+connection conn1;
INSERT INTO t1 VALUES (95);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-94);
+connection conn1;
INSERT INTO t1 VALUES (94);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-93);
+connection conn1;
INSERT INTO t1 VALUES (93);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-92);
+connection conn1;
INSERT INTO t1 VALUES (92);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-91);
+connection conn1;
INSERT INTO t1 VALUES (91);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-90);
+connection conn1;
INSERT INTO t1 VALUES (90);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-89);
+connection conn1;
INSERT INTO t1 VALUES (89);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-88);
+connection conn1;
INSERT INTO t1 VALUES (88);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-87);
+connection conn1;
INSERT INTO t1 VALUES (87);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-86);
+connection conn1;
INSERT INTO t1 VALUES (86);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-85);
+connection conn1;
INSERT INTO t1 VALUES (85);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-84);
+connection conn1;
INSERT INTO t1 VALUES (84);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-83);
+connection conn1;
INSERT INTO t1 VALUES (83);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-82);
+connection conn1;
INSERT INTO t1 VALUES (82);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-81);
+connection conn1;
INSERT INTO t1 VALUES (81);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-80);
+connection conn1;
INSERT INTO t1 VALUES (80);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-79);
+connection conn1;
INSERT INTO t1 VALUES (79);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-78);
+connection conn1;
INSERT INTO t1 VALUES (78);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-77);
+connection conn1;
INSERT INTO t1 VALUES (77);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-76);
+connection conn1;
INSERT INTO t1 VALUES (76);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-75);
+connection conn1;
INSERT INTO t1 VALUES (75);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-74);
+connection conn1;
INSERT INTO t1 VALUES (74);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-73);
+connection conn1;
INSERT INTO t1 VALUES (73);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-72);
+connection conn1;
INSERT INTO t1 VALUES (72);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-71);
+connection conn1;
INSERT INTO t1 VALUES (71);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-70);
+connection conn1;
INSERT INTO t1 VALUES (70);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-69);
+connection conn1;
INSERT INTO t1 VALUES (69);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-68);
+connection conn1;
INSERT INTO t1 VALUES (68);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-67);
+connection conn1;
INSERT INTO t1 VALUES (67);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-66);
+connection conn1;
INSERT INTO t1 VALUES (66);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-65);
+connection conn1;
INSERT INTO t1 VALUES (65);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-64);
+connection conn1;
INSERT INTO t1 VALUES (64);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-63);
+connection conn1;
INSERT INTO t1 VALUES (63);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-62);
+connection conn1;
INSERT INTO t1 VALUES (62);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-61);
+connection conn1;
INSERT INTO t1 VALUES (61);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-60);
+connection conn1;
INSERT INTO t1 VALUES (60);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-59);
+connection conn1;
INSERT INTO t1 VALUES (59);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-58);
+connection conn1;
INSERT INTO t1 VALUES (58);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-57);
+connection conn1;
INSERT INTO t1 VALUES (57);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-56);
+connection conn1;
INSERT INTO t1 VALUES (56);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-55);
+connection conn1;
INSERT INTO t1 VALUES (55);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-54);
+connection conn1;
INSERT INTO t1 VALUES (54);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-53);
+connection conn1;
INSERT INTO t1 VALUES (53);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-52);
+connection conn1;
INSERT INTO t1 VALUES (52);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-51);
+connection conn1;
INSERT INTO t1 VALUES (51);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-50);
+connection conn1;
INSERT INTO t1 VALUES (50);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-49);
+connection conn1;
INSERT INTO t1 VALUES (49);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-48);
+connection conn1;
INSERT INTO t1 VALUES (48);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-47);
+connection conn1;
INSERT INTO t1 VALUES (47);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-46);
+connection conn1;
INSERT INTO t1 VALUES (46);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-45);
+connection conn1;
INSERT INTO t1 VALUES (45);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-44);
+connection conn1;
INSERT INTO t1 VALUES (44);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-43);
+connection conn1;
INSERT INTO t1 VALUES (43);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-42);
+connection conn1;
INSERT INTO t1 VALUES (42);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-41);
+connection conn1;
INSERT INTO t1 VALUES (41);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-40);
+connection conn1;
INSERT INTO t1 VALUES (40);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-39);
+connection conn1;
INSERT INTO t1 VALUES (39);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-38);
+connection conn1;
INSERT INTO t1 VALUES (38);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-37);
+connection conn1;
INSERT INTO t1 VALUES (37);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-36);
+connection conn1;
INSERT INTO t1 VALUES (36);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-35);
+connection conn1;
INSERT INTO t1 VALUES (35);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-34);
+connection conn1;
INSERT INTO t1 VALUES (34);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-33);
+connection conn1;
INSERT INTO t1 VALUES (33);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-32);
+connection conn1;
INSERT INTO t1 VALUES (32);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-31);
+connection conn1;
INSERT INTO t1 VALUES (31);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-30);
+connection conn1;
INSERT INTO t1 VALUES (30);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-29);
+connection conn1;
INSERT INTO t1 VALUES (29);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-28);
+connection conn1;
INSERT INTO t1 VALUES (28);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-27);
+connection conn1;
INSERT INTO t1 VALUES (27);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-26);
+connection conn1;
INSERT INTO t1 VALUES (26);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-25);
+connection conn1;
INSERT INTO t1 VALUES (25);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-24);
+connection conn1;
INSERT INTO t1 VALUES (24);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-23);
+connection conn1;
INSERT INTO t1 VALUES (23);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-22);
+connection conn1;
INSERT INTO t1 VALUES (22);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-21);
+connection conn1;
INSERT INTO t1 VALUES (21);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-20);
+connection conn1;
INSERT INTO t1 VALUES (20);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-19);
+connection conn1;
INSERT INTO t1 VALUES (19);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-18);
+connection conn1;
INSERT INTO t1 VALUES (18);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-17);
+connection conn1;
INSERT INTO t1 VALUES (17);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-16);
+connection conn1;
INSERT INTO t1 VALUES (16);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-15);
+connection conn1;
INSERT INTO t1 VALUES (15);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-14);
+connection conn1;
INSERT INTO t1 VALUES (14);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-13);
+connection conn1;
INSERT INTO t1 VALUES (13);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-12);
+connection conn1;
INSERT INTO t1 VALUES (12);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-11);
+connection conn1;
INSERT INTO t1 VALUES (11);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-10);
+connection conn1;
INSERT INTO t1 VALUES (10);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-9);
+connection conn1;
INSERT INTO t1 VALUES (9);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-8);
+connection conn1;
INSERT INTO t1 VALUES (8);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-7);
+connection conn1;
INSERT INTO t1 VALUES (7);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-6);
+connection conn1;
INSERT INTO t1 VALUES (6);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-5);
+connection conn1;
INSERT INTO t1 VALUES (5);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-4);
+connection conn1;
INSERT INTO t1 VALUES (4);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-3);
+connection conn1;
INSERT INTO t1 VALUES (3);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-2);
+connection conn1;
INSERT INTO t1 VALUES (2);
+connection default;
UNLOCK TABLES;
+connection conn1;
+connection default;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES (-1);
+connection conn1;
INSERT INTO t1 VALUES (1);
+connection default;
UNLOCK TABLES;
+connection conn1;
+disconnect conn1;
+connection default;
DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-blocking-row-locks.result b/storage/tokudb/mysql-test/tokudb/r/locks-blocking-row-locks.result
index 060aeda803b..fe6a283a281 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-blocking-row-locks.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-blocking-row-locks.result
@@ -1,5 +1,8 @@
+connect conn1, localhost, root;
set session transaction isolation level serializable;
+connect conn2, localhost, root;
set session transaction isolation level serializable;
+connection conn1;
drop table if exists t;
create table t (a int primary key, b int) engine=tokudb;
insert ignore t values(1, 1);
@@ -8,12 +11,16 @@ insert ignore t values(3, 9);
insert ignore t values(4, 16);
insert ignore t values(5, 25);
insert ignore t values(6, 36);
+connection conn1;
set session tokudb_lock_timeout=0;
+connection conn2;
set session tokudb_lock_timeout=0;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 1
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -38,7 +45,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 1
@@ -52,10 +61,13 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 1
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -74,7 +86,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -86,10 +100,13 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 1
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -108,7 +125,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -120,10 +139,13 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 1
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -142,7 +164,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -154,10 +178,13 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -181,7 +208,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 100
@@ -204,10 +233,13 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -226,7 +258,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -239,8 +273,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -265,7 +302,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 100
@@ -279,8 +318,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -299,7 +341,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -311,8 +355,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -331,7 +378,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -343,8 +392,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -363,7 +415,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -375,8 +429,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -400,7 +457,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 100
@@ -423,8 +482,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -443,7 +505,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -456,8 +520,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -482,7 +549,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 100
@@ -496,8 +565,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -516,7 +588,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -528,8 +602,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -548,7 +625,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -560,8 +639,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -580,7 +662,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -592,8 +676,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -617,7 +704,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 100
@@ -640,8 +729,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -660,7 +752,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -673,8 +767,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -699,7 +796,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 100
@@ -713,8 +812,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -733,7 +835,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -745,8 +849,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -765,7 +872,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -777,8 +886,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -797,7 +909,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -809,8 +923,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -834,7 +951,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 100
@@ -857,8 +976,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -877,7 +999,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -890,12 +1014,15 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
+connection conn2;
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
@@ -918,7 +1045,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
a b
1 100
@@ -944,12 +1073,15 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
+connection conn2;
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
@@ -969,7 +1101,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
@@ -983,8 +1117,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
@@ -1007,7 +1144,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
a b
1 100
@@ -1033,8 +1172,11 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
+connection conn2;
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
@@ -1054,7 +1196,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
@@ -1068,12 +1212,17 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
set session tokudb_lock_timeout=500;
+connection conn2;
set session tokudb_lock_timeout=500;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -1098,7 +1247,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 100
@@ -1112,18 +1263,25 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
select * from t where a=1 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 100
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -1142,7 +1300,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -1154,16 +1314,23 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
update t set b=b where a=1;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -1182,7 +1349,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -1194,16 +1363,23 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
insert ignore t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -1222,7 +1398,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -1234,16 +1412,23 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 100
+connection conn2;
replace t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 175
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -1267,7 +1452,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 175
@@ -1290,19 +1477,26 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 175
+connection conn2;
select * from t where a<=2 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 175
2 100
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 175
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -1321,7 +1515,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -1334,14 +1530,21 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a=1 for update;
a b
1 175
+connection conn2;
update t set b=b where a<=2;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -1366,7 +1569,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 175
@@ -1380,14 +1585,21 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
select * from t where a=1 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 175
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -1406,7 +1618,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -1418,12 +1632,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
update t set b=b where a=1;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -1442,7 +1663,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -1454,12 +1677,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
insert ignore t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -1478,7 +1708,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -1490,12 +1722,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
replace t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -1519,7 +1758,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 175
@@ -1542,15 +1783,22 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
select * from t where a<=2 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 175
2 100
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -1569,7 +1817,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -1582,12 +1832,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a=1;
+connection conn2;
update t set b=b where a<=2;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -1612,7 +1869,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 175
@@ -1626,14 +1885,21 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 150);
+connection conn2;
select * from t where a=1 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 175
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -1652,7 +1918,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -1664,12 +1932,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 150);
+connection conn2;
update t set b=b where a=1;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -1688,7 +1963,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -1700,12 +1977,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 150);
+connection conn2;
insert ignore t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -1724,7 +2008,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -1736,12 +2022,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 150);
+connection conn2;
replace t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -1765,7 +2058,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 175
@@ -1788,15 +2083,22 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 150);
+connection conn2;
select * from t where a<=2 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 175
2 100
+connection conn1;
begin;
insert ignore t values(1, 100);
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -1815,7 +2117,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -1828,12 +2132,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
insert ignore t values(1, 150);
+connection conn2;
update t set b=b where a<=2;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
select * from t where a=1 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a=2 for update;
@@ -1858,7 +2169,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a=1 for update;
a b
1 100
@@ -1872,14 +2185,21 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 150);
+connection conn2;
select * from t where a=1 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 150
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
update t set b=b where a=1;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a=2;
@@ -1898,7 +2218,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a=1;
begin;
select * from t;
@@ -1910,12 +2232,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 150);
+connection conn2;
update t set b=b where a=1;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
insert ignore t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values(2, 100);
@@ -1934,7 +2263,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
insert ignore t values(1, 100);
begin;
select * from t;
@@ -1946,12 +2277,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 150);
+connection conn2;
insert ignore t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
replace t values(1, 100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
replace t values(2, 100);
@@ -1970,7 +2308,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
replace t values(1, 100);
begin;
select * from t;
@@ -1982,12 +2322,19 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 150);
+connection conn2;
replace t values(1, 175);
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
select * from t where a<=2 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=0 for update;
@@ -2011,7 +2358,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a<=2 for update;
a b
1 100
@@ -2034,15 +2383,22 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 150);
+connection conn2;
select * from t where a<=2 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 150
2 100
+connection conn1;
begin;
replace t values(1, 100);
+connection conn2;
update t set b=b where a<=2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=0;
@@ -2061,7 +2417,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a<=2;
update t set b=b where a>=0;
begin;
@@ -2074,16 +2432,23 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
replace t values(1, 150);
+connection conn2;
update t set b=b where a<=2;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
+connection conn2;
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
@@ -2106,7 +2471,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
a b
1 150
@@ -2132,24 +2499,31 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
+connection conn2;
select * from t where a>=0 and a<=3 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 150
2 100
3 100
+connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
+connection conn2;
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
@@ -2169,7 +2543,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
@@ -2183,16 +2559,23 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
select * from t where a>=2 and a<=4 for update;
a b
2 100
3 100
4 100
+connection conn2;
update t set b=b where a>=0 and a<=3;
+connection conn1;
commit;
+connection conn2;
+connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
select * from t where a>=3 and a<=6 for update;
@@ -2215,7 +2598,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
a b
1 150
@@ -2241,16 +2626,23 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
+connection conn2;
select * from t where a>=0 and a<=3 for update;
+connection conn1;
commit;
+connection conn2;
a b
1 150
2 100
3 100
+connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
+connection conn2;
update t set b=b where a>=0 and a<=3;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
update t set b=b where a>=3 and a<=6;
@@ -2270,7 +2662,9 @@ a b
5 25
6 36
commit;
+connection conn1;
commit;
+connection conn2;
update t set b=b where a>=0 and a<=3;
update t set b=b where a>=3 and a<=6;
update t set b=b where a<=2;
@@ -2284,8 +2678,13 @@ a b
5 25
6 36
commit;
+connection conn1;
+connection conn1;
begin;
update t set b=b where a>=2 and a<=4;
+connection conn2;
update t set b=b where a>=0 and a<=3;
+connection conn1;
commit;
+connection conn2;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-delete-deadlock-1.result b/storage/tokudb/mysql-test/tokudb/r/locks-delete-deadlock-1.result
index d2feccac563..59fe0a606c7 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-delete-deadlock-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-delete-deadlock-1.result
@@ -1,13 +1,20 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
drop table if exists t;
+connect conn1,localhost,root;
+connection default;
create table t (a int primary key, b int);
insert into t values (1,0),(2,1),(3,0);
begin;
delete from t where b>0;
+connection conn1;
set transaction isolation level serializable;
select * from t where a!=2;
+connection default;
commit;
+connection conn1;
a b
1 0
3 0
+connection default;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-no-read-lock-serializable-autocommit.result b/storage/tokudb/mysql-test/tokudb/r/locks-no-read-lock-serializable-autocommit.result
index fa6b28ddc93..b271102eb74 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-no-read-lock-serializable-autocommit.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-no-read-lock-serializable-autocommit.result
@@ -9,6 +9,7 @@ a
1
2
3
+connect conn1, localhost, root;
select * from t;
a
1
@@ -27,18 +28,22 @@ replace into t values (1);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert ignore t values (3);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
+connection default;
begin;
select * from t;
a
1
2
3
+connection conn1;
select * from t for update;
a
1
2
3
+connection default;
commit;
drop table t;
set global transaction isolation level repeatable read;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-1.result b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-1.result
index a816808a2d5..4ea99c9b15f 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-1.result
@@ -8,10 +8,13 @@ select * from t where a=1 for update;
a b
1 0
update t set b=b+1 where a=1;
+connect conn1,localhost,root;
set session transaction isolation level repeatable read;
begin;
select * from t where a=1 for update;
+connection default;
commit;
+connection conn1;
a b
1 1
update t set b=b+1 where a=1;
@@ -19,4 +22,6 @@ select * from t;
a b
1 2
commit;
+connection default;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-2.result b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-2.result
index cea61214669..d8929b7340e 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-2.result
@@ -8,10 +8,13 @@ select * from t where a=1 for update;
a b
1 0
update t set b=b+1 where a=1;
+connect conn1,localhost,root;
set session transaction isolation level serializable;
begin;
select * from t where a=1 for update;
+connection default;
commit;
+connection conn1;
a b
1 1
update t set b=b+1 where a=1;
@@ -19,4 +22,6 @@ select * from t;
a b
1 2
commit;
+connection default;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result
index 8b31bf5a280..62b65a8535b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-select-update-3.result
@@ -8,10 +8,13 @@ select * from t where a=1 for update;
a b
1 0
update t set b=b+1 where a=1;
+connect conn1,localhost,root;
set session transaction isolation level read committed;
begin;
select * from t where a=1 for update;
+connection default;
commit;
+connection conn1;
a b
1 1
update t set b=b+1 where a=1;
@@ -19,4 +22,6 @@ select * from t;
a b
1 2
commit;
+connection default;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/locks-update-deadlock-1.result b/storage/tokudb/mysql-test/tokudb/r/locks-update-deadlock-1.result
index 1357c30b22d..3fe46387aa1 100644
--- a/storage/tokudb/mysql-test/tokudb/r/locks-update-deadlock-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/locks-update-deadlock-1.result
@@ -1,13 +1,20 @@
SET DEFAULT_STORAGE_ENGINE='tokudb';
drop table if exists t;
+connect conn1,localhost,root;
+connection default;
create table t (a int primary key, b int);
insert into t values (1,0),(2,1),(3,0);
begin;
update t set b=b+1 where b>0;
+connection conn1;
set transaction isolation level serializable;
select * from t where a!=2;
+connection default;
commit;
+connection conn1;
a b
1 0
3 0
+connection default;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-10.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-10.result
index 6ebeb298d84..6c90973f1dc 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-10.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-10.result
@@ -1,6 +1,12 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
+connect conn3,localhost,root,,;
+connect conn4,localhost,root,,;
+connect conn5,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
show create table foo;
Table Create Table
@@ -9,48 +15,69 @@ foo CREATE TABLE `foo` (
`b` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1, "a");
+connection conn2;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 a
+connection default;
delete from foo;
+connection conn3;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1,"abc");
+connection conn4;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 abc
+connection default;
delete from foo;
+connection conn5;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection conn1;
select * from foo;
a b
commit;
+connection conn2;
select * from foo;
a b
1 a
commit;
+connection conn3;
select * from foo;
a b
commit;
+connection conn4;
select * from foo;
a b
1 abc
commit;
+connection conn5;
select * from foo;
a b
commit;
+connection default;
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+disconnect conn4;
+disconnect conn5;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-11.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-11.result
index a89ba26a461..f81bfda92cb 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-11.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-11.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int) engine=TokuDB;
show create table foo;
Table Create Table
@@ -10,6 +12,7 @@ foo CREATE TABLE `foo` (
insert into foo values (1);
begin;
insert into foo values (2);
+connection conn1;
set session transaction isolation level serializable;
begin;
select * from foo;
@@ -20,6 +23,9 @@ select * from foo;
a
1
2
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-12.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-12.result
index b307f487f03..83702cbc49b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-12.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-12.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level serializable;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -13,6 +15,7 @@ begin;
select * from foo;
a
1
+connection conn1;
set session transaction isolation level serializable;
insert into foo values (3);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
@@ -25,6 +28,9 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set session transaction isolation level read uncommitted;
insert into foo values (3);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-13.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-13.result
index 2f87ddb26cc..46393b1fe8c 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-13.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-13.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo,foo1;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -11,10 +13,15 @@ foo CREATE TABLE `foo` (
begin;
select * from foo;
a
+connection conn1;
set session transaction isolation level repeatable read;
create table foo1(a int) engine=TokuDB;
insert into foo1 values(1);
+connection default;
select * from foo1;
ERROR HY000: Table definition has changed, please retry transaction
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo,foo1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-14.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-14.result
index eecb674346f..25f3940d34e 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-14.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-14.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo,foo1;
+connection default;
set session transaction isolation level read uncommitted;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -11,11 +13,16 @@ foo CREATE TABLE `foo` (
begin;
select * from foo;
a
+connection conn1;
set session transaction isolation level repeatable read;
create table foo1(a int) engine=TokuDB;
insert into foo1 values(1);
+connection default;
select * from foo1;
a
1
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo,foo1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-15.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-15.result
index 0b7d96dd7b5..b4b111ca801 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-15.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-15.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo,foo1;
+connection default;
set session transaction isolation level serializable;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -11,11 +13,16 @@ foo CREATE TABLE `foo` (
begin;
select * from foo;
a
+connection conn1;
set session transaction isolation level repeatable read;
create table foo1(a int) engine=TokuDB;
insert into foo1 values(1);
+connection default;
select * from foo1;
a
1
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo,foo1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-16.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-16.result
index 7ee801d88b2..7e6f482602b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-16.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-16.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo,foo1;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -11,9 +13,11 @@ foo CREATE TABLE `foo` (
begin;
select * from foo;
a
+connection conn1;
set session transaction isolation level repeatable read;
create table foo1(a int, b int, c int, primary key (a)) engine=TokuDB;
insert into foo1 values (1,10,100),(2,20,200),(3,30,300),(4,40,400),(5,50,500);
+connection default;
select a from foo1;
ERROR HY000: Table definition has changed, please retry transaction
select a from foo1 order by a desc;
@@ -26,5 +30,8 @@ select * from foo1 where a>3 order by a desc;
ERROR HY000: Table definition has changed, please retry transaction
select * from foo1;
ERROR HY000: Table definition has changed, please retry transaction
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo,foo1;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-17.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-17.result
index fe3322b9fb7..62ede774d3c 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-17.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-17.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session tokudb_load_save_space=0;
set session transaction isolation level repeatable read;
create table foo (a int)engine=TokuDB;
@@ -9,11 +11,13 @@ Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session tokudb_load_save_space=0;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a
+connection default;
begin;
insert into foo values (1),(2),(3);
# should return 1,2,3
@@ -22,6 +26,7 @@ a
1
2
3
+connection conn1;
# should be empty
select * from foo;
a
@@ -29,13 +34,18 @@ a
insert into foo values (10000);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
+connection default;
commit;
+connection conn1;
# should see 1,2,3
select * from foo;
a
1
2
3
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-18.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-18.result
index 1edda2650e2..9997b0545d4 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-18.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-18.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session tokudb_load_save_space=1;
set session transaction isolation level repeatable read;
create table foo (a int)engine=TokuDB;
@@ -9,11 +11,13 @@ Table Create Table
foo CREATE TABLE `foo` (
`a` int(11) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session tokudb_load_save_space=1;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a
+connection default;
begin;
insert into foo values (1),(2),(3);
# should return 1,2,3
@@ -22,6 +26,7 @@ a
1
2
3
+connection conn1;
# should be empty
select * from foo;
a
@@ -29,13 +34,18 @@ a
insert into foo values (10000);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
+connection default;
commit;
+connection conn1;
# should see 1,2,3
select * from foo;
a
1
2
3
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-2.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-2.result
index 1223360fc3f..3cb20740c8b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-2.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-2.result
@@ -1,7 +1,9 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set session transaction isolation level repeatable read;
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level repeatable read;
create table foo (a int) engine=TokuDB;
insert into foo values (1);
@@ -9,14 +11,21 @@ begin;
select * from foo;
a
1
+connection default;
insert into foo values (1000000);
+connection conn1;
select * From foo;
a
1
+connection default;
select * from foo;
a
1
1000000
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-21.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-21.result
index ced1e5b045e..950b6d8bce7 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-21.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-21.result
@@ -1,6 +1,12 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
+connect conn3,localhost,root,,;
+connect conn4,localhost,root,,;
+connect conn5,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
show create table foo;
Table Create Table
@@ -9,26 +15,33 @@ foo CREATE TABLE `foo` (
`b` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1, "a");
+connection conn2;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 a
+connection default;
replace into foo values (1,"abGARBAGE"), (2, "abGARBAGE");
replace into foo values (1,"ab"), (2, "ab");
+connection conn3;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 ab
2 ab
+connection default;
replace into foo values (1,"abcGARBAGE"),(2,"abcGARBAGE"),(3, "abcGARBAGE");
replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
+connection conn4;
set session transaction isolation level repeatable read;
begin;
select * from foo;
@@ -36,8 +49,10 @@ a b
1 abc
2 abc
3 abc
+connection default;
replace into foo values (1,"abcdGARBAGE"),(2,"abcdGARBAGE"),(3, "abcdGARBAGE"),(4, "abcdGARBAGE");
replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
+connection conn5;
set session transaction isolation level repeatable read;
begin;
select * from foo;
@@ -46,24 +61,29 @@ a b
2 abcd
3 abcd
4 abcd
+connection conn1;
select * from foo;
a b
commit;
+connection conn2;
select * from foo;
a b
1 a
commit;
+connection conn3;
select * from foo;
a b
1 ab
2 ab
commit;
+connection conn4;
select * from foo;
a b
1 abc
2 abc
3 abc
commit;
+connection conn5;
select * from foo;
a b
1 abcd
@@ -71,6 +91,7 @@ a b
3 abcd
4 abcd
commit;
+connection default;
select * from foo;
a b
1 abcd
@@ -84,5 +105,11 @@ a b
2 2
3 3
4 4
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+disconnect conn4;
+disconnect conn5;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-22.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-22.result
index 412f5afb9e0..b0d557b24fe 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-22.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-22.result
@@ -1,6 +1,12 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
+connect conn3,localhost,root,,;
+connect conn4,localhost,root,,;
+connect conn5,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
show create table foo;
Table Create Table
@@ -9,57 +15,72 @@ foo CREATE TABLE `foo` (
`b` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1,"aGARBAGE");
replace into foo values (1, "a");
+connection conn2;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 a
+connection default;
replace into foo values (1,"abGARBAGE");
replace into foo values (1,"ab");
+connection conn3;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 ab
+connection default;
replace into foo values (1,"abcGARBAGE");
replace into foo values (1,"abc");
+connection conn4;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 abc
+connection default;
replace into foo values (1,"abcdGARBAGE");
replace into foo values (1,"abcd");
+connection conn5;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 abcd
+connection conn1;
select * from foo;
a b
commit;
+connection conn2;
select * from foo;
a b
1 a
commit;
+connection conn3;
select * from foo;
a b
1 ab
commit;
+connection conn4;
select * from foo;
a b
1 abc
commit;
+connection conn5;
select * from foo;
a b
1 abcd
commit;
+connection default;
select * from foo;
a b
1 abcd
@@ -67,5 +88,11 @@ replace into foo values (1,"1");
select * from foo;
a b
1 1
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+disconnect conn4;
+disconnect conn5;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-23.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-23.result
index 9af10709db6..97814d0cd96 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-23.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-23.result
@@ -1,6 +1,12 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
+connect conn3,localhost,root,,;
+connect conn4,localhost,root,,;
+connect conn5,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
show create table foo;
Table Create Table
@@ -9,51 +15,72 @@ foo CREATE TABLE `foo` (
`b` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1, "aGARBAGE");
replace into foo values (1, "a");
+connection conn2;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 a
+connection default;
replace into foo values (1, "delete1Garbage");
delete from foo;
+connection conn3;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1,"abcGARBAGE");
replace into foo values (1,"abc");
+connection conn4;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 abc
+connection default;
delete from foo;
+connection conn5;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection conn1;
select * from foo;
a b
commit;
+connection conn2;
select * from foo;
a b
1 a
commit;
+connection conn3;
select * from foo;
a b
commit;
+connection conn4;
select * from foo;
a b
1 abc
commit;
+connection conn5;
select * from foo;
a b
commit;
+connection default;
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+disconnect conn4;
+disconnect conn5;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-24.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-24.result
index aad61cdb8dc..d1ac4bc5654 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-24.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-24.result
@@ -1,28 +1,41 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b varchar (100), primary key (a))engine=TokuDB;
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should return nothing
select * from foo;
a b
+connection default;
insert into foo values (1, "G");
replace into foo values (1, "Ga");
replace into foo values (1, "Gar");
replace into foo values (1, "Garb");
replace into foo values (1, "Garba");
replace into foo values (1, "a");
+connection conn2;
begin;
# Should read (1, "a")
select * from foo;
a b
1 a
+connection conn1;
# Should be empty
select * from foo;
a b
+connection conn2;
commit;
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+disconnect conn2;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-25.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-25.result
index 69183cf37d3..7c7a1486ecb 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-25.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-25.result
@@ -1,6 +1,10 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
+connect conn3,localhost,root,,;
DROP TABLE IF EXISTS foo,bar;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b varchar (100), primary key (a))engine=TokuDB;
create table bar like foo;
@@ -18,37 +22,49 @@ bar CREATE TABLE `bar` (
`b` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should be empty
select * from foo;
a b
+connection default;
begin;
# should be empty
select * from bar;
a b
+connection conn2;
begin;
# should be empty
select * from foo;
a b
+connection default;
insert into foo values (1,"g");
commit;
replace into foo values (1,"ga");
replace into foo values (1,"gar");
replace into foo values (1,"garb");
replace into foo values (1,"aaaa");
+connection conn3;
# should have one value
select * from foo;
a b
1 aaaa
commit;
+connection conn2;
# should be empty
select * from foo;
a b
commit;
+connection conn1;
# should be empty
select * from foo;
a b
commit;
+connection default;
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo,bar;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-28.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-28.result
index 7562495484c..ce099f5f27a 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-28.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-28.result
@@ -1,15 +1,19 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level serializable;
create table foo (a int, b varchar(10), primary key (a))engine=TokuDB;
insert into foo values (1,"a");
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should read ONLY (1,"a")
select * from foo;
a b
1 a
+connection default;
delete from foo where a=1;
insert into foo values (2,"bb");
# should read ONLY (2,"bb")
@@ -17,6 +21,7 @@ begin;
select * from foo;
a b
2 bb
+connection conn1;
# should read ONLY (1,"a")
select * From foo;
a b
@@ -24,6 +29,9 @@ a b
commit;
insert into foo values ("101000","asdf");
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-committed.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-committed.result
index 80f4b229987..4a9493cc437 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-committed.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-committed.result
@@ -1,6 +1,8 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo,foo_isam;
+connection conn1;
set session transaction isolation level read committed;
create table foo ( a int, b int, primary key (a));
insert into foo values (1,1),(2,2),(3,1),(4,3);
@@ -18,8 +20,10 @@ a b
2 2
3 10
4 3
+connection default;
insert into foo values (5,5);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
rollback;
select * from foo;
a b
@@ -34,8 +38,10 @@ a b
1 1
3 1
4 3
+connection default;
insert into foo values (5,5);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
rollback;
select * from foo;
a b
@@ -46,6 +52,7 @@ a b
create table foo_isam (a int, b int)engine=MyISAM;
begin;
insert into foo_isam select * from foo;
+connection default;
insert into foo values (5,5);
select * from foo;
a b
@@ -54,6 +61,10 @@ a b
3 1
4 3
5 5
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo, foo_isam;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-uncommitted.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-uncommitted.result
index e8ffcc7f843..8e2d2b74276 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-uncommitted.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-2808-read-uncommitted.result
@@ -1,6 +1,8 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo,foo_isam;
+connection conn1;
set session transaction isolation level read uncommitted;
create table foo ( a int, b int, primary key (a));
insert into foo values (1,1),(2,2),(3,1),(4,3);
@@ -18,8 +20,10 @@ a b
2 2
3 10
4 3
+connection default;
insert into foo values (5,5);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
rollback;
select * from foo;
a b
@@ -34,8 +38,10 @@ a b
1 1
3 1
4 3
+connection default;
insert into foo values (5,5);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
rollback;
select * from foo;
a b
@@ -46,6 +52,7 @@ a b
create table foo_isam (a int, b int)engine=MyISAM;
begin;
insert into foo_isam select * from foo;
+connection default;
insert into foo values (5,5);
select * from foo;
a b
@@ -54,6 +61,10 @@ a b
3 1
4 3
5 5
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo, foo_isam;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-29.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-29.result
index 5c02babaed3..994b906e2a2 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-29.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-29.result
@@ -1,10 +1,14 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level repeatable read;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a))engine=TokUDB;
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
+connection conn1;
begin;
select * from foo;
a b
@@ -22,6 +26,7 @@ a b
explain select * from foo where a > 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
+connection default;
delete from foo where a > 5;
# number of rows should be 9
explain select * from foo where a > 1;
@@ -34,6 +39,7 @@ a b
3 3
4 4
5 5
+connection conn1;
# number of rows should be 9
explain select * from foo where a > 1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -51,5 +57,8 @@ a b
40 40
50 50
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-3.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-3.result
index 470771b968f..bf1e030e80b 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-3.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-3.result
@@ -1,7 +1,9 @@
set session transaction isolation level repeatable read;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a))engine=TokuDB;
show create table foo;
@@ -16,30 +18,38 @@ begin;
select * from foo;
a b
1 1
+connection default;
begin;
select * from foo;
a b
1 1
+connection conn1;
replace into foo values (1,100), (2,200);
#transaction that did the insert about to read
select * from foo;
a b
1 100
2 200
+connection default;
#this should read just (1,1)
select * from foo;
a b
1 1
+connection conn1;
commit;
# this should read 2 values, (1,100) and (2,200)
select * from foo;
a b
1 100
2 200
+connection default;
#this should read just (1,1)
select * from foo;
a b
1 1
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-30.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-30.result
index c57787f2a8d..6bf54efd0e9 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-30.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-30.result
@@ -1,10 +1,14 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level repeatable read;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a))engine=TokUDB;
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
+connection conn1;
begin;
select * from foo;
a b
@@ -22,6 +26,7 @@ a b
explain select * from foo where a < 50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 9 Using where
+connection default;
delete from foo where a < 10;
# number of rows should be 9
explain select * from foo where a < 50;
@@ -34,6 +39,7 @@ a b
20 20
30 30
40 40
+connection conn1;
# number of rows should be 9
explain select * from foo where a < 50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -51,5 +57,8 @@ a b
30 30
40 40
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-31.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-31.result
index ebc5ae49535..cc2bb45a39c 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-31.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-31.result
@@ -1,10 +1,14 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level repeatable read;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a))engine=TokUDB;
insert into foo values (1,1),(2,2),(3,3),(4,4),(5,5),(10,10),(20,20),(30,30),(40,40),(50,50);
+connection conn1;
begin;
select * from foo;
a b
@@ -22,6 +26,7 @@ a b
explain select * from foo where a > 1 and a < 50;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo range PRIMARY PRIMARY 4 NULL 8 Using where
+connection default;
delete from foo where a = 2 or a = 4 or a = 10 or a = 30 or a = 50;
# number of rows should be 8
explain select * from foo where a > 1 and a < 50;
@@ -34,6 +39,7 @@ a b
5 5
20 20
40 40
+connection conn1;
# number of rows should be 8
explain select * from foo where a > 1 and a < 50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -50,5 +56,8 @@ a b
30 30
40 40
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-33.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-33.result
index 989cfeb43a1..c8450ed0d55 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-33.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-33.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -33,6 +35,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 500
+connection conn1;
set session transaction isolation level repeatable read;
replace into foo values (5,50,555);
select * from foo;
@@ -46,6 +49,7 @@ a b c
7 70 700
8 80 800
9 90 900
+connection default;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -59,5 +63,8 @@ replace into foo values (5,50,111111111);
select * from foo where b=50;
a b c
5 50 111111111
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-34.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-34.result
index bf1d47f8eae..47f4afa23e4 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-34.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-34.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -34,6 +36,7 @@ select * from foo where b=50;
a b c
5 50 500
replace into foo values (5,50,1515);
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should use key b
@@ -44,6 +47,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 500
+connection default;
commit;
# should use key b
explain select * from foo where b=50;
@@ -53,6 +57,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection conn1;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -70,5 +75,8 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-35.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-35.result
index 557609e0345..83af37b1cfc 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-35.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-35.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level read committed;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -34,6 +36,7 @@ select * from foo where b=50;
a b c
5 50 500
replace into foo values (5,50,1515);
+connection conn1;
set session transaction isolation level read committed;
begin;
# should use key b
@@ -44,6 +47,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 500
+connection default;
commit;
# should use key b
explain select * from foo where b=50;
@@ -53,6 +57,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection conn1;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -70,5 +75,8 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-36.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-36.result
index b38f6d98f0e..cbdd963c2e8 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-36.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-36.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level serializable;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -34,6 +36,7 @@ select * from foo where b=50;
a b c
5 50 500
replace into foo values (5,50,1515);
+connection conn1;
set session transaction isolation level serializable;
begin;
# should use key b
@@ -43,6 +46,7 @@ id select_type table type possible_keys key key_len ref rows Extra
# timeout
select * from foo where b=50;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
# should use key b
explain select * from foo where b=50;
@@ -52,6 +56,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection conn1;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -69,5 +74,8 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-37.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-37.result
index 4319ef036fa..5f397d7dffb 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-37.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-37.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level read uncommitted;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -34,6 +36,7 @@ select * from foo where b=50;
a b c
5 50 500
replace into foo values (5,50,1515);
+connection conn1;
set session transaction isolation level read uncommitted;
begin;
# should use key b
@@ -44,6 +47,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection default;
commit;
# should use key b
explain select * from foo where b=50;
@@ -53,6 +57,7 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection conn1;
# should use key b
explain select * from foo where b=50;
id select_type table type possible_keys key key_len ref rows Extra
@@ -70,5 +75,8 @@ id select_type table type possible_keys key key_len ref rows Extra
select * from foo where b=50;
a b c
5 50 1515
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-38.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-38.result
index 9e2996931c6..8cbcf3dffd2 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-38.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-38.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo, foo_isam;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, c int, primary key (a), key (b))engine=TokUDB;
show create table foo;
@@ -36,9 +38,13 @@ insert into foo_isam select * from foo where b=50;
select * From foo_isam;
a b c
5 50 500
+connection conn1;
set session transaction isolation level repeatable read;
# should fail with lock timeout because of read lock grabbed earlier
replace into foo values (5, 1,1);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo, foo_isam;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-39.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-39.result
index 905d5c2292a..5dcdc259995 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-39.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-39.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session tokudb_load_save_space=1;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -9,6 +11,7 @@ foo CREATE TABLE `foo` (
`a` int(11) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
insert into foo values (1),(2),(3);
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should return (1),(2),(3)
@@ -17,17 +20,22 @@ a
1
2
3
+connection default;
delete from foo;
insert into foo values (4);
# should return (4)
select * from foo;
a
4
+connection conn1;
# should return (1),(2),(3)
select * from foo;
a
1
2
3
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-4.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-4.result
index 5e13ce32a24..f05ec03b7de 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-4.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-4.result
@@ -1,7 +1,9 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set session transaction isolation level repeatable read;
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a))engine=TokuDB;
insert into foo values (1,1);
@@ -19,10 +21,14 @@ a b
begin;
replace into foo values (1,100), (2,200);
commit;
+connection default;
#should read (1,100),(2,200)
select * from foo;
a b
1 100
2 200
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-40.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-40.result
index 1330fe41c50..7099b787659 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-40.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-40.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session tokudb_load_save_space=0;
create table foo (a int) engine=TokuDB;
show create table foo;
@@ -9,6 +11,7 @@ foo CREATE TABLE `foo` (
`a` int(11) DEFAULT NULL
) ENGINE=TokuDB DEFAULT CHARSET=latin1
insert into foo values (1),(2),(3);
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should return (1),(2),(3)
@@ -17,17 +20,22 @@ a
1
2
3
+connection default;
delete from foo;
insert into foo values (4);
# should return (4)
select * from foo;
a
4
+connection conn1;
# should return (1),(2),(3)
select * from foo;
a
1
2
3
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-5.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-5.result
index 3df8f211589..fdb3c97e9b5 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-5.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-5.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set session transaction isolation level repeatable read;
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
DROP TABLE IF EXISTS foo;
create table foo (a int, b int, primary key (a))engine=TokuDB;
show create table foo;
@@ -11,34 +13,42 @@ foo CREATE TABLE `foo` (
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
insert into foo values (1,1);
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# Should read just (1,1)
select * from foo;
a b
1 1
+connection conn2;
set session transaction isolation level read committed;
begin;
# Should read just (1,1)
select * from foo;
a b
1 1
+connection default;
replace into foo values (1,10),(2,20);
+connection conn1;
# Should read just (1,1)
select * from foo;
a b
1 1
+connection conn2;
# Should read just (1,10), (2,20)
select * from foo;
a b
1 10
2 20
+connection default;
replace into foo values (1,100),(2,200),(3,300);
+connection conn1;
# Should read just (1,1)
select * from foo;
a b
1 1
commit;
+connection conn2;
# Should read just (1,100), (2,200),(3,300)
select * from foo;
a b
@@ -46,5 +56,9 @@ a b
2 200
3 300
commit;
+connection default;
+disconnect conn1;
+disconnect conn2;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-6.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-6.result
index b45faa49026..a74e398c8bb 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-6.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-6.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -14,6 +16,7 @@ foo CREATE TABLE `foo` (
insert into foo values (100,100);
begin;
insert into foo values (1,100);
+connection conn1;
set session transaction isolation level repeatable read;
begin;
# should NOT see (1,100)
@@ -26,12 +29,14 @@ a b
# should fail with a lock wait timeout
insert into foo values (1,1000);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
# should return two values
select * from foo;
a b
1 100
100 100
+connection conn1;
# should be empty
select * from foo where a=1;
a b
@@ -39,5 +44,8 @@ a b
insert into foo values (1,1000);
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-7.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-7.result
index 3baa212c490..2d5e0de2ac0 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-7.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-7.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level repeatable read;
create table foo (a int, b int, primary key (a))engine=TokuDB;
show create table foo;
@@ -21,11 +23,13 @@ select * from foo;
a b
1 100
100 100
+connection conn1;
set session transaction isolation level repeatable read;
# should NOT see (1,100)
select * from foo;
a b
1 100
+connection default;
# should see (1,100)
select * from foo;
a b
@@ -36,5 +40,7 @@ rollback;
select * from foo;
a b
1 100
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-8.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-8.result
index 450ad63fd42..cc7e12193ea 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-8.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-8.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo, foo_isam;
+connection default;
set session transaction isolation level repeatable read;
create table foo ( a int, b int, c int, primary key (a), key (b))engine=TokuDB;
show create table foo;
@@ -20,10 +22,14 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE foo ref b b 5 const 1
begin;
insert into foo_isam select * from foo where b=30;
+connection conn1;
set session transaction isolation level repeatable read;
# should get a lock error
replace into foo values (3,3,3);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo, foo_isam;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-9.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-9.result
index 7dcae265518..fe6be9b24cb 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-9.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-9.result
@@ -1,6 +1,12 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connect conn2,localhost,root,,;
+connect conn3,localhost,root,,;
+connect conn4,localhost,root,,;
+connect conn5,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int, b varchar (100), primary key (a)) engine=TokuDB;
show create table foo;
Table Create Table
@@ -9,24 +15,31 @@ foo CREATE TABLE `foo` (
`b` varchar(100) DEFAULT NULL,
PRIMARY KEY (`a`)
) ENGINE=TokuDB DEFAULT CHARSET=latin1
+connection conn1;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
+connection default;
replace into foo values (1, "a");
+connection conn2;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 a
+connection default;
replace into foo values (1,"ab"), (2, "ab");
+connection conn3;
set session transaction isolation level repeatable read;
begin;
select * from foo;
a b
1 ab
2 ab
+connection default;
replace into foo values (1,"abc"),(2,"abc"),(3, "abc");
+connection conn4;
set session transaction isolation level repeatable read;
begin;
select * from foo;
@@ -34,7 +47,9 @@ a b
1 abc
2 abc
3 abc
+connection default;
replace into foo values (1,"abcd"),(2,"abcd"),(3, "abcd"),(4, "abcd");
+connection conn5;
set session transaction isolation level repeatable read;
begin;
select * from foo;
@@ -43,24 +58,29 @@ a b
2 abcd
3 abcd
4 abcd
+connection conn1;
select * from foo;
a b
commit;
+connection conn2;
select * from foo;
a b
1 a
commit;
+connection conn3;
select * from foo;
a b
1 ab
2 ab
commit;
+connection conn4;
select * from foo;
a b
1 abc
2 abc
3 abc
commit;
+connection conn5;
select * from foo;
a b
1 abcd
@@ -68,5 +88,12 @@ a b
3 abcd
4 abcd
commit;
+connection default;
+disconnect conn1;
+disconnect conn2;
+disconnect conn3;
+disconnect conn4;
+disconnect conn5;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/mvcc-checksum-locks.result b/storage/tokudb/mysql-test/tokudb/r/mvcc-checksum-locks.result
index c6bea70265b..8e0a2d45926 100644
--- a/storage/tokudb/mysql-test/tokudb/r/mvcc-checksum-locks.result
+++ b/storage/tokudb/mysql-test/tokudb/r/mvcc-checksum-locks.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
create table foo (a int)engine=TokuDB;
show create table foo;
Table Create Table
@@ -10,6 +12,7 @@ foo CREATE TABLE `foo` (
insert into foo values (1),(2),(3);
begin;
insert into foo values (4);
+connection conn1;
set session transaction isolation level repeatable read;
# 1,2,3
select * from foo;
@@ -50,6 +53,9 @@ commit;
checksum table foo;
Table Checksum
test.foo NULL
+connection default;
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb/r/rows-32m-0.result b/storage/tokudb/mysql-test/tokudb/r/rows-32m-0.result
index db72519f024..bcbd908ef6c 100644
--- a/storage/tokudb/mysql-test/tokudb/r/rows-32m-0.result
+++ b/storage/tokudb/mysql-test/tokudb/r/rows-32m-0.result
@@ -5,6 +5,7 @@ drop table if exists t;
create table t (id int not null primary key, v longblob not null);
select @@max_allowed_packet into @my_max_allowed_packet;
set global max_allowed_packet=100000000;
+connect conn1,localhost,root,,;
insert into t values (1,repeat('a',32*1024*1024));
ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
insert into t values (1,repeat('a',32*1024*1024-1));
@@ -32,5 +33,7 @@ id length(v)
2 1
3 1
4 1
+connection default;
+disconnect conn1;
set global max_allowed_packet=@my_max_allowed_packet;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/rows-32m-1.result b/storage/tokudb/mysql-test/tokudb/r/rows-32m-1.result
index b97d1825fb3..01cc05bffe1 100644
--- a/storage/tokudb/mysql-test/tokudb/r/rows-32m-1.result
+++ b/storage/tokudb/mysql-test/tokudb/r/rows-32m-1.result
@@ -5,6 +5,7 @@ drop table if exists t;
create table t (id int not null primary key, v0 longblob not null,v1 longblob not null);
select @@max_allowed_packet into @my_max_allowed_packet;
set global max_allowed_packet=100000000;
+connect conn1,localhost,root,,;
insert into t values (1,repeat('a',16*1024*1024),repeat('b',16*1024*1024));
ERROR HY000: Got error 22 "Invalid argument" from storage engine TokuDB
insert into t values (1,repeat('a',16*1024*1024),repeat('b',16*1024*1024-1));
@@ -40,5 +41,7 @@ id length(v0) length(v1)
2 1 1
3 1 1
4 1 1
+connection default;
+disconnect conn1;
set global max_allowed_packet=@my_max_allowed_packet;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb/r/tokudb_support_xa.result b/storage/tokudb/mysql-test/tokudb/r/tokudb_support_xa.result
index c265f38cdc2..120e8de7c7f 100644
--- a/storage/tokudb/mysql-test/tokudb/r/tokudb_support_xa.result
+++ b/storage/tokudb/mysql-test/tokudb/r/tokudb_support_xa.result
@@ -88,6 +88,8 @@ begin;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
create table t2 (a int);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+connect con1,localhost,root,,;
+connection con1;
xa start 'testa','testb';
ERROR XAE08: XAER_DUPID: The XID already exists
xa start 'testa','testb', 123;
@@ -101,6 +103,7 @@ ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction
xa recover;
formatID gtrid_length bqual_length data
11 5 5 testb 0@P`
+connection default;
xa prepare 'testa','testb';
xa recover;
formatID gtrid_length bqual_length data
@@ -114,6 +117,8 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
select * from t1;
a
20
+disconnect con1;
+connection default;
drop table t1;
'#--------------------end------------------------#'
SET @@session.tokudb_support_xa = @session_start_value;
diff --git a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_dels.result b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_dels.result
index 4d89ee445b0..8bbee9405b8 100644
--- a/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_dels.result
+++ b/storage/tokudb/mysql-test/tokudb_alter_table/r/hcad_with_dels.result
@@ -2,7 +2,9 @@ SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set session transaction isolation level repeatable read;
set session tokudb_disable_slow_alter=ON;
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo,bar;
+connection conn1;
set session transaction isolation level repeatable read;
create table foo (a int, b int) engine=TokuDB;
create table bar (a int) engine=TokuDB;
@@ -10,11 +12,16 @@ insert into foo values (1,10),(2,20),(3,30);
begin;
select * from bar;
a
+connection default;
delete from foo;
select * from foo;
a b
alter table foo add column c int first;
alter table foo drop column b;
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo,bar;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/1853.result b/storage/tokudb/mysql-test/tokudb_bugs/r/1853.result
index 72843d83b25..5fd72cb3ff2 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/1853.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/1853.result
@@ -1,6 +1,8 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level serializable;
create table foo ( a double, b double, c double, primary key (a,b));
insert into foo values (4,4,4),(4,5,5),(4,6,6),(5,4,4),(5,5,5),(5,6,6),(6,4,4),(6,5,5),(6,6,6);
@@ -10,10 +12,12 @@ a b c
6 4 4
6 5 5
6 6 6
+connection default;
set session transaction isolation level serializable;
insert into foo values (5,10,10);
insert into foo values (5.0001,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
begin;
select * from foo where a >= 5;
@@ -25,9 +29,11 @@ a b c
6 4 4
6 5 5
6 6 6
+connection default;
insert into foo values (5,1,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (4.999,10,10);
+connection conn1;
commit;
begin;
select * from foo where a < 5;
@@ -36,9 +42,11 @@ a b c
4 5 5
4 6 6
4.999 10 10
+connection default;
insert into foo values (5,0.1,10);
insert into foo values (4.9999,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
begin;
select * from foo where a <= 5;
@@ -52,9 +60,11 @@ a b c
5 5 5
5 6 6
5 10 10
+connection default;
insert into foo values (5,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.001,10,10);
+connection conn1;
commit;
begin;
select * from foo where a = 5;
@@ -64,10 +74,12 @@ a b c
5 5 5
5 6 6
5 10 10
+connection default;
insert into foo values (5,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.0001,10,10);
insert into foo values (4.99999,1,10);
+connection conn1;
commit;
begin;
select * from foo where a > 4 and a < 6;
@@ -81,12 +93,14 @@ a b c
5 10 10
5.0001 10 10
5.001 10 10
+connection default;
insert into foo values (4.1,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.9,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,10,10);
insert into foo values (4,10,10);
+connection conn1;
commit;
begin;
select * from foo where a >= 4 and a < 6;
@@ -104,12 +118,14 @@ a b c
5 10 10
5.0001 10 10
5.001 10 10
+connection default;
insert into foo values (4,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.9,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,1.1,10);
insert into foo values (3.99,10,10);
+connection conn1;
commit;
begin;
select * from foo where a > 4 and a <= 6;
@@ -128,12 +144,14 @@ a b c
6 5 5
6 6 6
6 10 10
+connection default;
insert into foo values (4.0001,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,1110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6.001,1.1,10);
insert into foo values (4,1110,10);
+connection conn1;
commit;
begin;
select * from foo where a >= 4 and a <= 6;
@@ -157,12 +175,14 @@ a b c
6 5 5
6 6 6
6 10 10
+connection default;
insert into foo values (4,0.001,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,11110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6.0001,1.1,10);
insert into foo values (3.99,10110,10);
+connection conn1;
commit;
delete from foo;
insert into foo values (4,4,4),(4,5,5),(4,6,6),(5,4,4),(5,5,5),(5,6,6),(6,4,4),(6,5,5),(6,6,6);
@@ -172,9 +192,11 @@ a b c
6 6 6
6 5 5
6 4 4
+connection default;
insert into foo values (5,10,10);
insert into foo values (5.0001,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
begin;
select * from foo where a >= 5 order by a desc;
@@ -186,9 +208,11 @@ a b c
5 6 6
5 5 5
5 4 4
+connection default;
insert into foo values (5,1,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (4.999,10,10);
+connection conn1;
commit;
begin;
select * from foo where a < 5 order by a desc;
@@ -197,9 +221,11 @@ a b c
4 6 6
4 5 5
4 4 4
+connection default;
insert into foo values (5,0.1,10);
insert into foo values (4.9999,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
begin;
select * from foo where a <= 5 order by a desc;
@@ -213,9 +239,11 @@ a b c
4 6 6
4 5 5
4 4 4
+connection default;
insert into foo values (5,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.001,10,10);
+connection conn1;
commit;
begin;
select * from foo where a = 5 order by a desc;
@@ -225,10 +253,12 @@ a b c
5 5 5
5 6 6
5 10 10
+connection default;
insert into foo values (5,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.0001,10,10);
insert into foo values (4.99999,1,10);
+connection conn1;
commit;
begin;
select * from foo where a > 4 and a < 6 order by a desc;
@@ -242,12 +272,14 @@ a b c
5 0.1 10
4.99999 1 10
4.999 10 10
+connection default;
insert into foo values (4.1,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.9,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,10,10);
insert into foo values (4,10,10);
+connection conn1;
commit;
begin;
select * from foo where a >= 4 and a < 6 order by a desc;
@@ -265,12 +297,14 @@ a b c
4 6 6
4 5 5
4 4 4
+connection default;
insert into foo values (4,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (5.9,10,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,1.1,10);
insert into foo values (3.99,10,10);
+connection conn1;
commit;
begin;
select * from foo where a > 4 and a <= 6 order by a desc;
@@ -289,12 +323,14 @@ a b c
5 0.1 10
4.99999 1 10
4.999 10 10
+connection default;
insert into foo values (4.0001,0.01,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,1110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6.001,1.1,10);
insert into foo values (4,1110,10);
+connection conn1;
commit;
begin;
select * from foo where a >= 4 and a <= 6 order by a desc;
@@ -318,21 +354,25 @@ a b c
4 6 6
4 5 5
4 4 4
+connection default;
insert into foo values (4,0.001,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6,11110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (6.0001,1.1,10);
insert into foo values (3.99,10110,10);
+connection conn1;
commit;
begin;
select count(*) from foo;
count(*)
23
+connection default;
insert into foo values (0,0.001,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (9999999,11110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
begin;
select * from foo order by a desc;
@@ -360,10 +400,12 @@ a b c
4 1110 10
3.99 10110 10
3.99 10 10
+connection default;
insert into foo values (0,0.001,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (9999999,11110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
alter table foo drop primary key;
begin;
@@ -392,9 +434,13 @@ a b c
6 10 10
6.0001 1.1 10
6.001 1.1 10
+connection default;
insert into foo values (0,0.001,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
insert into foo values (9999999,11110,10);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
+disconnect conn1;
+connection default;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/2494-read-committed.result b/storage/tokudb/mysql-test/tokudb_bugs/r/2494-read-committed.result
index 884767dbe94..63a9ef3d8ac 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/2494-read-committed.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/2494-read-committed.result
@@ -1,6 +1,8 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo;
+connection conn1;
set session transaction isolation level read committed;
create table foo ( a int, b int, primary key (a));
insert into foo values (1,1),(2,2),(3,1),(4,3);
@@ -18,6 +20,7 @@ a b
2 2
3 10
4 3
+connection default;
set session transaction isolation level read committed;
select * from foo;
a b
@@ -32,6 +35,7 @@ a b
2 2
3 10
4 3
+connection conn1;
rollback;
begin;
insert into foo values (5,1),(6,2),(7,1),(8,3);
@@ -45,6 +49,7 @@ a b
6 2
7 1
8 3
+connection default;
set session transaction isolation level read committed;
select * from foo;
a b
@@ -63,6 +68,7 @@ a b
6 2
7 1
8 3
+connection conn1;
commit;
begin;
delete from foo where b=1;
@@ -72,6 +78,7 @@ a b
4 3
6 2
8 3
+connection default;
set session transaction isolation level read committed;
select * from foo;
a b
@@ -90,6 +97,10 @@ a b
4 3
6 2
8 3
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/2641.result b/storage/tokudb/mysql-test/tokudb_bugs/r/2641.result
index bf4e7aec2d9..0af82cae523 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/2641.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/2641.result
@@ -1,18 +1,25 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo, bar;
+connection conn1;
set session transaction isolation level read committed;
create table foo ( a int, b int, primary key (a));
create table bar (a int);
begin;
insert into foo values (1,1),(2,2),(3,1),(4,3);
+connection default;
set session transaction isolation level repeatable read;
begin;
select * from bar;
a
+connection conn1;
commit;
+connection default;
select * from foo;
a b
commit;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo, bar;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/2952.result b/storage/tokudb/mysql-test/tokudb_bugs/r/2952.result
index d0319ab9f74..df6dd0604dc 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/2952.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/2952.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
DROP TABLE IF EXISTS foo;
+connection default;
set session transaction isolation level read uncommitted;
set session tokudb_prelock_empty=1;
set session tokudb_load_save_space=0;
@@ -15,6 +17,7 @@ foo CREATE TABLE `foo` (
) ENGINE=TokuDB DEFAULT CHARSET=latin1
begin;
insert into foo values (1,10,100),(2,20,200),(3,30,300);
+connection conn1;
set session transaction isolation level read uncommitted;
set session lock_wait_timeout=1;
insert into foo values (100,100,100);
@@ -23,6 +26,7 @@ alter table foo drop index a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
truncate table foo;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
drop table foo;
set session tokudb_prelock_empty=1;
@@ -38,12 +42,14 @@ foo CREATE TABLE `foo` (
) ENGINE=TokuDB DEFAULT CHARSET=latin1
begin;
insert into foo values (1,10,100),(2,20,200),(3,30,300);
+connection conn1;
insert into foo values (100,100,100);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
alter table foo drop index a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
truncate table foo;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
commit;
drop table foo;
set session tokudb_prelock_empty=0;
@@ -59,10 +65,14 @@ foo CREATE TABLE `foo` (
) ENGINE=TokuDB DEFAULT CHARSET=latin1
begin;
insert into foo values (1,10,100),(2,20,200),(3,30,300);
+connection conn1;
insert into foo values (100,100,100);
alter table foo drop index a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
truncate table foo;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
+disconnect conn1;
+connection default;
set session transaction isolation level serializable;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/5974-2.result b/storage/tokudb/mysql-test/tokudb_bugs/r/5974-2.result
index ee6970fce7d..b397c604b6b 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/5974-2.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/5974-2.result
@@ -4,11 +4,15 @@ create table toku1 (a int) engine=TokuDB;
create table toku2 (a int) engine=TokuDB;
insert into toku1 values (1),(2),(3);
insert into toku2 values (1),(2),(3);
+connect conn1,localhost,root,,;
+connection default;
set session transaction isolation level READ UNCOMMITTED;
begin;
insert into toku2 select * from toku1;
+connection conn1;
set session transaction isolation level READ UNCOMMITTED;
insert into toku1 values (4);
+connection default;
commit;
select * from toku2;
a
@@ -18,6 +22,7 @@ a
1
2
3
+connection conn1;
commit;
select * from toku1;
a
@@ -25,4 +30,6 @@ a
2
3
4
+connection default;
+disconnect conn1;
DROP TABLE toku1, toku2;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/5974.result b/storage/tokudb/mysql-test/tokudb_bugs/r/5974.result
index c22e565bcb4..338786c442e 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/5974.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/5974.result
@@ -4,11 +4,15 @@ create table toku1 (a int) engine=TokuDB;
create table toku2 (a int) engine=TokuDB;
insert into toku1 values (1),(2),(3);
insert into toku2 values (1),(2),(3);
+connect conn1,localhost,root,,;
+connection default;
set session transaction isolation level READ COMMITTED;
begin;
insert into toku2 select * from toku1;
+connection conn1;
set session transaction isolation level READ COMMITTED;
insert into toku1 values (4);
+connection default;
commit;
select * from toku2;
a
@@ -18,6 +22,7 @@ a
1
2
3
+connection conn1;
commit;
select * from toku1;
a
@@ -25,4 +30,6 @@ a
2
3
4
+connection default;
+disconnect conn1;
DROP TABLE toku1, toku2;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result
index f93f567961a..dff746fa280 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock.result
@@ -1,6 +1,8 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
set global tokudb_checkpoint_on_flush_logs=ON;
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
select DB, command, state, info from information_schema.processlist where id != connection_id();
DB command state info
test Sleep NULL
@@ -8,10 +10,15 @@ flush logs;
select DB, command, state, info from information_schema.processlist where id != connection_id();
DB command state info
test Sleep NULL
+connection conn1;
set tokudb_checkpoint_lock=1;
+connection default;
flush logs;;
+connection conn1;
select DB, command, state, info from information_schema.processlist where id != connection_id();
DB command state info
test Query init flush logs
set tokudb_checkpoint_lock=0;
+connection default;
+disconnect conn1;
set global tokudb_checkpoint_on_flush_logs=OFF;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result
index 3e689191d59..01d6d29d659 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/checkpoint_lock_3.result
@@ -1,5 +1,7 @@
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
+connection default;
select DB, command, state, info from information_schema.processlist where id != connection_id();
DB command state info
test Sleep NULL
@@ -7,9 +9,14 @@ flush logs;
select DB, command, state, info from information_schema.processlist where id != connection_id();
DB command state info
test Sleep NULL
+connection conn1;
set tokudb_checkpoint_lock=1;
+connection default;
flush logs;;
+connection conn1;
select DB, command, state, info from information_schema.processlist where id != connection_id();
DB command state info
test Sleep NULL
set tokudb_checkpoint_lock=0;
+connection default;
+disconnect conn1;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result b/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result
index 800db69ba39..92a18f4a97b 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/db801.result
@@ -2,17 +2,27 @@ set default_storage_engine=tokudb;
drop table if exists t;
create table t (id int not null primary key, c int not null) engine=tokudb;
insert into t values (1,0);
+connect conn1,localhost,root,,;
+connection default;
begin;
update t set c=10 where id=1;
+connection conn1;
update t set c=100;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
rollback;
+disconnect conn1;
drop table t;
create table t (id int not null primary key, c int not null) engine=tokudb partition by hash(id) partitions 1;
insert into t values (1,0);
+connect conn1,localhost,root,,;
+connection default;
begin;
update t set c=10 where id=1;
+connection conn1;
update t set c=100;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection default;
rollback;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-2.result b/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-2.result
index 3f9da4ac4af..fa7edccc719 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-2.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-2.result
@@ -1,10 +1,13 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo;
+connection conn1;
create table foo ( a int, b int, c int, key (a), key (b));
insert into foo values (1,10,100);
begin;
insert into foo values(2,20,200);
+connection default;
set session lock_wait_timeout=1;
select * from foo;
a b c
@@ -19,5 +22,8 @@ alter table foo add index (c);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
alter table foo drop index a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
+disconnect conn1;
+connection default;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-4.result b/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-4.result
index e026a151726..747869b37e9 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-4.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/fileops-4.result
@@ -1,10 +1,13 @@
# Establish connection conn1 (user = root)
+connect conn1,localhost,root,,;
SET DEFAULT_STORAGE_ENGINE = 'tokudb';
DROP TABLE IF EXISTS foo;
+connection conn1;
create table foo ( a int, b int, c int, key (a), key (b));
insert into foo values (1,10,100);
begin;
insert into foo values (2,20,200);
+connection default;
set session lock_wait_timeout=1;
select * from foo;
a b c
@@ -17,5 +20,9 @@ truncate table foo;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
alter table foo drop index a;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
commit;
+connection default;
+disconnect conn1;
+connection default;
DROP TABLE foo;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/ft-index-40.result b/storage/tokudb/mysql-test/tokudb_bugs/r/ft-index-40.result
index d4b2e44af3b..56d33a39494 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/ft-index-40.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/ft-index-40.result
@@ -1,22 +1,32 @@
drop table if exists t;
+connect conn1,localhost,root,,;
+connection default;
create table t (a varchar(50), primary key(a)) engine='tokudb';
insert into t values ("hello world");
select * from t;
a
hello world
begin;
+connection conn1;
select * from t;
a
hello world
+connection default;
update t set a="HELLO WORLD";
+connection conn1;
select * from t;
a
hello world
+connection default;
select * from t;
a
HELLO WORLD
rollback;
+connection conn1;
select * from t;
a
hello world
+connection default;
+connection default;
+disconnect conn1;
drop table t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/leak172.result b/storage/tokudb/mysql-test/tokudb_bugs/r/leak172.result
index c3d8358724f..fa98811c803 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/leak172.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/leak172.result
@@ -117,8 +117,13 @@ KEY `c27` (`c27`(255)),
KEY `c31` (`c31`)
);
LOAD DATA INFILE 'leak172_t1.data' INTO TABLE `t1` fields terminated by ',';
+connect conn1,localhost,root,,;
set session debug_dbug="+d,tokudb_end_bulk_insert_sleep";
LOAD DATA INFILE 'leak172_t2.data' INTO TABLE `t2` fields terminated by ',';
+connection default;
UPDATE t1, t2 SET t1.`c5` = 4 WHERE t1.`c6` <= 'o';
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection conn1;
+connection default;
+disconnect conn1;
drop table t1,t2;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_empty.result b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_empty.result
index 325aef46afe..eabe936c6c1 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_empty.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_empty.result
@@ -1,28 +1,42 @@
set default_storage_engine=tokudb;
drop table if exists t;
create table t (id int, unique key(id));
+connect c1,localhost,root,,;
set tokudb_prelock_empty=OFF;
begin;
insert into t values (1);
+connect c2,localhost,root,,;
begin;
insert into t values (2);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
1
2
+disconnect c1;
+disconnect c2;
drop table if exists t;
create table t (id int not null, unique key(id));
+connect c1,localhost,root,,;
set tokudb_prelock_empty=OFF;
begin;
insert into t values (1);
+connect c2,localhost,root,,;
begin;
insert into t values (2);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
1
2
+disconnect c1;
+disconnect c2;
drop table if exists t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_left.result b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_left.result
index b94dbbbd1b5..a561f2bb3a0 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_left.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_left.result
@@ -2,31 +2,45 @@ set default_storage_engine=tokudb;
drop table if exists t;
create table t (id int, unique key(id));
insert into t values (10),(100);
+connect c1,localhost,root,,;
begin;
insert into t values (5);
+connect c2,localhost,root,,;
begin;
insert into t values (6);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
5
6
10
100
+disconnect c1;
+disconnect c2;
drop table if exists t;
create table t (id int not null, unique key(id));
insert into t values (10),(100);
+connect c1,localhost,root,,;
begin;
insert into t values (5);
+connect c2,localhost,root,,;
begin;
insert into t values (6);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
5
6
10
100
+disconnect c1;
+disconnect c2;
drop table if exists t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_middle.result b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_middle.result
index 763cfc88812..87515acab10 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_middle.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_middle.result
@@ -2,31 +2,45 @@ set default_storage_engine=tokudb;
drop table if exists t;
create table t (id int, unique key(id));
insert into t values (10),(100);
+connect c1,localhost,root,,;
begin;
insert into t values (50);
+connect c2,localhost,root,,;
begin;
insert into t values (60);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
10
50
60
100
+disconnect c1;
+disconnect c2;
drop table if exists t;
create table t (id int not null, unique key(id));
insert into t values (10),(100);
+connect c1,localhost,root,,;
begin;
insert into t values (50);
+connect c2,localhost,root,,;
begin;
insert into t values (60);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
10
50
60
100
+disconnect c1;
+disconnect c2;
drop table if exists t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_right.result b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_right.result
index b820a4f0806..6ec937f5850 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_right.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/lock_uniq_key_right.result
@@ -2,31 +2,45 @@ set default_storage_engine=tokudb;
drop table if exists t;
create table t (id int, unique key(id));
insert into t values (10),(100);
+connect c1,localhost,root,,;
begin;
insert into t values (500);
+connect c2,localhost,root,,;
begin;
insert into t values (600);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
10
100
500
600
+disconnect c1;
+disconnect c2;
drop table if exists t;
create table t (id int not null, unique key(id));
insert into t values (10),(100);
+connect c1,localhost,root,,;
begin;
insert into t values (500);
+connect c2,localhost,root,,;
begin;
insert into t values (600);
+connection c1;
commit;
+connection c2;
commit;
+connection default;
select * from t;
id
10
100
500
600
+disconnect c1;
+disconnect c2;
drop table if exists t;
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_mixed_replace_into.result b/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_mixed_replace_into.result
index b1482aa0144..abe80743f62 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_mixed_replace_into.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_mixed_replace_into.result
@@ -11,11 +11,13 @@ pk num txt
2 2 twotwo
3 3 three
4 4 four
+connection slave;
select * from testr;
pk num txt
1 1 one
2 2 twotwo
3 3 three
4 4 four
+connection master;
drop table testr;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_row_replace_into.result b/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_row_replace_into.result
index b1482aa0144..abe80743f62 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_row_replace_into.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_row_replace_into.result
@@ -11,11 +11,13 @@ pk num txt
2 2 twotwo
3 3 three
4 4 four
+connection slave;
select * from testr;
pk num txt
1 1 one
2 2 twotwo
3 3 three
4 4 four
+connection master;
drop table testr;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_stmt_replace_into.result b/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_stmt_replace_into.result
index b1482aa0144..abe80743f62 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_stmt_replace_into.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/rpl_stmt_replace_into.result
@@ -11,11 +11,13 @@ pk num txt
2 2 twotwo
3 3 three
4 4 four
+connection slave;
select * from testr;
pk num txt
1 1 one
2 2 twotwo
3 3 three
4 4 four
+connection master;
drop table testr;
include/rpl_end.inc
diff --git a/storage/tokudb/mysql-test/tokudb_bugs/r/xa.result b/storage/tokudb/mysql-test/tokudb_bugs/r/xa.result
index 5a117087412..93193dd9b43 100644
--- a/storage/tokudb/mysql-test/tokudb_bugs/r/xa.result
+++ b/storage/tokudb/mysql-test/tokudb_bugs/r/xa.result
@@ -28,6 +28,8 @@ begin;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
create table t2 (a int);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+connect con1,localhost,root,,;
+connection con1;
xa start 'testa','testb';
ERROR XAE08: XAER_DUPID: The XID already exists
xa start 'testa','testb', 123;
@@ -41,6 +43,7 @@ ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction
xa recover;
formatID gtrid_length bqual_length data
11 5 5 testb 0@P`
+connection default;
xa prepare 'testa','testb';
xa recover;
formatID gtrid_length bqual_length data
@@ -51,20 +54,29 @@ ERROR XAE04: XAER_NOTA: Unknown XID
xa rollback 'testa','testb';
xa start 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz';
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
+connection con1;
xa rollback 'testb',0x2030405060,11;
+connection default;
select * from t1;
a
20
drop table t1;
+disconnect con1;
drop table if exists t1;
create table t1(a int, b int, c varchar(20), primary key(a)) engine = tokudb;
insert into t1 values(1, 1, 'a');
insert into t1 values(2, 2, 'b');
+connect con1,localhost,root,,;
+connect con2,localhost,root,,;
+connection con1;
xa start 'a','b';
update t1 set c = 'aa' where a = 1;
+connection con2;
xa start 'a','c';
update t1 set c = 'bb' where a = 2;
+connection con1;
update t1 set c = 'bb' where a = 2;
+connection con2;
update t1 set c = 'aa' where a = 1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
select count(*) from t1;
@@ -72,9 +84,17 @@ count(*)
2
xa end 'a','c';
xa rollback 'a','c';
+disconnect con2;
+connect con3,localhost,root,,;
+connection con3;
xa start 'a','c';
+connection con1;
xa end 'a','b';
xa rollback 'a','b';
+connection con3;
+disconnect con1;
+disconnect con3;
+connection default;
drop table t1;
#
# BUG#51342 - more xid crashing
@@ -110,20 +130,28 @@ xa prepare 'a';
xa commit 'a';
CREATE TABLE t1(a INT, KEY(a)) ENGINE=TokuDB;
INSERT INTO t1 VALUES(1),(2);
+connect con1,localhost,root,,;
BEGIN;
UPDATE t1 SET a=3 WHERE a=1;
+connection default;
BEGIN;
UPDATE t1 SET a=4 WHERE a=2;
+connection con1;
UPDATE t1 SET a=5 WHERE a=2;
+connection default;
UPDATE t1 SET a=5 WHERE a=1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
ROLLBACK;
+connection con1;
ROLLBACK;
BEGIN;
UPDATE t1 SET a=3 WHERE a=1;
+connection default;
XA START 'xid1';
UPDATE t1 SET a=4 WHERE a=2;
+connection con1;
UPDATE t1 SET a=5 WHERE a=2;
+connection default;
UPDATE t1 SET a=5 WHERE a=1;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
XA END 'xid1';
@@ -131,5 +159,8 @@ XA ROLLBACK 'xid1';
XA START 'xid1';
XA END 'xid1';
XA ROLLBACK 'xid1';
+connection con1;
commit;
+connection default;
+disconnect con1;
DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/autoinc.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/autoinc.result
index 3d424357736..098fcb67549 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/r/autoinc.result
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/autoinc.result
@@ -1,29 +1,36 @@
create table t1 (a int auto_increment, b bigint(20), primary key (b,a)) engine=tokudb;
start transaction;
insert t1 (b) values (1);
+connect con2,localhost,root;
set tokudb_lock_timeout=1;
insert t1 (b) values (1);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set tokudb_lock_timeout=default;
insert t1 (b) values (1);
+connection default;
insert t1 (b) values (1);
commit;
+connection con2;
commit;
select * from t1;
a b
1 1
2 1
3 1
+connection default;
alter table t1 partition by range (b) (partition p0 values less than (9));
start transaction;
insert t1 (b) values (2);
+connection con2;
set tokudb_lock_timeout=1;
insert t1 (b) values (2);
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
set tokudb_lock_timeout=default;
insert t1 (b) values (2);
+connection default;
insert t1 (b) values (2);
commit;
+connection con2;
commit;
select * from t1;
a b
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result
index 625bb255755..0a492ca2f2a 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/mdev5426.result
@@ -2,5 +2,8 @@ CREATE TABLE t1 (i INT) ENGINE=TokuDB;
EXPLAIN INSERT INTO t1 SELECT * FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 0 Using temporary
+connect con1,localhost,root,,test;
INSERT INTO t1 SELECT * FROM t1;
+connection default;
+disconnect con1;
DROP TABLE t1;
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/optimize.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/optimize.result
index c32a7d61129..ac7174137a8 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/r/optimize.result
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/optimize.result
@@ -2,12 +2,15 @@ create table t1 (a int) engine=tokudb;
insert t1 values (1),(2),(3);
set debug_sync='before_admin_operator_func WAIT_FOR go';
OPTIMIZE TABLE t1;
+connect c1,localhost,root,,;
select * from t1;
a
1
2
3
set debug_sync='now SIGNAL go';
+disconnect c1;
+connection default;
Table Op Msg_type Msg_text
test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
test.t1 optimize status OK
diff --git a/storage/tokudb/mysql-test/tokudb_mariadb/r/xa.result b/storage/tokudb/mysql-test/tokudb_mariadb/r/xa.result
index ca86d854bdb..4724a0af926 100644
--- a/storage/tokudb/mysql-test/tokudb_mariadb/r/xa.result
+++ b/storage/tokudb/mysql-test/tokudb_mariadb/r/xa.result
@@ -34,6 +34,8 @@ begin;
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
create table t2 (a int);
ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction is in the IDLE state
+connect con1,localhost,root,,;
+connection con1;
xa start 'testa','testb';
ERROR XAE08: XAER_DUPID: The XID already exists
xa start 'testa','testb', 123;
@@ -47,6 +49,7 @@ ERROR XAE07: XAER_RMFAIL: The command cannot be executed when global transaction
xa recover;
formatID gtrid_length bqual_length data
11 5 5 testb 0@P`
+connection default;
xa prepare 'testa','testb';
xa recover;
formatID gtrid_length bqual_length data
@@ -60,4 +63,6 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
select * from t1;
a
20
+disconnect con1;
+connection default;
drop table t1;
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
index 2101feaacb3..e6ea7f95cc9 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_auto_increment_tokudb.result
@@ -445,28 +445,30 @@ t1 CREATE TABLE `t1` (
PARTITIONS 2 */
DROP TABLE t1;
# Test with two threads
-# con default
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'TokuDB'
PARTITION BY HASH(c1)
PARTITIONS 2;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connect con1, localhost, root,,;
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -484,26 +486,27 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction NO PARTITIONING
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'TokuDB';
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (NULL);
INSERT INTO t1 (c1) VALUES (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -518,7 +521,8 @@ c1
10
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -547,7 +551,8 @@ c1
24
DROP TABLE t1;
# Test with two threads + start transaction
-# con default
+connect con1, localhost, root,,;
+connection default;
CREATE TABLE t1 (c1 INT NOT NULL AUTO_INCREMENT, PRIMARY KEY (c1))
ENGINE = 'TokuDB'
PARTITION BY HASH(c1)
@@ -555,17 +560,17 @@ PARTITIONS 2;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (2);
INSERT INTO t1 (c1) VALUES (4);
-# con1
+connection con1;
START TRANSACTION;
INSERT INTO t1 (c1) VALUES (NULL), (10);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (NULL), (NULL), (19);
INSERT INTO t1 (c1) VALUES (21);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
-# con default
+connection default;
INSERT INTO t1 (c1) VALUES (16);
-# con1
+connection con1;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
@@ -580,7 +585,8 @@ c1
10
22
23
-# con default
+disconnect con1;
+connection default;
INSERT INTO t1 (c1) VALUES (NULL);
SELECT * FROM t1 ORDER BY c1;
c1
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result
index 7776c44c8e8..beb499dd45a 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_debug_sync_tokudb.result
@@ -15,8 +15,10 @@ a
1
21
33
+connect con1, localhost, root,,;
# con1 (send)
ALTER TABLE t1 TRUNCATE PARTITION pMax;
+connection default;
# con default
SELECT * FROM t1;
a
@@ -26,7 +28,10 @@ a
# Commit will allow the TRUNCATE to finish
COMMIT;
# con1 (reap)
+connection con1;
# con1 (disconnect)
+disconnect con1;
+connection default;
# default connection
SELECT * FROM t1;
a
@@ -61,6 +66,7 @@ SELECT TABLE_SCHEMA, TABLE_NAME, PARTITION_NAME, PARTITION_ORDINAL_POSITION,
PARTITION_DESCRIPTION, TABLE_ROWS
FROM INFORMATION_SCHEMA.PARTITIONS
WHERE TABLE_NAME = 't1' AND TABLE_SCHEMA = 'test';
+connect con1, localhost, root,,;
SET DEBUG_SYNC = 'now WAIT_FOR parked';
# When waiting for the name lock in get_all_tables in sql_show.cc
# this will not be concurrent any more, thus the TIMEOUT
@@ -72,6 +78,8 @@ ALTER TABLE t1 REORGANIZE PARTITION p0 INTO
PARTITION p10 VALUES LESS THAN MAXVALUE);
Warnings:
Warning 1639 debug sync point wait timed out
+disconnect con1;
+connection default;
TABLE_SCHEMA TABLE_NAME PARTITION_NAME PARTITION_ORDINAL_POSITION PARTITION_DESCRIPTION TABLE_ROWS
test t1 p0 1 10 1
test t1 p10 2 MAXVALUE 3
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
index e539c37a0b4..03ef0ed2c09 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_5_tokudb.result
@@ -4,7 +4,7 @@ GRANT USAGE ON *.* TO test1@localhost;
GRANT USAGE ON *.* TO test2@localhost;
GRANT CREATE, DROP, INSERT, SELECT ON test.* TO test1@localhost;
GRANT CREATE, DROP, ALTER, UPDATE, INSERT, SELECT ON test.* TO test2@localhost;
-connect (test1,localhost,test1,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test1,localhost,test1,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SELECT current_user();
current_user()
test1@localhost
@@ -15,7 +15,7 @@ GRANT SELECT, INSERT, CREATE, DROP ON `test`.* TO 'test1'@'localhost'
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
ERROR 42000: ALTER command denied to user 'test1'@'localhost' for table 'tp'
disconnect test1;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SELECT current_user();
current_user()
@@ -73,7 +73,7 @@ a b
disconnect test2;
connection default;
REVOKE ALTER ON test.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
USE test;
SELECT current_user();
current_user()
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_7_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_7_tokudb.result
index 8ae4bfd3d3a..0913bbaa55b 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_7_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_7_tokudb.result
@@ -1,7 +1,7 @@
CREATE USER test_2@localhost;
send
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t_10;
-connect (test_2,localhost,test_2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test_2,localhost,test_2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
SELECT * FROM t_10;
a b
2 Two
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_8_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_8_tokudb.result
index b252fc616b1..2fd45be9261 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_8_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exch_qa_8_tokudb.result
@@ -4,7 +4,7 @@ USE testdb;
USE test;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on test.* TO test2@localhost;
GRANT CREATE, ALTER, DROP, INSERT, SELECT on testdb.* TO test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
SELECT * FROM testdb.t_10;
a b
@@ -60,7 +60,7 @@ a b
disconnect test2;
connection default;
REVOKE INSERT ON testdb.* FROM test2@localhost;
-connect (test2,localhost,test2,,test,MASTER_MYPORT,MASTER_MYSOCK);
+connect test2,localhost,test2,,test,$MASTER_MYPORT,$MASTER_MYSOCK;
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE testdb.t_10;
ERROR 42000: INSERT command denied to user 'test2'@'localhost' for table 't_10'
ALTER TABLE testdb.tp EXCHANGE PARTITION p0 WITH TABLE t_10;
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result
index beed3486d98..7e48fcc5386 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_exchange_tokudb.result
@@ -147,13 +147,13 @@ a b
64 Sixty four
# Start by testing read/write locking
SET AUTOCOMMIT = 1;
-# con1
+connect con1, localhost, root,,;
SET DEBUG_SYNC= 'swap_partition_after_compare_tables SIGNAL swap_in_progress WAIT_FOR goto_verification';
SET DEBUG_SYNC= 'swap_partition_first_row_read SIGNAL swap_in_progress WAIT_FOR goto_wait';
SET DEBUG_SYNC= 'swap_partition_after_wait SIGNAL swap_in_progress WAIT_FOR goto_rename';
SET DEBUG_SYNC= 'swap_partition_before_rename SIGNAL swap_in_progress WAIT_FOR test_done';
ALTER TABLE tp EXCHANGE PARTITION p0 WITH TABLE t;
-# con default
+connection default;
SET DEBUG_SYNC= 'now WAIT_FOR swap_in_progress';
# select from t and select/update/delete/insert from tp should work
SELECT * FROM t WHERE a = 99;
@@ -295,8 +295,8 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SHOW CREATE TABLE tp;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
SET DEBUG_SYNC= 'now SIGNAL test_done';
-# con1
-# con default
+connection con1;
+connection default;
# Tables should now be as normal
SHOW CREATE TABLE t;
Table Create Table
@@ -329,7 +329,8 @@ INSERT INTO tp VALUES (63, "Sixty three, new"), (59, "To be deleted");
DELETE FROM tp WHERE a = 3;
ALTER TABLE t ENGINE = 'TokuDB';
ALTER TABLE tp ENGINE = 'TokuDB';
-# con default
+disconnect con1;
+connection default;
SET DEBUG_SYNC= 'RESET';
SHOW CREATE TABLE t;
Table Create Table
diff --git a/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result b/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result
index 349d96a9dd7..2ebcef1f005 100644
--- a/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result
+++ b/storage/tokudb/mysql-test/tokudb_parts/r/partition_special_tokudb.result
@@ -215,22 +215,33 @@ PRIMARY KEY (a))
ENGINE = TokuDB
PARTITION BY HASH (a)
PARTITIONS 2;
+connect con1, localhost, root,,;
+connect con2, localhost, root,,;
+connection con1;
SET autocommit=OFF;
START TRANSACTION;
INSERT INTO t1 VALUES (NULL, 'first row t2');
+connection con2;
SET autocommit=OFF;
SET SESSION lock_wait_timeout= 1;
ALTER TABLE t1 AUTO_INCREMENT = 10;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+disconnect con2;
+disconnect con1;
+connection default;
DROP TABLE t1;
#
# Bug#53676: Unexpected errors and possible table corruption on
# ADD PARTITION and LOCK TABLE
+connect con1,localhost,root,,;
CREATE TABLE t1 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = TokuDB PARTITION BY HASH(i) PARTITIONS 2;
+connect con2,localhost,root,,;
SET lock_wait_timeout = 2;
+connection con1;
#Connection 1 locks the table
LOCK TABLE t1 READ;
+connection con2;
# Connection 2 tries to add partitions:
# First attempt: lock wait timeout (as expected)
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
@@ -238,9 +249,11 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
# Second attempt: says that partition already exists
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con1;
# Connection 1 unlocks the table and locks it again:
UNLOCK TABLES;
LOCK TABLE t1 READ;
+connection con2;
# Connection 2 tries again to add partitions:
# Third attempt: says that the table does not exist
ALTER TABLE t1 ADD PARTITION PARTITIONS 2;
@@ -249,39 +262,57 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
+connection con1;
UNLOCK TABLES;
+connection con2;
DROP TABLE t1;
+connection con1;
CREATE TABLE t2 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = TokuDB PARTITION BY HASH(i) PARTITIONS 2;
+connection con2;
SET lock_wait_timeout = 2;
+connection con1;
LOCK TABLE t2 READ;
+connection con2;
ALTER TABLE t2 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
ALTER TABLE t2 ADD PARTITION PARTITIONS 2;
+connection con1;
UNLOCK TABLES;
+connection con2;
+connect con3,localhost,root,,;
CHECK TABLE t2;
Table Op Msg_type Msg_text
test.t2 check status OK
SELECT * FROM t2;
i f
DROP TABLE t2;
+connection con1;
CREATE TABLE t3 ( i INT NOT NULL AUTO_INCREMENT PRIMARY KEY, f INT )
ENGINE = TokuDB PARTITION BY HASH(i) PARTITIONS 2;
+connection con2;
SET lock_wait_timeout = 2;
+connection con1;
# Connection 1 locks the table
LOCK TABLE t3 READ;
+connection con2;
# Connection 2 tries to add partitions (timeout):
ALTER TABLE t3 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connection con3;
SET lock_wait_timeout = 2;
# Connection 3 tries to add partitions (partition already exists):
ALTER TABLE t3 ADD PARTITION PARTITIONS 2;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
+connect con4,localhost,root,,;
# Connection 4 tries to rename the table:
RENAME TABLE t3 TO t4;
+connection con1;
# Connection 1 unlocks the table:
UNLOCK TABLES;
+connection con4;
# Connection 4 gets error on rename:
+connect con5,localhost,root,,;
# SHOW TABLES returns the table (not renamed):
SHOW TABLES;
Tables_in_test
@@ -290,3 +321,9 @@ t4
SELECT * FROM t3;
ERROR 42S02: Table 'test.t3' doesn't exist
DROP TABLE t4;
+disconnect con5;
+disconnect con4;
+disconnect con3;
+disconnect con2;
+disconnect con1;
+connection default;