Loading mysql-test/include/ndb_setup_slave.inc +3 −3 Original line number Diff line number Diff line # # now setup replication to continue from last epoch # 1. get apply_status epoch from slave # 1. get ndb_apply_status epoch from slave # 2. get corresponding _next_ binlog postition from master # 3. change master on slave # 1. --connection slave --replace_column 1 <the_epoch> SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status; --let $the_epoch= `select @the_epoch` # 2. Loading @@ -15,7 +15,7 @@ SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status; --replace_result $the_epoch <the_epoch> --replace_column 1 <the_pos> eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) FROM mysql.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; FROM mysql.ndb_binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; --let $the_pos= `SELECT @the_pos` --let $the_file= `SELECT @the_file` Loading mysql-test/lib/init_db.sql +1 −1 Original line number Diff line number Diff line Loading @@ -634,4 +634,4 @@ CREATE TABLE event ( PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS mysql.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; CREATE TABLE IF NOT EXISTS mysql.ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; mysql-test/mysql-test-run.pl +4 −4 Original line number Diff line number Diff line Loading @@ -2456,8 +2456,8 @@ sub ndbcluster_start ($$) { sub rm_ndbcluster_tables ($) { my $dir= shift; foreach my $bin ( glob("$dir/mysql/apply_status*"), glob("$dir/mysql/schema*")) foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"), glob("$dir/mysql/ndb_schema*")) { unlink($bin); } Loading Loading @@ -4127,12 +4127,12 @@ sub run_testcase_start_servers($) { # tables ok FIXME This is a workaround so that only one mysqld # create the tables if ( ! sleep_until_file_created( "$master->[0]->{'path_myddir'}/mysql/apply_status.ndb", "$master->[0]->{'path_myddir'}/mysql/ndb_apply_status.ndb", $master->[0]->{'start_timeout'}, $master->[0]->{'pid'})) { $tinfo->{'comment'}= "Failed to create 'mysql/apply_status' table"; $tinfo->{'comment'}= "Failed to create 'mysql/ndb_apply_status' table"; return 1; } } Loading mysql-test/r/1st.result +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ mysql test show tables in mysql; Tables_in_mysql binlog_index columns_priv db event Loading @@ -16,6 +15,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading mysql-test/r/connect.result +3 −3 Original line number Diff line number Diff line drop table if exists t1,t2; show tables; Tables_in_mysql binlog_index columns_priv db event Loading @@ -12,6 +11,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading @@ -33,7 +33,6 @@ grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; show tables; Tables_in_mysql binlog_index columns_priv db event Loading @@ -44,6 +43,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading Loading @@ -73,7 +73,6 @@ ERROR HY000: Password hash should be a 41-digit hexadecimal number set password=old_password('gambling3'); show tables; Tables_in_mysql binlog_index columns_priv db event Loading @@ -84,6 +83,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading Loading
mysql-test/include/ndb_setup_slave.inc +3 −3 Original line number Diff line number Diff line # # now setup replication to continue from last epoch # 1. get apply_status epoch from slave # 1. get ndb_apply_status epoch from slave # 2. get corresponding _next_ binlog postition from master # 3. change master on slave # 1. --connection slave --replace_column 1 <the_epoch> SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status; SELECT @the_epoch:=MAX(epoch) FROM mysql.ndb_apply_status; --let $the_epoch= `select @the_epoch` # 2. Loading @@ -15,7 +15,7 @@ SELECT @the_epoch:=MAX(epoch) FROM mysql.apply_status; --replace_result $the_epoch <the_epoch> --replace_column 1 <the_pos> eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) FROM mysql.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; FROM mysql.ndb_binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; --let $the_pos= `SELECT @the_pos` --let $the_file= `SELECT @the_file` Loading
mysql-test/lib/init_db.sql +1 −1 Original line number Diff line number Diff line Loading @@ -634,4 +634,4 @@ CREATE TABLE event ( PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; CREATE TABLE IF NOT EXISTS mysql.binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM; CREATE TABLE IF NOT EXISTS mysql.ndb_binlog_index (Position BIGINT UNSIGNED NOT NULL, File VARCHAR(255) NOT NULL, epoch BIGINT UNSIGNED NOT NULL, inserts BIGINT UNSIGNED NOT NULL, updates BIGINT UNSIGNED NOT NULL, deletes BIGINT UNSIGNED NOT NULL, schemaops BIGINT UNSIGNED NOT NULL, PRIMARY KEY(epoch)) ENGINE=MYISAM;
mysql-test/mysql-test-run.pl +4 −4 Original line number Diff line number Diff line Loading @@ -2456,8 +2456,8 @@ sub ndbcluster_start ($$) { sub rm_ndbcluster_tables ($) { my $dir= shift; foreach my $bin ( glob("$dir/mysql/apply_status*"), glob("$dir/mysql/schema*")) foreach my $bin ( glob("$dir/mysql/ndb_apply_status*"), glob("$dir/mysql/ndb_schema*")) { unlink($bin); } Loading Loading @@ -4127,12 +4127,12 @@ sub run_testcase_start_servers($) { # tables ok FIXME This is a workaround so that only one mysqld # create the tables if ( ! sleep_until_file_created( "$master->[0]->{'path_myddir'}/mysql/apply_status.ndb", "$master->[0]->{'path_myddir'}/mysql/ndb_apply_status.ndb", $master->[0]->{'start_timeout'}, $master->[0]->{'pid'})) { $tinfo->{'comment'}= "Failed to create 'mysql/apply_status' table"; $tinfo->{'comment'}= "Failed to create 'mysql/ndb_apply_status' table"; return 1; } } Loading
mysql-test/r/1st.result +1 −1 Original line number Diff line number Diff line Loading @@ -5,7 +5,6 @@ mysql test show tables in mysql; Tables_in_mysql binlog_index columns_priv db event Loading @@ -16,6 +15,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading
mysql-test/r/connect.result +3 −3 Original line number Diff line number Diff line drop table if exists t1,t2; show tables; Tables_in_mysql binlog_index columns_priv db event Loading @@ -12,6 +11,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading @@ -33,7 +33,6 @@ grant ALL on *.* to test@localhost identified by "gambling"; grant ALL on *.* to test@127.0.0.1 identified by "gambling"; show tables; Tables_in_mysql binlog_index columns_priv db event Loading @@ -44,6 +43,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading Loading @@ -73,7 +73,6 @@ ERROR HY000: Password hash should be a 41-digit hexadecimal number set password=old_password('gambling3'); show tables; Tables_in_mysql binlog_index columns_priv db event Loading @@ -84,6 +83,7 @@ help_keyword help_relation help_topic host ndb_binlog_index plugin proc procs_priv Loading