Bug #17805 Cluster_replication database should be renamed to just cluster

parent 70718ac2
...@@ -634,5 +634,5 @@ CREATE TABLE event ( ...@@ -634,5 +634,5 @@ CREATE TABLE event (
PRIMARY KEY (definer, db, name) PRIMARY KEY (definer, db, name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events';
CREATE DATABASE IF NOT EXISTS cluster_replication; CREATE DATABASE IF NOT EXISTS cluster;
CREATE TABLE IF NOT EXISTS cluster_replication.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 cluster.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;
...@@ -1508,8 +1508,8 @@ sub ndbcluster_start ($) { ...@@ -1508,8 +1508,8 @@ sub ndbcluster_start ($) {
sub rm_ndbcluster_tables ($) { sub rm_ndbcluster_tables ($) {
my $dir= shift; my $dir= shift;
foreach my $bin ( glob("$dir/cluster_replication/apply_status*"), foreach my $bin ( glob("$dir/cluster/apply_status*"),
glob("$dir/cluster_replication/schema*") ) glob("$dir/cluster/schema*") )
{ {
unlink($bin); unlink($bin);
} }
......
...@@ -1326,8 +1326,8 @@ start_ndbcluster() ...@@ -1326,8 +1326,8 @@ start_ndbcluster()
rm_ndbcluster_tables() rm_ndbcluster_tables()
{ {
$RM -f $1/cluster_replication/apply_status* $RM -f $1/cluster/apply_status*
$RM -f $1/cluster_replication/schema* $RM -f $1/cluster/schema*
} }
stop_ndbcluster() stop_ndbcluster()
......
...@@ -47,7 +47,7 @@ create database mysqltest; ...@@ -47,7 +47,7 @@ create database mysqltest;
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest mysqltest
test test
...@@ -59,7 +59,7 @@ drop database mysqltest; ...@@ -59,7 +59,7 @@ drop database mysqltest;
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
drop database mysqltest; drop database mysqltest;
......
...@@ -14,7 +14,7 @@ NULL test latin1 latin1_swedish_ci NULL ...@@ -14,7 +14,7 @@ NULL test latin1 latin1_swedish_ci NULL
select schema_name from information_schema.schemata; select schema_name from information_schema.schemata;
schema_name schema_name
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
show databases like 't%'; show databases like 't%';
...@@ -23,7 +23,7 @@ test ...@@ -23,7 +23,7 @@ test
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
show databases where `database` = 't%'; show databases where `database` = 't%';
...@@ -339,7 +339,7 @@ create view v0 (c) as select schema_name from information_schema.schemata; ...@@ -339,7 +339,7 @@ create view v0 (c) as select schema_name from information_schema.schemata;
select * from v0; select * from v0;
c c
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
explain select * from v0; explain select * from v0;
...@@ -835,7 +835,7 @@ delete from mysql.db where user='mysqltest_4'; ...@@ -835,7 +835,7 @@ delete from mysql.db where user='mysqltest_4';
flush privileges; flush privileges;
SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA; SELECT table_schema, count(*) FROM information_schema.TABLES GROUP BY TABLE_SCHEMA;
table_schema count(*) table_schema count(*)
cluster_replication 1 cluster 1
information_schema 22 information_schema 22
mysql 21 mysql 21
create table t1 (i int, j int); create table t1 (i int, j int);
......
DROP SCHEMA test; DROP SCHEMA test;
CREATE SCHEMA test; CREATE SCHEMA test;
cluster_replication.binlog_index OK cluster.binlog_index OK
mysql.columns_priv OK mysql.columns_priv OK
mysql.db OK mysql.db OK
mysql.event OK mysql.event OK
......
...@@ -6,7 +6,7 @@ drop database mysqltest; ...@@ -6,7 +6,7 @@ drop database mysqltest;
use test; use test;
create table t1 (a int primary key) engine=ndb; create table t1 (a int primary key) engine=ndb;
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
select @max_epoch:=max(epoch)-1 from cluster_replication.binlog_index; select @max_epoch:=max(epoch)-1 from cluster.binlog_index;
@max_epoch:=max(epoch)-1 @max_epoch:=max(epoch)-1
# #
delete from t1; delete from t1;
...@@ -19,25 +19,25 @@ update t2 set b=1 where a=3; ...@@ -19,25 +19,25 @@ update t2 set b=1 where a=3;
delete from t2 where a=4; delete from t2 where a=4;
commit; commit;
drop table t2; drop table t2;
select inserts from cluster_replication.binlog_index where epoch > @max_epoch and inserts > 5; select inserts from cluster.binlog_index where epoch > @max_epoch and inserts > 5;
inserts inserts
10 10
select deletes from cluster_replication.binlog_index where epoch > @max_epoch and deletes > 5; select deletes from cluster.binlog_index where epoch > @max_epoch and deletes > 5;
deletes deletes
10 10
select inserts,updates,deletes from select inserts,updates,deletes from
cluster_replication.binlog_index where epoch > @max_epoch and updates > 0; cluster.binlog_index where epoch > @max_epoch and updates > 0;
inserts updates deletes inserts updates deletes
2 1 1 2 1 1
select schemaops from select schemaops from
cluster_replication.binlog_index where epoch > @max_epoch and schemaops > 0; cluster.binlog_index where epoch > @max_epoch and schemaops > 0;
schemaops schemaops
1 1
1 1
1 1
flush logs; flush logs;
purge master logs before now(); purge master logs before now();
select count(*) from cluster_replication.binlog_index; select count(*) from cluster.binlog_index;
count(*) count(*)
0 0
create table t1 (a int primary key, b int) engine=ndb; create table t1 (a int primary key, b int) engine=ndb;
...@@ -46,17 +46,17 @@ use mysqltest; ...@@ -46,17 +46,17 @@ use mysqltest;
create table t1 (c int, d int primary key) engine=ndb; create table t1 (c int, d int primary key) engine=ndb;
use test; use test;
insert into mysqltest.t1 values (2,1),(2,2); insert into mysqltest.t1 values (2,1),(2,2);
select @max_epoch:=max(epoch)-1 from cluster_replication.binlog_index; select @max_epoch:=max(epoch)-1 from cluster.binlog_index;
@max_epoch:=max(epoch)-1 @max_epoch:=max(epoch)-1
# #
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
select inserts,updates,deletes from select inserts,updates,deletes from
cluster_replication.binlog_index where epoch > @max_epoch and inserts > 0; cluster.binlog_index where epoch > @max_epoch and inserts > 0;
inserts updates deletes inserts updates deletes
2 0 0 2 0 0
select schemaops from select schemaops from
cluster_replication.binlog_index where epoch > @max_epoch and schemaops > 0; cluster.binlog_index where epoch > @max_epoch and schemaops > 0;
schemaops schemaops
1 1
1 1
...@@ -24,7 +24,7 @@ alter table t2 add column (b int); ...@@ -24,7 +24,7 @@ alter table t2 add column (b int);
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # # master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; alter table t2 add column (b int) master-bin1.000001 # Query # # use `test`; alter table t2 add column (b int)
...@@ -36,7 +36,7 @@ show binlog events from <binlog_start>; ...@@ -36,7 +36,7 @@ show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1 master-bin.000001 # Query # # ALTER DATABASE mysqltest CHARACTER SET latin1
master-bin.000001 # Query # # BEGIN master-bin.000001 # Query # # BEGIN
master-bin.000001 # Table_map # # cluster_replication.apply_status master-bin.000001 # Table_map # # cluster.apply_status
master-bin.000001 # Write_rows # # master-bin.000001 # Write_rows # #
master-bin.000001 # Query # # COMMIT master-bin.000001 # Query # # COMMIT
master-bin.000001 # Query # # use `mysqltest`; drop table `t1` master-bin.000001 # Query # # use `mysqltest`; drop table `t1`
...@@ -49,7 +49,7 @@ create table t1 (a int primary key) engine=ndb; ...@@ -49,7 +49,7 @@ create table t1 (a int primary key) engine=ndb;
show binlog events from <binlog_start>; show binlog events from <binlog_start>;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # # master-bin1.000001 # Write_rows # #
master-bin1.000001 # Table_map # # test.t2 master-bin1.000001 # Table_map # # test.t2
master-bin1.000001 # Write_rows # # master-bin1.000001 # Write_rows # #
...@@ -119,7 +119,7 @@ ENGINE = NDB ...@@ -119,7 +119,7 @@ ENGINE = NDB
master-bin1.000001 # Query # # DROP LOGFILE GROUP lg1 master-bin1.000001 # Query # # DROP LOGFILE GROUP lg1
ENGINE =NDB ENGINE =NDB
master-bin1.000001 # Query # # BEGIN master-bin1.000001 # Query # # BEGIN
master-bin1.000001 # Table_map # # cluster_replication.apply_status master-bin1.000001 # Table_map # # cluster.apply_status
master-bin1.000001 # Write_rows # # master-bin1.000001 # Write_rows # #
master-bin1.000001 # Query # # COMMIT master-bin1.000001 # Query # # COMMIT
master-bin1.000001 # Query # # use `test`; drop table `t1` master-bin1.000001 # Query # # use `test`; drop table `t1`
...@@ -12,7 +12,7 @@ a b ...@@ -12,7 +12,7 @@ a b
1 1 1 1
2 2 2 2
SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index ORDER BY epoch DESC LIMIT 1; cluster.binlog_index ORDER BY epoch DESC LIMIT 1;
@the_epoch:=epoch inserts updates deletes schemaops @the_epoch:=epoch inserts updates deletes schemaops
<the_epoch> 2 0 0 0 <the_epoch> 2 0 0 0
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
...@@ -20,24 +20,24 @@ a b ...@@ -20,24 +20,24 @@ a b
1 1 1 1
2 2 2 2
SELECT inserts,updates,deletes,schemaops FROM SELECT inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index WHERE epoch=<the_epoch>; cluster.binlog_index WHERE epoch=<the_epoch>;
inserts updates deletes schemaops inserts updates deletes schemaops
2 0 0 0 2 0 0 0
DROP TABLE t2; DROP TABLE t2;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB; CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE = NDB;
INSERT INTO t1 VALUES (1),(2); INSERT INTO t1 VALUES (1),(2);
SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index ORDER BY epoch DESC LIMIT 1; cluster.binlog_index ORDER BY epoch DESC LIMIT 1;
@the_epoch2:=epoch inserts updates deletes schemaops @the_epoch2:=epoch inserts updates deletes schemaops
<the_epoch2> 2 0 0 0 <the_epoch2> 2 0 0 0
SELECT inserts,updates,deletes,schemaops FROM SELECT inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index WHERE epoch > <the_epoch> AND epoch < <the_epoch2>; cluster.binlog_index WHERE epoch > <the_epoch> AND epoch < <the_epoch2>;
inserts updates deletes schemaops inserts updates deletes schemaops
0 0 0 1 0 0 0 1
drop table t1; drop table t1;
SHOW TABLES; SHOW TABLES;
Tables_in_test Tables_in_test
SELECT inserts,updates,deletes,schemaops FROM SELECT inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index WHERE epoch > <the_epoch> AND epoch < <the_epoch2>; cluster.binlog_index WHERE epoch > <the_epoch> AND epoch < <the_epoch2>;
inserts updates deletes schemaops inserts updates deletes schemaops
0 0 0 1 0 0 0 1
...@@ -259,7 +259,7 @@ prepare stmt4 from ' show databases '; ...@@ -259,7 +259,7 @@ prepare stmt4 from ' show databases ';
execute stmt4; execute stmt4;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
prepare stmt4 from ' show tables from test like ''t2%'' '; prepare stmt4 from ' show tables from test like ''t2%'' ';
......
...@@ -23,7 +23,7 @@ ALTER DATABASE mysqltest_bob CHARACTER SET latin1; ...@@ -23,7 +23,7 @@ ALTER DATABASE mysqltest_bob CHARACTER SET latin1;
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
...@@ -32,7 +32,7 @@ test ...@@ -32,7 +32,7 @@ test
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
...@@ -47,7 +47,7 @@ CREATE TABLE t2 (a INT); ...@@ -47,7 +47,7 @@ CREATE TABLE t2 (a INT);
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest_bob mysqltest_bob
mysqltest_prometheus mysqltest_prometheus
...@@ -56,7 +56,7 @@ test ...@@ -56,7 +56,7 @@ test
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest_prometheus mysqltest_prometheus
mysqltest_sisyfos mysqltest_sisyfos
......
...@@ -33,7 +33,7 @@ create database mysqltest; ...@@ -33,7 +33,7 @@ create database mysqltest;
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest mysqltest
mysqltest2 mysqltest2
...@@ -51,7 +51,7 @@ set sql_log_bin = 1; ...@@ -51,7 +51,7 @@ set sql_log_bin = 1;
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
create database mysqltest2; create database mysqltest2;
...@@ -71,7 +71,7 @@ load data from master; ...@@ -71,7 +71,7 @@ load data from master;
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest mysqltest
mysqltest2 mysqltest2
......
...@@ -21,7 +21,7 @@ COUNT(*) ...@@ -21,7 +21,7 @@ COUNT(*)
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
mysqltest mysqltest
test test
......
...@@ -47,17 +47,17 @@ CREATE DATABASE IF NOT EXISTS BANK; ...@@ -47,17 +47,17 @@ CREATE DATABASE IF NOT EXISTS BANK;
DROP DATABASE BANK; DROP DATABASE BANK;
CREATE DATABASE BANK; CREATE DATABASE BANK;
RESET MASTER; RESET MASTER;
CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM cluster_replication.backup_info; DELETE FROM cluster.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1; FROM cluster.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos> master-bin.000001 <the_pos> master-bin.000001
CHANGE MASTER TO CHANGE MASTER TO
......
...@@ -86,41 +86,41 @@ a int not null primary key, ...@@ -86,41 +86,41 @@ a int not null primary key,
b text not null b text not null
) engine=ndb ) engine=ndb
master-bin.000001 239 Query 1 303 BEGIN master-bin.000001 239 Query 1 303 BEGIN
master-bin.000001 303 Table_map 1 65 cluster_replication.apply_status master-bin.000001 303 Table_map 1 53 cluster.apply_status
master-bin.000001 368 Write_rows 1 107 master-bin.000001 356 Write_rows 1 95
master-bin.000001 410 Table_map 1 147 test.t1 master-bin.000001 398 Table_map 1 135 test.t1
master-bin.000001 450 Write_rows 1 818 master-bin.000001 438 Write_rows 1 806
master-bin.000001 1121 Write_rows 1 9853 master-bin.000001 1109 Write_rows 1 9841
master-bin.000001 10156 Query 1 10221 COMMIT master-bin.000001 10144 Query 1 10209 COMMIT
master-bin.000001 10221 Query 1 10285 BEGIN master-bin.000001 10209 Query 1 10273 BEGIN
master-bin.000001 10285 Table_map 1 65 cluster_replication.apply_status master-bin.000001 10273 Table_map 1 53 cluster.apply_status
master-bin.000001 10350 Write_rows 1 107 master-bin.000001 10326 Write_rows 1 95
master-bin.000001 10392 Query 1 10457 COMMIT master-bin.000001 10368 Query 1 10433 COMMIT
master-bin.000001 10457 Query 1 10533 use `test`; drop table t1 master-bin.000001 10433 Query 1 10509 use `test`; drop table t1
master-bin.000001 10533 Query 1 10708 use `test`; create table t1 ( master-bin.000001 10509 Query 1 10684 use `test`; create table t1 (
a int not null primary key, a int not null primary key,
b text not null, b text not null,
c int, c int,
d longblob, d longblob,
e tinyblob e tinyblob
) engine=ndbcluster ) engine=ndbcluster
master-bin.000001 10708 Query 1 10772 BEGIN master-bin.000001 10684 Query 1 10748 BEGIN
master-bin.000001 10772 Table_map 1 65 cluster_replication.apply_status master-bin.000001 10748 Table_map 1 53 cluster.apply_status
master-bin.000001 10837 Write_rows 1 107 master-bin.000001 10801 Write_rows 1 95
master-bin.000001 10879 Table_map 1 150 test.t1 master-bin.000001 10843 Table_map 1 138 test.t1
master-bin.000001 10922 Write_rows 1 48934 master-bin.000001 10886 Write_rows 1 48922
master-bin.000001 59706 Write_rows 1 124436 master-bin.000001 59670 Write_rows 1 124424
master-bin.000001 135208 Write_rows 1 124542 master-bin.000001 135172 Write_rows 1 124530
master-bin.000001 135314 Write_rows 1 205961 master-bin.000001 135278 Write_rows 1 205949
master-bin.000001 216733 Write_rows 1 224245 master-bin.000001 216697 Write_rows 1 224233
master-bin.000001 235017 Write_rows 1 227523 master-bin.000001 234981 Write_rows 1 227511
master-bin.000001 238295 Write_rows 1 242391 master-bin.000001 238259 Write_rows 1 242379
master-bin.000001 253163 Write_rows 1 254087 master-bin.000001 253127 Write_rows 1 254075
master-bin.000001 264859 Write_rows 1 304335 master-bin.000001 264823 Write_rows 1 304323
master-bin.000001 315107 Write_rows 1 330427 master-bin.000001 315071 Write_rows 1 330415
master-bin.000001 341199 Query 1 341264 COMMIT master-bin.000001 341163 Query 1 341228 COMMIT
master-bin.000001 341264 Query 1 341328 BEGIN master-bin.000001 341228 Query 1 341292 BEGIN
master-bin.000001 341328 Table_map 1 65 cluster_replication.apply_status master-bin.000001 341292 Table_map 1 53 cluster.apply_status
master-bin.000001 341393 Write_rows 1 107 master-bin.000001 341345 Write_rows 1 95
master-bin.000001 341435 Query 1 341500 COMMIT master-bin.000001 341387 Query 1 341452 COMMIT
master-bin.000001 341500 Query 1 341576 use `test`; drop table t1 master-bin.000001 341452 Query 1 341528 use `test`; drop table t1
...@@ -57,11 +57,11 @@ master-bin.000001 798 Query 1 978 use `test`; CREATE TABLE t1 ...@@ -57,11 +57,11 @@ master-bin.000001 798 Query 1 978 use `test`; CREATE TABLE t1
tablespace ts1 storage disk tablespace ts1 storage disk
engine ndb engine ndb
master-bin.000001 978 Query 1 1042 BEGIN master-bin.000001 978 Query 1 1042 BEGIN
master-bin.000001 1042 Table_map 1 65 cluster_replication.apply_status master-bin.000001 1042 Table_map 1 53 cluster.apply_status
master-bin.000001 1107 Write_rows 1 107 master-bin.000001 1095 Write_rows 1 95
master-bin.000001 1149 Table_map 1 148 test.t1 master-bin.000001 1137 Table_map 1 136 test.t1
master-bin.000001 1190 Write_rows 1 190 master-bin.000001 1178 Write_rows 1 178
master-bin.000001 1232 Query 1 1297 COMMIT master-bin.000001 1220 Query 1 1285 COMMIT
drop table t1; drop table t1;
alter tablespace ts1 alter tablespace ts1
drop datafile 'datafile.dat' drop datafile 'datafile.dat'
......
...@@ -9,14 +9,14 @@ INSERT INTO t1 VALUES ("row1","will go away",1); ...@@ -9,14 +9,14 @@ INSERT INTO t1 VALUES ("row1","will go away",1);
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
row1 will go away 1 row1 will go away 1
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
row1 will go away 1 row1 will go away 1
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch = <the_epoch> ; FROM cluster.binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos> master-bin.000001 <the_pos> master-bin.000001
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4); INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
......
...@@ -21,7 +21,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -21,7 +21,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # cluster_replication.apply_status master-bin.000001 # Table_map 1 # cluster.apply_status
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Table_map 1 # test.t1
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
...@@ -29,7 +29,7 @@ master-bin.000001 # Query 1 # COMMIT ...@@ -29,7 +29,7 @@ master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # cluster_replication.apply_status master-bin.000001 # Table_map 1 # cluster.apply_status
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Table_map 1 # test.t1
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
...@@ -43,7 +43,7 @@ master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_in ...@@ -43,7 +43,7 @@ master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_in
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
show binlog events from 102 limit 2,1; show binlog events from 102 limit 2,1;
Log_name Pos Event_type Server_id End_log_pos Info Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Table_map 1 # cluster_replication.apply_status master-bin.000001 # Table_map 1 # cluster.apply_status
flush logs; flush logs;
create table t3 (a int)ENGINE=NDB; create table t3 (a int)ENGINE=NDB;
start slave; start slave;
...@@ -56,7 +56,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -56,7 +56,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 master-bin.000001 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB master-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # cluster_replication.apply_status master-bin.000001 # Table_map 1 # cluster.apply_status
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Table_map 1 # test.t1
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
...@@ -64,7 +64,7 @@ master-bin.000001 # Query 1 # COMMIT ...@@ -64,7 +64,7 @@ master-bin.000001 # Query 1 # COMMIT
master-bin.000001 # Query 1 # use `test`; drop table t1 master-bin.000001 # Query 1 # use `test`; drop table t1
master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB master-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
master-bin.000001 # Query 1 # BEGIN master-bin.000001 # Query 1 # BEGIN
master-bin.000001 # Table_map 1 # cluster_replication.apply_status master-bin.000001 # Table_map 1 # cluster.apply_status
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
master-bin.000001 # Table_map 1 # test.t1 master-bin.000001 # Table_map 1 # test.t1
master-bin.000001 # Write_rows 1 # master-bin.000001 # Write_rows 1 #
...@@ -76,7 +76,7 @@ master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4 ...@@ -76,7 +76,7 @@ master-bin.000002 # Format_desc 1 # Server ver: VERSION, Binlog ver: 4
master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB master-bin.000002 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB master-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
master-bin.000002 # Query 1 # BEGIN master-bin.000002 # Query 1 # BEGIN
master-bin.000002 # Table_map 1 # cluster_replication.apply_status master-bin.000002 # Table_map 1 # cluster.apply_status
master-bin.000002 # Write_rows 1 # master-bin.000002 # Write_rows 1 #
master-bin.000002 # Table_map 1 # test.t2 master-bin.000002 # Table_map 1 # test.t2
master-bin.000002 # Write_rows 1 # master-bin.000002 # Write_rows 1 #
...@@ -95,7 +95,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -95,7 +95,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000001 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB slave-bin.000001 # Query 1 # use `test`; create table t1(n int not null auto_increment primary key)ENGINE=NDB
slave-bin.000001 # Query 2 # BEGIN slave-bin.000001 # Query 2 # BEGIN
slave-bin.000001 # Table_map 2 # cluster_replication.apply_status slave-bin.000001 # Table_map 2 # cluster.apply_status
slave-bin.000001 # Write_rows 2 # slave-bin.000001 # Write_rows 2 #
slave-bin.000001 # Table_map 2 # test.t1 slave-bin.000001 # Table_map 2 # test.t1
slave-bin.000001 # Write_rows 2 # slave-bin.000001 # Write_rows 2 #
...@@ -104,7 +104,7 @@ slave-bin.000001 # Query 1 # use `test`; drop table t1 ...@@ -104,7 +104,7 @@ slave-bin.000001 # Query 1 # use `test`; drop table t1
slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB slave-bin.000001 # Query 1 # use `test`; create table t1 (word char(20) not null)ENGINE=NDB
slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB slave-bin.000001 # Query 1 # use `test`; create table t3 (a int)ENGINE=NDB
slave-bin.000001 # Query 2 # BEGIN slave-bin.000001 # Query 2 # BEGIN
slave-bin.000001 # Table_map 2 # cluster_replication.apply_status slave-bin.000001 # Table_map 2 # cluster.apply_status
slave-bin.000001 # Write_rows 2 # slave-bin.000001 # Write_rows 2 #
slave-bin.000001 # Table_map 2 # test.t1 slave-bin.000001 # Table_map 2 # test.t1
slave-bin.000001 # Write_rows 2 # slave-bin.000001 # Write_rows 2 #
...@@ -115,7 +115,7 @@ Log_name Pos Event_type Server_id End_log_pos Info ...@@ -115,7 +115,7 @@ Log_name Pos Event_type Server_id End_log_pos Info
slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4 slave-bin.000002 # Format_desc 2 # Server ver: VERSION, Binlog ver: 4
slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB slave-bin.000002 # Query 1 # use `test`; create table t2 (n int)ENGINE=NDB
slave-bin.000002 # Query 2 # BEGIN slave-bin.000002 # Query 2 # BEGIN
slave-bin.000002 # Table_map 2 # cluster_replication.apply_status slave-bin.000002 # Table_map 2 # cluster.apply_status
slave-bin.000002 # Write_rows 2 # slave-bin.000002 # Write_rows 2 #
slave-bin.000002 # Table_map 2 # test.t2 slave-bin.000002 # Table_map 2 # test.t2
slave-bin.000002 # Write_rows 2 # slave-bin.000002 # Write_rows 2 #
......
...@@ -16,7 +16,7 @@ row1 will go away 1 ...@@ -16,7 +16,7 @@ row1 will go away 1
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
c1 c2 c3 c1 c2 c3
row1 will go away 1 row1 will go away 1
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
...@@ -24,7 +24,7 @@ c1 c2 c3 ...@@ -24,7 +24,7 @@ c1 c2 c3
row1 will go away 1 row1 will go away 1
stop slave; stop slave;
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch = <the_epoch> ; FROM cluster.binlog_index WHERE epoch = <the_epoch> ;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
102 master-bin1.000001 102 master-bin1.000001
CHANGE MASTER TO CHANGE MASTER TO
......
...@@ -25,13 +25,13 @@ hex(c2) hex(c3) c1 ...@@ -25,13 +25,13 @@ hex(c2) hex(c3) c1
0 1 BCDEF 0 1 BCDEF
1 0 CD 1 0 CD
0 0 DEFGHIJKL 0 0 DEFGHIJKL
CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster_replication.backup_info; DELETE FROM cluster.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ',';
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster.backup_info;
@the_backup_id:=backup_id @the_backup_id:=backup_id
<the_backup_id> <the_backup_id>
DROP TABLE cluster_replication.backup_info; DROP TABLE cluster.backup_info;
UPDATE t1 SET c2=0 WHERE c3="row2"; UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
hex(c1) hex(c2) c3 hex(c1) hex(c2) c3
...@@ -60,11 +60,11 @@ hex(c2) hex(c3) c1 ...@@ -60,11 +60,11 @@ hex(c2) hex(c3) c1
0 1 BCDEF 0 1 BCDEF
1 0 CD 1 0 CD
0 0 DEFGHIJKL 0 0 DEFGHIJKL
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
@the_epoch:=MAX(epoch) @the_epoch:=MAX(epoch)
<the_epoch> <the_epoch>
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1; FROM cluster.binlog_index WHERE epoch > <the_epoch> ORDER BY epoch ASC LIMIT 1;
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1) @the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
<the_pos> master-bin.000001 <the_pos> master-bin.000001
CHANGE MASTER TO CHANGE MASTER TO
...@@ -89,8 +89,8 @@ hex(c2) hex(c3) c1 ...@@ -89,8 +89,8 @@ hex(c2) hex(c3) c1
DROP DATABASE ndbsynctest; DROP DATABASE ndbsynctest;
STOP SLAVE; STOP SLAVE;
reset master; reset master;
select * from cluster_replication.binlog_index; select * from cluster.binlog_index;
Position File epoch inserts updates deletes schemaops Position File epoch inserts updates deletes schemaops
reset slave; reset slave;
select * from cluster_replication.apply_status; select * from cluster.apply_status;
server_id epoch server_id epoch
...@@ -9,7 +9,7 @@ CREATE DATABASE test_ignore; ...@@ -9,7 +9,7 @@ CREATE DATABASE test_ignore;
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
test_ignore test_ignore
...@@ -29,7 +29,7 @@ INSERT INTO t2 VALUES (3,3), (4,4); ...@@ -29,7 +29,7 @@ INSERT INTO t2 VALUES (3,3), (4,4);
SHOW DATABASES; SHOW DATABASES;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
USE test; USE test;
......
...@@ -6,7 +6,7 @@ foo CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET latin1 */ ...@@ -6,7 +6,7 @@ foo CREATE DATABASE `foo` /*!40100 DEFAULT CHARACTER SET latin1 */
show schemas; show schemas;
Database Database
information_schema information_schema
cluster_replication cluster
foo foo
mysql mysql
test test
......
...@@ -53,7 +53,7 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I ...@@ -53,7 +53,7 @@ Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length I
show databases; show databases;
Database Database
information_schema information_schema
cluster_replication cluster
mysql mysql
test test
show databases like "test%"; show databases like "test%";
......
...@@ -19,7 +19,7 @@ create table t1 (a int primary key) engine=ndb; ...@@ -19,7 +19,7 @@ create table t1 (a int primary key) engine=ndb;
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
save_master_pos; save_master_pos;
--replace_column 1 # --replace_column 1 #
select @max_epoch:=max(epoch)-1 from cluster_replication.binlog_index; select @max_epoch:=max(epoch)-1 from cluster.binlog_index;
delete from t1; delete from t1;
alter table t1 add (b int); alter table t1 add (b int);
...@@ -38,12 +38,12 @@ drop table t2; ...@@ -38,12 +38,12 @@ drop table t2;
# (save_master_pos waits for last gcp to complete, ensuring that we have # (save_master_pos waits for last gcp to complete, ensuring that we have
# the expected data in the binlog) # the expected data in the binlog)
save_master_pos; save_master_pos;
select inserts from cluster_replication.binlog_index where epoch > @max_epoch and inserts > 5; select inserts from cluster.binlog_index where epoch > @max_epoch and inserts > 5;
select deletes from cluster_replication.binlog_index where epoch > @max_epoch and deletes > 5; select deletes from cluster.binlog_index where epoch > @max_epoch and deletes > 5;
select inserts,updates,deletes from select inserts,updates,deletes from
cluster_replication.binlog_index where epoch > @max_epoch and updates > 0; cluster.binlog_index where epoch > @max_epoch and updates > 0;
select schemaops from select schemaops from
cluster_replication.binlog_index where epoch > @max_epoch and schemaops > 0; cluster.binlog_index where epoch > @max_epoch and schemaops > 0;
# #
# check that purge clears the binlog_index # check that purge clears the binlog_index
...@@ -51,7 +51,7 @@ select schemaops from ...@@ -51,7 +51,7 @@ select schemaops from
flush logs; flush logs;
--sleep 1 --sleep 1
purge master logs before now(); purge master logs before now();
select count(*) from cluster_replication.binlog_index; select count(*) from cluster.binlog_index;
# #
# several tables in different databases # several tables in different databases
...@@ -66,11 +66,11 @@ use test; ...@@ -66,11 +66,11 @@ use test;
insert into mysqltest.t1 values (2,1),(2,2); insert into mysqltest.t1 values (2,1),(2,2);
save_master_pos; save_master_pos;
--replace_column 1 # --replace_column 1 #
select @max_epoch:=max(epoch)-1 from cluster_replication.binlog_index; select @max_epoch:=max(epoch)-1 from cluster.binlog_index;
drop table t1; drop table t1;
drop database mysqltest; drop database mysqltest;
select inserts,updates,deletes from select inserts,updates,deletes from
cluster_replication.binlog_index where epoch > @max_epoch and inserts > 0; cluster.binlog_index where epoch > @max_epoch and inserts > 0;
select schemaops from select schemaops from
cluster_replication.binlog_index where epoch > @max_epoch and schemaops > 0; cluster.binlog_index where epoch > @max_epoch and schemaops > 0;
...@@ -14,7 +14,7 @@ drop table if exists t1,t2; ...@@ -14,7 +14,7 @@ drop table if exists t1,t2;
# and sets up the replication correctly # and sets up the replication correctly
# #
# no tables and nothing in cluster_replication.binlog_index; # no tables and nothing in cluster.binlog_index;
connection server1; connection server1;
SHOW TABLES; SHOW TABLES;
...@@ -33,7 +33,7 @@ select * from t2 order by a; ...@@ -33,7 +33,7 @@ select * from t2 order by a;
save_master_pos; save_master_pos;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch:=epoch,inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index ORDER BY epoch DESC LIMIT 1; cluster.binlog_index ORDER BY epoch DESC LIMIT 1;
let $the_epoch= `SELECT @the_epoch`; let $the_epoch= `SELECT @the_epoch`;
# see if we got something on server1 # see if we got something on server1
...@@ -41,7 +41,7 @@ connection server1; ...@@ -41,7 +41,7 @@ connection server1;
SELECT * FROM t2 ORDER BY a; SELECT * FROM t2 ORDER BY a;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
eval SELECT inserts,updates,deletes,schemaops FROM eval SELECT inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index WHERE epoch=$the_epoch; cluster.binlog_index WHERE epoch=$the_epoch;
# drop the table on server1 # drop the table on server1
DROP TABLE t2; DROP TABLE t2;
...@@ -50,12 +50,12 @@ INSERT INTO t1 VALUES (1),(2); ...@@ -50,12 +50,12 @@ INSERT INTO t1 VALUES (1),(2);
save_master_pos; save_master_pos;
--replace_column 1 <the_epoch2> --replace_column 1 <the_epoch2>
SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM SELECT @the_epoch2:=epoch,inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index ORDER BY epoch DESC LIMIT 1; cluster.binlog_index ORDER BY epoch DESC LIMIT 1;
let $the_epoch2= `SELECT @the_epoch2`; let $the_epoch2= `SELECT @the_epoch2`;
--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2> --replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
eval SELECT inserts,updates,deletes,schemaops FROM eval SELECT inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2; cluster.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2;
drop table t1; drop table t1;
# flush on server2 # flush on server2
...@@ -63,7 +63,7 @@ connection server2; ...@@ -63,7 +63,7 @@ connection server2;
SHOW TABLES; SHOW TABLES;
--replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2> --replace_result $the_epoch <the_epoch> $the_epoch2 <the_epoch2>
eval SELECT inserts,updates,deletes,schemaops FROM eval SELECT inserts,updates,deletes,schemaops FROM
cluster_replication.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2; cluster.binlog_index WHERE epoch > $the_epoch AND epoch < $the_epoch2;
# reset # reset
connection server1; connection server1;
......
...@@ -118,11 +118,11 @@ RESET MASTER; ...@@ -118,11 +118,11 @@ RESET MASTER;
# there is no neat way to find the backupid, this is a hack to find it... # there is no neat way to find the backupid, this is a hack to find it...
--exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat --exec $NDB_TOOLS_DIR/ndb_select_all --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
CREATE TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT) ENGINE = HEAP; CREATE TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT) ENGINE = HEAP;
DELETE FROM cluster_replication.backup_info; DELETE FROM cluster.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ',';
--replace_column 1 <the_backup_id> --replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster.backup_info;
let the_backup_id=`select @the_backup_id`; let the_backup_id=`select @the_backup_id`;
# restore on slave, first check that nothing is there # restore on slave, first check that nothing is there
...@@ -140,7 +140,7 @@ let the_backup_id=`select @the_backup_id`; ...@@ -140,7 +140,7 @@ let the_backup_id=`select @the_backup_id`;
# 1. # 1.
--connection slave --connection slave
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
--let $the_epoch= `select @the_epoch` --let $the_epoch= `select @the_epoch`
# 2. # 2.
...@@ -148,7 +148,7 @@ SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; ...@@ -148,7 +148,7 @@ SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
--replace_column 1 <the_pos> --replace_column 1 <the_pos>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; FROM cluster.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1;
--let $the_pos= `SELECT @the_pos` --let $the_pos= `SELECT @the_pos`
--let $the_file= `SELECT @the_file` --let $the_file= `SELECT @the_file`
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Currently test only works with ndb since it retrieves "old" # Currently test only works with ndb since it retrieves "old"
# binlog positions with cluster_replication.binlog_index and apply_status; # binlog positions with cluster.binlog_index and apply_status;
# #
# create a table with one row # create a table with one row
...@@ -15,7 +15,7 @@ SELECT * FROM t1 ORDER BY c3; ...@@ -15,7 +15,7 @@ SELECT * FROM t1 ORDER BY c3;
# sync slave and retrieve epoch # sync slave and retrieve epoch
sync_slave_with_master; sync_slave_with_master;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
let $the_epoch= `select @the_epoch` ; let $the_epoch= `select @the_epoch` ;
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
...@@ -24,7 +24,7 @@ connection master; ...@@ -24,7 +24,7 @@ connection master;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
--replace_column 1 <the_pos> --replace_column 1 <the_pos>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch = $the_epoch ; FROM cluster.binlog_index WHERE epoch = $the_epoch ;
let $the_pos= `SELECT @the_pos` ; let $the_pos= `SELECT @the_pos` ;
let $the_file= `SELECT @the_file` ; let $the_file= `SELECT @the_file` ;
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# Currently test only works with ndb since it retrieves "old" # Currently test only works with ndb since it retrieves "old"
# binlog positions with cluster_replication.binlog_index and apply_status; # binlog positions with cluster.binlog_index and apply_status;
# #
# create a table with one row, and make sure the other "master" gets it # create a table with one row, and make sure the other "master" gets it
...@@ -25,7 +25,7 @@ SELECT * FROM t1 ORDER BY c3; ...@@ -25,7 +25,7 @@ SELECT * FROM t1 ORDER BY c3;
connection master; connection master;
sync_slave_with_master; sync_slave_with_master;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
let $the_epoch= `select @the_epoch` ; let $the_epoch= `select @the_epoch` ;
SELECT * FROM t1 ORDER BY c3; SELECT * FROM t1 ORDER BY c3;
stop slave; stop slave;
...@@ -34,7 +34,7 @@ stop slave; ...@@ -34,7 +34,7 @@ stop slave;
connection server2; connection server2;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch = $the_epoch ; FROM cluster.binlog_index WHERE epoch = $the_epoch ;
let $the_pos= `SELECT @the_pos` ; let $the_pos= `SELECT @the_pos` ;
let $the_file= `SELECT @the_file` ; let $the_file= `SELECT @the_file` ;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
# Currently test only works with ndb since it retrieves "old" # Currently test only works with ndb since it retrieves "old"
# binlog positions with cluster_replication.binlog_index and apply_status; # binlog positions with cluster.binlog_index and apply_status;
# #
# stop the save # stop the save
...@@ -27,13 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; ...@@ -27,13 +27,13 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
# take a backup on master # take a backup on master
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT --exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
--exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat --exec $NDB_TOOLS_DIR/ndb_select_all --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
CREATE TEMPORARY TABLE IF NOT EXISTS cluster_replication.backup_info (id INT, backup_id INT)ENGINE=HEAP; CREATE TEMPORARY TABLE IF NOT EXISTS cluster.backup_info (id INT, backup_id INT)ENGINE=HEAP;
DELETE FROM cluster_replication.backup_info; DELETE FROM cluster.backup_info;
LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster_replication.backup_info FIELDS TERMINATED BY ','; LOAD DATA INFILE '../tmp.dat' INTO TABLE cluster.backup_info FIELDS TERMINATED BY ',';
--replace_column 1 <the_backup_id> --replace_column 1 <the_backup_id>
SELECT @the_backup_id:=backup_id FROM cluster_replication.backup_info; SELECT @the_backup_id:=backup_id FROM cluster.backup_info;
let the_backup_id=`select @the_backup_id` ; let the_backup_id=`select @the_backup_id` ;
DROP TABLE cluster_replication.backup_info; DROP TABLE cluster.backup_info;
# update a row # update a row
UPDATE t1 SET c2=0 WHERE c3="row2"; UPDATE t1 SET c2=0 WHERE c3="row2";
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3; SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
...@@ -73,7 +73,7 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1; ...@@ -73,7 +73,7 @@ SELECT hex(c2),hex(c3),c1 FROM t2 ORDER BY c1;
# 1. # 1.
connection slave; connection slave;
--replace_column 1 <the_epoch> --replace_column 1 <the_epoch>
SELECT @the_epoch:=MAX(epoch) FROM cluster_replication.apply_status; SELECT @the_epoch:=MAX(epoch) FROM cluster.apply_status;
let $the_epoch= `select @the_epoch` ; let $the_epoch= `select @the_epoch` ;
# 2. # 2.
...@@ -81,7 +81,7 @@ connection master; ...@@ -81,7 +81,7 @@ connection master;
--replace_result $the_epoch <the_epoch> --replace_result $the_epoch <the_epoch>
--replace_column 1 <the_pos> --replace_column 1 <the_pos>
eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1) eval SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
FROM cluster_replication.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1; FROM cluster.binlog_index WHERE epoch > $the_epoch ORDER BY epoch ASC LIMIT 1;
let $the_pos= `SELECT @the_pos` ; let $the_pos= `SELECT @the_pos` ;
let $the_file= `SELECT @the_file` ; let $the_file= `SELECT @the_file` ;
...@@ -124,11 +124,11 @@ STOP SLAVE; ...@@ -124,11 +124,11 @@ STOP SLAVE;
connection master; connection master;
reset master; reset master;
# should now contain nothing # should now contain nothing
select * from cluster_replication.binlog_index; select * from cluster.binlog_index;
connection slave; connection slave;
reset slave; reset slave;
# should now contain nothing # should now contain nothing
select * from cluster_replication.apply_status; select * from cluster.apply_status;
# End 5.1 Test # End 5.1 Test
...@@ -874,8 +874,8 @@ $c_pp ...@@ -874,8 +874,8 @@ $c_pp
$c_gl $c_gl
$c_sl $c_sl
$c_ev $c_ev
CREATE DATABASE IF NOT EXISTS cluster_replication; CREATE DATABASE IF NOT EXISTS cluster;
CREATE TABLE IF NOT EXISTS cluster_replication.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 cluster.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;
END_OF_DATA END_OF_DATA
...@@ -184,8 +184,8 @@ static void dbug_print_table(const char *info, TABLE *table) ...@@ -184,8 +184,8 @@ static void dbug_print_table(const char *info, TABLE *table)
Run a query through mysql_parse Run a query through mysql_parse
Used to: Used to:
- purging the cluster_replication.binlog_index - purging the binlog_index
- creating the cluster_replication.apply_status table - creating the apply_status table
*/ */
static void run_query(THD *thd, char *buf, char *end, static void run_query(THD *thd, char *buf, char *end,
my_bool print_error, my_bool disable_binlog) my_bool print_error, my_bool disable_binlog)
...@@ -606,7 +606,7 @@ void ndbcluster_binlog_init_handlerton() ...@@ -606,7 +606,7 @@ void ndbcluster_binlog_init_handlerton()
/* /*
check the availability af the cluster_replication.apply_status share check the availability af the apply_status share
- return share, but do not increase refcount - return share, but do not increase refcount
- return 0 if there is no share - return 0 if there is no share
*/ */
...@@ -624,7 +624,7 @@ static NDB_SHARE *ndbcluster_check_apply_status_share() ...@@ -624,7 +624,7 @@ static NDB_SHARE *ndbcluster_check_apply_status_share()
} }
/* /*
check the availability af the cluster_replication.schema share check the availability af the schema share
- return share, but do not increase refcount - return share, but do not increase refcount
- return 0 if there is no share - return 0 if there is no share
*/ */
...@@ -642,7 +642,7 @@ static NDB_SHARE *ndbcluster_check_schema_share() ...@@ -642,7 +642,7 @@ static NDB_SHARE *ndbcluster_check_schema_share()
} }
/* /*
Create the cluster_replication.apply_status table Create the apply_status table
*/ */
static int ndbcluster_create_apply_status_table(THD *thd) static int ndbcluster_create_apply_status_table(THD *thd)
{ {
...@@ -691,7 +691,7 @@ static int ndbcluster_create_apply_status_table(THD *thd) ...@@ -691,7 +691,7 @@ static int ndbcluster_create_apply_status_table(THD *thd)
/* /*
Create the cluster_replication.schema table Create the schema table
*/ */
static int ndbcluster_create_schema_table(THD *thd) static int ndbcluster_create_schema_table(THD *thd)
{ {
...@@ -1655,13 +1655,13 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, ...@@ -1655,13 +1655,13 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb,
/********************************************************************* /*********************************************************************
Internal helper functions for handeling of the cluster replication tables Internal helper functions for handeling of the cluster replication tables
- cluster_replication.binlog_index - binlog_index
- cluster_replication.apply_status - apply_status
*********************************************************************/ *********************************************************************/
/* /*
struct to hold the data to be inserted into the struct to hold the data to be inserted into the
cluster_replication.binlog_index table binlog_index table
*/ */
struct Binlog_index_row { struct Binlog_index_row {
ulonglong gci; ulonglong gci;
...@@ -1674,7 +1674,7 @@ struct Binlog_index_row { ...@@ -1674,7 +1674,7 @@ struct Binlog_index_row {
}; };
/* /*
Open the cluster_replication.binlog_index table Open the binlog_index table
*/ */
static int open_binlog_index(THD *thd, TABLE_LIST *tables, static int open_binlog_index(THD *thd, TABLE_LIST *tables,
TABLE **binlog_index) TABLE **binlog_index)
...@@ -1705,7 +1705,7 @@ static int open_binlog_index(THD *thd, TABLE_LIST *tables, ...@@ -1705,7 +1705,7 @@ static int open_binlog_index(THD *thd, TABLE_LIST *tables,
} }
/* /*
Insert one row in the cluster_replication.binlog_index Insert one row in the binlog_index
declared friend in handler.h to be able to call write_row directly declared friend in handler.h to be able to call write_row directly
so that this insert is not replicated so that this insert is not replicated
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#define NDB_REP_DB "cluster_replication" #define NDB_REP_DB "cluster"
#define NDB_REP_TABLE "binlog_index" #define NDB_REP_TABLE "binlog_index"
#define NDB_APPLY_TABLE "apply_status" #define NDB_APPLY_TABLE "apply_status"
#define NDB_SCHEMA_TABLE "schema" #define NDB_SCHEMA_TABLE "schema"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment