[ Avaa Bypassed ]




Upload:

Command:

hmhc3928@3.12.163.23: ~ $
include/master-slave.inc
[connection master]
insert into mysql.ndb_replication values ("test", "t1_old", 0, 7, "NDB$OLD(X)");
insert into mysql.ndb_replication values ("test", "t1_max", 0, 7, "NDB$MAX(X)");
insert into mysql.ndb_replication values ("test", "t1_max_delete_win", 0, 7, "NDB$MAX_DELETE_WIN(X)");
create table `t1_old$EX`
  (server_id int unsigned,
master_server_id int unsigned,
master_epoch bigint unsigned,
count int unsigned,
a int not null,
primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
create table `t1_max$EX`
  (server_id int unsigned,
master_server_id int unsigned,
master_epoch bigint unsigned,
count int unsigned,
a int not null,
primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
create table `t1_max_delete_win$EX`
  (server_id int unsigned,
master_server_id int unsigned,
master_epoch bigint unsigned,
count int unsigned,
a int not null,
primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
create table t1_old (a int primary key, b varchar(32), X int unsigned) engine = ndb;
create table t1_max (a int primary key, b varchar(32), X int unsigned) engine = ndb;
create table t1_max_delete_win (a int primary key, b varchar(32), X int unsigned) engine = ndb;
"Test 1"
insert into t1_old values (1, 'Initial X=1', 1);
insert into t1_max values (1, 'Initial X=1', 1);
insert into t1_max_delete_win values (1, 'Initial X=1', 1);
update t1_old set X = 2, b='Slave X=2';
update t1_max set X = 2, b='Slave X=2';
update t1_max_delete_win set X = 2, b='Slave X=2';
update t1_old set X = 3, b='Master X=3';
update t1_max set X = 3, b='Master X=3';
update t1_max_delete_win set X = 3, b='Master X=3';
"Expect t1_old to contain slave row, and t1_max* to contain master row"
select * from t1_old;
a	b	X
1	Slave X=2	2
select * from t1_max;
a	b	X
1	Master X=3	3
select * from t1_max_delete_win;
a	b	X
1	Master X=3	3
update t1_old set X = 3, b='Master X=3';
"Test 2"
update t1_old set X = 4, b='Slave X=4';
update t1_max set X = 4, b='Slave X=4';
update t1_max_delete_win set X = 4, b='Slave X=4';
delete from t1_old;
delete from t1_max;
delete from t1_max_delete_win;
"Expect t1_old and t1_max to contain slave row, and t1_max_delete_win to be empty(as master)"
select * from t1_old;
a	b	X
1	Slave X=4	4
select * from t1_max;
a	b	X
1	Slave X=4	4
select * from t1_max_delete_win;
a	b	X
delete from t1_old;
delete from t1_max;
drop table t1_old, t1_max, t1_max_delete_win;
delete from t1_old$EX;
delete from t1_max$EX;
delete from t1_max_delete_win$EX;
delete from t1_old$EX;
delete from t1_max$EX;
delete from t1_max_delete_win$EX;
create table t1_old (a int primary key, b longtext, X int unsigned) engine = ndb;
create table t1_max (a int primary key, b longtext, X int unsigned) engine = ndb;
create table t1_max_delete_win (a int primary key, b longtext, X int unsigned) engine = ndb;
"Test 3"
insert into t1_old values (1, repeat('Initial X=1',1000), 1);
insert into t1_max values (1, repeat('Initial X=1',1000), 1);
insert into t1_max_delete_win values (1, repeat('Initial X=1',1000), 1);
update t1_old set X = 2, b=repeat('Slave X=2',1001);
update t1_max set X = 2, b=repeat('Slave X=2',1001);
update t1_max_delete_win set X = 2, b=repeat('Slave X=2',1001);
update t1_old set X = 3, b=repeat('Master X=3',1002);
update t1_max set X = 3, b=repeat('Master X=3',1002);
update t1_max_delete_win set X = 3, b=repeat('Master X=3',1002);
"Expect t1_old to contain slave row, and t1_max* to contain master row"
select a, left(b, 20), length(b), X from t1_old;
a	left(b, 20)	length(b)	X
1	Slave X=2Slave X=2Sl	9009	2
select a, left(b, 20), length(b), X from t1_max;
a	left(b, 20)	length(b)	X
1	Master X=3Master X=3	10020	3
select a, left(b, 20), length(b), X from t1_max_delete_win;
a	left(b, 20)	length(b)	X
1	Master X=3Master X=3	10020	3
Expect t1_old to have 1 entry, and t1_max* to have no entries
select server_id, master_server_id, count, a from t1_old$EX order by count;
server_id	master_server_id	count	a
2	1	1	1
select server_id, master_server_id, count, a from t1_max$EX order by count;
server_id	master_server_id	count	a
select server_id, master_server_id, count, a from t1_max_delete_win$EX order by count;
server_id	master_server_id	count	a
delete from t1_max$EX;
delete from t1_max_delete_win$EX;
delete from t1_old$EX;
update t1_old set X = 3, b=repeat('Master X=3', 1002);
"Test 4"
update t1_old set X = 4, b=repeat('Slave X=4',2000);
update t1_max set X = 4, b=repeat('Slave X=4',2000);
update t1_max_delete_win set X = 4, b=repeat('Slave X=4',2000);
delete from t1_old;
delete from t1_max;
delete from t1_max_delete_win;
"Expect t1_old and t1_max to contain slave row, and t1_max_delete_win to be empty(as master)"
select a, left(b, 20), length(b), X from t1_old;
a	left(b, 20)	length(b)	X
1	Slave X=4Slave X=4Sl	18000	4
select a, left(b, 20), length(b), X from t1_max;
a	left(b, 20)	length(b)	X
1	Slave X=4Slave X=4Sl	18000	4
select a, left(b, 20), length(b), X from t1_max_delete_win;
a	left(b, 20)	length(b)	X
Expect t1_old and t1_max to contain 1 entry, and t1_max_delete_win to be empty
select server_id, master_server_id, count, a from t1_old$EX order by count;
server_id	master_server_id	count	a
2	1	2	1
select server_id, master_server_id, count, a from t1_max$EX order by count;
server_id	master_server_id	count	a
2	1	1	1
select server_id, master_server_id, count, a from t1_max_delete_win$EX order by count;
server_id	master_server_id	count	a
delete from t1_max$EX;
delete from t1_max_delete_win$EX;
delete from t1_old$EX;
delete from t1_old;
delete from t1_max;
delete from t1_max_delete_win;
delete from t1_old;
delete from t1_max;
delete from t1_max_delete_win;
"Test 5"
Test that Updates affecting Blobs are rejected
correctly on the slave
drop table t1_max;
create table t1_max (a int primary key, b int, c longtext, d longtext, X int unsigned) engine = ndb;
insert into t1_max values (1, 1, repeat("B", 10000), repeat("E", 10001), 1);
insert into t1_max values (2, 2, repeat("A", 10002), repeat("T", 10003), 1);
update t1_max set X=20;
Initial values on Slave
select a,b,SHA1(c),length(c), SHA1(d), length(d), X from t1_max order by a;
a	b	SHA1(c)	length(c)	SHA1(d)	length(d)	X
1	1	4a222e18b539cdefbf0960eaa7f4362a4976e1e0	10000	9641d473ab1bd921263190eee074397084933e2d	10001	20
2	2	f833241322c062495632923d74314a6a5c23034d	10002	2dad269dfa115f6c7e53e91a73251e597aab8fe9	10003	20
Originate update which will be rejected
update t1_max set c=repeat("Z", 10006), d=repeat("I", 10005), X=2 where a=1;
Check slave has rejected due to lower version
select a,b,SHA1(c),length(c), SHA1(d), length(d), X from t1_max order by a;
a	b	SHA1(c)	length(c)	SHA1(d)	length(d)	X
1	1	4a222e18b539cdefbf0960eaa7f4362a4976e1e0	10000	9641d473ab1bd921263190eee074397084933e2d	10001	20
2	2	f833241322c062495632923d74314a6a5c23034d	10002	2dad269dfa115f6c7e53e91a73251e597aab8fe9	10003	20
Originate delete which will be rejected (due to NDB-OLD) algorith
delete from t1_max where a=1;
Check slave has rejected due to before image mismatch
select a,b,SHA1(c),length(c), SHA1(d), length(d), X from t1_max order by a;
a	b	SHA1(c)	length(c)	SHA1(d)	length(d)	X
1	1	4a222e18b539cdefbf0960eaa7f4362a4976e1e0	10000	9641d473ab1bd921263190eee074397084933e2d	10001	20
2	2	f833241322c062495632923d74314a6a5c23034d	10002	2dad269dfa115f6c7e53e91a73251e597aab8fe9	10003	20
Originate insert which will be rejected (as row exists)
insert into t1_max values (1, 1, repeat("R", 10004), repeat("A", 10007), 1);
Check slave has rejected due to row existing already
select a,b,SHA1(c),length(c), SHA1(d), length(d), X from t1_max order by a;
a	b	SHA1(c)	length(c)	SHA1(d)	length(d)	X
1	1	4a222e18b539cdefbf0960eaa7f4362a4976e1e0	10000	9641d473ab1bd921263190eee074397084933e2d	10001	20
2	2	f833241322c062495632923d74314a6a5c23034d	10002	2dad269dfa115f6c7e53e91a73251e597aab8fe9	10003	20
Expect t1_max to have 3 entries
select server_id, master_server_id, count, a from t1_old$EX order by count;
server_id	master_server_id	count	a
select server_id, master_server_id, count, a from t1_max$EX order by count;
server_id	master_server_id	count	a
2	1	1	1
2	1	2	1
2	1	3	1
select server_id, master_server_id, count, a from t1_max_delete_win$EX order by count;
server_id	master_server_id	count	a
delete from t1_max$EX;
delete from t1_max_delete_win$EX;
delete from t1_old$EX;
Test 6
Check that non-Blob related operations in a batch with a Blob
operation are still subject to conflict detection.

insert into mysql.ndb_replication values ("test", "t2_max", 0, 7, "NDB$MAX(X)");
create table `t2_max$EX`
  (server_id int unsigned,
master_server_id int unsigned,
master_epoch bigint unsigned,
count int unsigned,
a int not null,
primary key(server_id, master_server_id, master_epoch, count)) engine ndb;
create table t2_max (a int primary key, b int, X bigint unsigned) engine=ndb;
insert into t2_max values (1,1,10), (2,2,10), (3,3,10), (4,4,10), (5,5,10);
Now issue a transaction with a successful Blob op, and unsuccessful
non-Blob op.  Check that the Blob op succeeds, and the unsuccessful
non-Blob op is handled as expected.
begin;
update t2_max set b=b+1, X=1 where a=3;
update t1_max set c=repeat("R", 10008), d=repeat("A", 10009), X = 21 where a=1;
commit;
Contents on Slave
Expect Blob data applied to t1_max, no update applied to t2_max
select a,b,left(c,1), length(c), left(d,1), length(d), X from t1_max where a=1;
a	b	left(c,1)	length(c)	left(d,1)	length(d)	X
1	1	R	10008	A	10009	21
select * from t2_max order by a;
a	b	X
1	1	10
2	2	10
3	3	10
4	4	10
5	5	10
Expect No conflict in t1_max, 1 conflict in t2_max
select server_id, master_server_id, count, a from t1_max$EX order by count;
server_id	master_server_id	count	a
select server_id, master_server_id, count, a from t2_max$EX order by count;
server_id	master_server_id	count	a
2	1	1	3
drop table t2_max, t2_max$EX;
"Cleanup"
drop table mysql.ndb_replication;
drop table t1_old, `t1_old$EX`, t1_max, `t1_max$EX`, t1_max_delete_win, `t1_max_delete_win$EX`;
include/rpl_end.inc

Filemanager

Name Type Size Permission Actions
ndb_rpl_2innodb.result File 41.21 KB 0644
ndb_rpl_2myisam.result File 41.21 KB 0644
ndb_rpl_2ndb.result File 15.83 KB 0644
ndb_rpl_2other.result File 32.39 KB 0644
ndb_rpl_add_column.result File 5.55 KB 0644
ndb_rpl_apply_status.result File 529 B 0644
ndb_rpl_auto_inc.result File 3.18 KB 0644
ndb_rpl_bank.result File 10.82 KB 0644
ndb_rpl_basic.result File 13.07 KB 0644
ndb_rpl_binlog_format_errors.result File 920 B 0644
ndb_rpl_bitfield.result File 14.11 KB 0644
ndb_rpl_blob.result File 6.92 KB 0644
ndb_rpl_break_3_chain.result File 2.25 KB 0644
ndb_rpl_bug22045.result File 2.19 KB 0644
ndb_rpl_check_for_mixed.result File 105 B 0644
ndb_rpl_circular.result File 5.18 KB 0644
ndb_rpl_circular_2ch.result File 1.53 KB 0644
ndb_rpl_circular_2ch_rep_status.result File 4.69 KB 0644
ndb_rpl_circular_simplex.result File 559 B 0644
ndb_rpl_conflict.result File 9.76 KB 0644
ndb_rpl_conflict_epoch.result File 107.75 KB 0644
ndb_rpl_conflict_max.result File 49.57 KB 0644
ndb_rpl_conflict_max_delete_win.result File 49.51 KB 0644
ndb_rpl_conflict_old.result File 49.75 KB 0644
ndb_rpl_ctype_ucs2_def.result File 703 B 0644
ndb_rpl_dd_advance.result File 8.54 KB 0644
ndb_rpl_dd_basic.result File 2.04 KB 0644
ndb_rpl_dd_partitions.result File 35.55 KB 0644
ndb_rpl_do_db.result File 1.07 KB 0644
ndb_rpl_do_table.result File 784 B 0644
ndb_rpl_empty_epoch.result File 817 B 0644
ndb_rpl_gap_event.result File 785 B 0644
ndb_rpl_idempotent.result File 1.49 KB 0644
ndb_rpl_ignore_db.result File 732 B 0644
ndb_rpl_init_rep_status.result File 2.49 KB 0644
ndb_rpl_innodb2ndb.result File 40.87 KB 0644
ndb_rpl_innodb_trans.result File 2.71 KB 0644
ndb_rpl_load.result File 1.27 KB 0644
ndb_rpl_logging.result File 2.29 KB 0644
ndb_rpl_mix_eng_trans.result File 10.14 KB 0644
ndb_rpl_mix_innodb.result File 3.98 KB 0644
ndb_rpl_mixed_tables.result File 6.91 KB 0644
ndb_rpl_multi.result File 1.7 KB 0644
ndb_rpl_myisam2ndb.result File 40.86 KB 0644
ndb_rpl_ndbapi_multi.result File 201 B 0644
ndb_rpl_rep_error.result File 1.69 KB 0644
ndb_rpl_rep_ignore.result File 1.03 KB 0644
ndb_rpl_skip_gap_event.result File 666 B 0644
ndb_rpl_slave_lsu.result File 53.81 KB 0644
ndb_rpl_slave_lsu_anyval.result File 54.73 KB 0644
ndb_rpl_slave_restart.result File 1.76 KB 0644
ndb_rpl_stm_innodb.result File 4.01 KB 0644
ndb_rpl_sync.result File 1.99 KB 0644
ndb_rpl_ui.result File 709 B 0644
ndb_rpl_ui2.result File 435 B 0644
ndb_rpl_ui3.result File 874 B 0644
rpl_truncate_7ndb.result File 2.91 KB 0644
rpl_truncate_7ndb_2.result File 2.91 KB 0644