|
| 1 | +include/master-slave.inc |
| 2 | +Warnings: |
| 3 | +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. |
| 4 | +Note #### Storing MySQL user name or password information in the master info repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START SLAVE; see the 'START SLAVE Syntax' in the MySQL Manual for more information. |
| 5 | +[connection master] |
| 6 | +set @save.binlog_trx_meta_data= @@global.binlog_trx_meta_data; |
| 7 | +set @@global.binlog_trx_meta_data= true; |
| 8 | +set @save.binlog_trx_meta_data= @@global.binlog_trx_meta_data; |
| 9 | +set @@global.binlog_trx_meta_data= true; |
| 10 | +drop database if exists test2; |
| 11 | +drop database if exists test3; |
| 12 | +drop database if exists test4; |
| 13 | +create database test2 db_metadata '{"shard":"test2_shard", "replicaset":"test2_replicaset"}'; |
| 14 | +create database test3 db_metadata '{"shard":"test3_shard", "replicaset":"test3_replicaset"}'; |
| 15 | +use test; |
| 16 | +create table t1 (a int primary key, b char(8)); |
| 17 | +insert into t1 values(1, 'a'); |
| 18 | +insert into t1 values(2, 'b'); |
| 19 | +use test2; |
| 20 | +create table t1 (a int primary key, b char(8)); |
| 21 | +insert into t1 values(1, 'a'); |
| 22 | +insert into t1 values(2, 'b'); |
| 23 | +use test3; |
| 24 | +create table t1 (a int primary key, b char(8)); |
| 25 | +insert into t1 values(1, 'a'); |
| 26 | +insert into t1 values(2, 'b'); |
| 27 | +alter database test3 db_metadata '{"shard":"test3_shard_updated", "replicaset":"test3_replicaset_updated"}'; |
| 28 | +insert into t1 values(3, 'c'); |
| 29 | +insert into t1 values(4, 'd'); |
| 30 | +create database test4 db_metadata '{"shard":"newly_added_shard_for_test4", "replicaset":"new_replicaset_for_test4"}'; |
| 31 | +insert into t1 values(5, 'e'); |
| 32 | +insert into t1 values(6, 'f'); |
| 33 | +use test4; |
| 34 | +create table t1 (a int primary key, b char(8)); |
| 35 | +insert into t1 values(1, 'a'); |
| 36 | +insert into t1 values(2, 'b'); |
| 37 | +# /*::TRX_META_DATA::{"ts":[ts]}*/ |
| 38 | +# /*::TRX_META_DATA::{"ts":[ts]}*/ |
| 39 | +# /*::TRX_META_DATA::{"ts":[ts]}*/ |
| 40 | +# /*::TRX_META_DATA::{"shard":"test2_shard","replicaset":"test2_replicaset","ts":[ts]}*/ |
| 41 | +# /*::TRX_META_DATA::{"shard":"test2_shard","replicaset":"test2_replicaset","ts":[ts]}*/ |
| 42 | +# /*::TRX_META_DATA::{"shard":"test2_shard","replicaset":"test2_replicaset","ts":[ts]}*/ |
| 43 | +# /*::TRX_META_DATA::{"shard":"test3_shard","replicaset":"test3_replicaset","ts":[ts]}*/ |
| 44 | +# /*::TRX_META_DATA::{"shard":"test3_shard","replicaset":"test3_replicaset","ts":[ts]}*/ |
| 45 | +# /*::TRX_META_DATA::{"shard":"test3_shard","replicaset":"test3_replicaset","ts":[ts]}*/ |
| 46 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts]}*/ |
| 47 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts]}*/ |
| 48 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts]}*/ |
| 49 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts]}*/ |
| 50 | +# /*::TRX_META_DATA::{"shard":"newly_added_shard_for_test4","replicaset":"new_replicaset_for_test4","ts":[ts]}*/ |
| 51 | +# /*::TRX_META_DATA::{"shard":"newly_added_shard_for_test4","replicaset":"new_replicaset_for_test4","ts":[ts]}*/ |
| 52 | +# /*::TRX_META_DATA::{"shard":"newly_added_shard_for_test4","replicaset":"new_replicaset_for_test4","ts":[ts]}*/ |
| 53 | +include/sync_slave_sql_with_master.inc |
| 54 | +# /*::TRX_META_DATA::{"ts":[ts,ts]}*/ |
| 55 | +# /*::TRX_META_DATA::{"ts":[ts,ts]}*/ |
| 56 | +# /*::TRX_META_DATA::{"ts":[ts,ts]}*/ |
| 57 | +# /*::TRX_META_DATA::{"shard":"test2_shard","replicaset":"test2_replicaset","ts":[ts,ts]}*/ |
| 58 | +# /*::TRX_META_DATA::{"shard":"test2_shard","replicaset":"test2_replicaset","ts":[ts,ts]}*/ |
| 59 | +# /*::TRX_META_DATA::{"shard":"test2_shard","replicaset":"test2_replicaset","ts":[ts,ts]}*/ |
| 60 | +# /*::TRX_META_DATA::{"shard":"test3_shard","replicaset":"test3_replicaset","ts":[ts,ts]}*/ |
| 61 | +# /*::TRX_META_DATA::{"shard":"test3_shard","replicaset":"test3_replicaset","ts":[ts,ts]}*/ |
| 62 | +# /*::TRX_META_DATA::{"shard":"test3_shard","replicaset":"test3_replicaset","ts":[ts,ts]}*/ |
| 63 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts,ts]}*/ |
| 64 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts,ts]}*/ |
| 65 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts,ts]}*/ |
| 66 | +# /*::TRX_META_DATA::{"shard":"test3_shard_updated","replicaset":"test3_replicaset_updated","ts":[ts,ts]}*/ |
| 67 | +# /*::TRX_META_DATA::{"shard":"newly_added_shard_for_test4","replicaset":"new_replicaset_for_test4","ts":[ts,ts]}*/ |
| 68 | +# /*::TRX_META_DATA::{"shard":"newly_added_shard_for_test4","replicaset":"new_replicaset_for_test4","ts":[ts,ts]}*/ |
| 69 | +# /*::TRX_META_DATA::{"shard":"newly_added_shard_for_test4","replicaset":"new_replicaset_for_test4","ts":[ts,ts]}*/ |
| 70 | +use test; |
| 71 | +drop table if exists t1; |
| 72 | +drop database if exists test2; |
| 73 | +drop database if exists test3; |
| 74 | +drop database if exists test4; |
| 75 | +include/sync_slave_sql_with_master.inc |
| 76 | +set @@global.binlog_trx_meta_data= @save.binlog_trx_meta_data; |
| 77 | +set @@global.binlog_trx_meta_data= @save.binlog_trx_meta_data; |
| 78 | +include/rpl_end.inc |
0 commit comments