include/master-slave.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. [connection master] *** on slave there should be zero rows *** select count(*) from mysql.ndb_apply_status; count(*) 0 create table t1 (a int key, b int) engine ndb; insert into t1 values (1,1); *** on master it should be empty *** select * from mysql.ndb_apply_status where server_id <> 0; server_id epoch log_name start_pos end_pos # # Bug#14139386 DDL APPLY SET MYSQL.NDB_APPLY_STATUS EPOCH=0 # - check that ndb_apply_status.epoch is not set to 0 by DDL # select epoch from mysql.ndb_apply_status into @epoch_before_alter; alter table t1 add key k(b); select epoch=@epoch_before_alter from mysql.ndb_apply_status; epoch=@epoch_before_alter 1 # Check again with copying alter table [connection master] alter table t1 modify b varchar(255); select epoch=@epoch_before_alter from mysql.ndb_apply_status; epoch=@epoch_before_alter 1 # Check copying alter without any row in ndb_apply_status -> should insert # row for source server_id with epoch 0 [connection slave] stop replica; reset replica; select count(*) from mysql.ndb_apply_status; count(*) 0 [connection master] reset master; alter table t1 modify b varchar(255); [connection slave] start replica; [connection master] select server_id, epoch, log_name from mysql.ndb_apply_status; server_id epoch log_name 1 0 master-bin.000001 # End of test for Bug#14139386 *** on slave there should be one row *** select count(*) from mysql.ndb_apply_status; count(*) 1 drop table t1; *** Test reset slave clearing ndb_apply_status *** create table test.t1 (a int primary key) engine=ndb; insert into test.t1 values (1); Add a dummy entry insert into mysql.ndb_apply_status values (999, 9677, 'CaramelLog', 1977, 2015); select count(1) from mysql.ndb_apply_status; count(1) 2 *** Standard reset slave should clear ndb_apply_status *** stop slave; Warnings: Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead reset slave; Warnings: Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead select count(1) from mysql.ndb_apply_status; count(1) 0 reset master; include/rpl_start_slaves.inc *** Test reset slave all *** insert into test.t1 values (2); Add a dummy entry insert into mysql.ndb_apply_status values (999, 9677, 'CaramelLog', 1977, 2015); select count(1) from mysql.ndb_apply_status; count(1) 2 *** Reset slave all should clear ndb_apply_status *** stop slave; Warnings: Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead reset slave all; Warnings: Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead select count(1) from mysql.ndb_apply_status; count(1) 0 reset master; RESET SLAVE ALL zapped Master info - re-set it. include/rpl_change_topology.inc [new topology=1->2] Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. include/rpl_start_slaves.inc *** Test effect of ndb_clear_apply_status = 0 *** set global ndb_clear_apply_status=0; insert into test.t1 values (3); Add a dummy entry insert into mysql.ndb_apply_status values (999, 9677, 'CaramelLog', 1977, 2015); select count(1) from mysql.ndb_apply_status; count(1) 2 *** Standard reset slave should NOT clear ndb_apply_status *** stop slave; Warnings: Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead reset slave; Warnings: Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead select count(1) from mysql.ndb_apply_status; count(1) 2 delete from mysql.ndb_apply_status; reset master; include/rpl_start_slaves.inc *** Test reset slave all *** insert into test.t1 values (4); Add a dummy entry insert into mysql.ndb_apply_status values (999, 9677, 'CaramelLog', 1977, 2015); select count(1) from mysql.ndb_apply_status; count(1) 2 *** Reset slave all should NOT clear ndb_apply_status *** stop slave; Warnings: Warning 1287 'STOP SLAVE' is deprecated and will be removed in a future release. Please use STOP REPLICA instead reset slave all; Warnings: Warning 1287 'RESET SLAVE' is deprecated and will be removed in a future release. Please use RESET REPLICA instead select count(1) from mysql.ndb_apply_status; count(1) 2 reset master; RESET SLAVE ALL zapped Master info - re-set it. include/rpl_change_topology.inc [new topology=1->2] Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. include/rpl_start_slaves.inc set global ndb_clear_apply_status=1; drop table test.t1; include/rpl_end.inc Warnings: Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information.