summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite')
-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
1062 files changed, 18155 insertions, 5214 deletions
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