mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-rpl
into pilot.mysql.com:/data/msvensson/mysql/mysql-5.1-mtr
This commit is contained in:
75
mysql-test/suite/rpl_ndb/my.cnf
Normal file
75
mysql-test/suite/rpl_ndb/my.cnf
Normal file
@@ -0,0 +1,75 @@
|
||||
!include include/default_mysqld.cnf
|
||||
!include include/default_ndbd.cnf
|
||||
|
||||
[cluster_config.1]
|
||||
NoOfReplicas= 2
|
||||
ndbd=,
|
||||
ndb_mgmd=
|
||||
mysqld=,
|
||||
|
||||
[cluster_config.slave]
|
||||
NoOfReplicas= 1
|
||||
ndbd=
|
||||
ndb_mgmd=
|
||||
mysqld=
|
||||
|
||||
[mysqld]
|
||||
# Make all mysqlds use cluster
|
||||
ndbcluster
|
||||
# Turn on bin logging
|
||||
log-bin= master-bin
|
||||
|
||||
[mysqld.1.1]
|
||||
|
||||
[mysqld.1.1]
|
||||
|
||||
[mysqld.1.slave]
|
||||
|
||||
# Append <testname>-slave.opt file to the list of argument used when
|
||||
# starting the mysqld
|
||||
#!use-slave-opt
|
||||
|
||||
# Connect mysqld in the second cluster as save to first mysqld
|
||||
# Hardcode the host to 127.0.0.1 until running on more
|
||||
# than one host and it probably need to be masked anyway
|
||||
# master-host= @mysqld.1.#host
|
||||
master-host= 127.0.0.1
|
||||
master-port= @mysqld.1.1.port
|
||||
master-password= @mysqld.1.1.#password
|
||||
master-user= @mysqld.1.1.#user
|
||||
master-connect-retry= 1
|
||||
|
||||
log-bin= slave-bin
|
||||
relay-log= slave-relay-bin
|
||||
|
||||
init-rpl-role= slave
|
||||
log-slave-updates
|
||||
master-retry-count= 10
|
||||
|
||||
# Values reported by slave when it connect to master
|
||||
# and shows up in SHOW SLAVE STATUS;
|
||||
report-host= 127.0.0.1
|
||||
report-port= @mysqld.1.slave.port
|
||||
report-user= root
|
||||
|
||||
loose-skip-innodb
|
||||
skip-slave-start
|
||||
|
||||
# Directory where slaves find the dumps generated by "load data"
|
||||
# on the server. The path need to have constant length otherwise
|
||||
# test results will vary, thus a relative path is used.
|
||||
slave-load-tmpdir= ../../../tmp
|
||||
|
||||
rpl-recovery-rank= @mysqld.1.slave.server-id
|
||||
|
||||
|
||||
[ENV]
|
||||
NDB_CONNECTSTRING= @mysql_cluster.1.ndb_connectstring
|
||||
MASTER_MYPORT= @mysqld.1.1.port
|
||||
MASTER_MYPORT1= @mysqld.2.1.port
|
||||
|
||||
NDB_CONNECTSTRING_SLAVE= @mysql_cluster.slave.ndb_connectstring
|
||||
SLAVE_MYPORT= @mysqld.1.slave.port
|
||||
SLAVE_MYSOCK= @mysqld.1.slave.socket
|
||||
|
||||
NDB_BACKUP_DIR= @cluster_config.ndbd.1.1.BackupDataDir
|
@@ -23,11 +23,11 @@ select count(*) from t2;
|
||||
count(*)
|
||||
0
|
||||
begin;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
@@ -49,11 +49,11 @@ count(*)
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
begin;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
@@ -77,11 +77,11 @@ delete from t2;
|
||||
begin;
|
||||
insert into t2 values(3),(4);
|
||||
insert into t1 values(3),(4);
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
|
||||
Warnings:
|
||||
Warning 1262 Row 1 was truncated; it contained more data than there were input columns
|
||||
Warning 1262 Row 2 was truncated; it contained more data than there were input columns
|
||||
|
@@ -12,7 +12,7 @@ create table t1(n int not null auto_increment primary key)ENGINE=NDB;
|
||||
insert into t1 values (NULL);
|
||||
drop table t1;
|
||||
create table t1 (word char(20) not null)ENGINE=NDB;
|
||||
load data infile '../std_data_ln/words.dat' into table t1 ignore 1 lines;
|
||||
load data infile 'LOAD_FILE' into table t1 ignore 1 lines;
|
||||
select count(*) from t1;
|
||||
count(*)
|
||||
69
|
||||
|
@@ -26,10 +26,10 @@ stop slave;
|
||||
SELECT @the_pos:=Position,@the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
||||
FROM mysql.ndb_binlog_index WHERE epoch = <the_epoch> ;
|
||||
@the_pos:=Position @the_file:=SUBSTRING_INDEX(FILE, '/', -1)
|
||||
106 master-bin1.000001
|
||||
106 master-bin.000001
|
||||
CHANGE MASTER TO
|
||||
master_port=<MASTER_PORT1>,
|
||||
master_log_file = 'master-bin1.000001',
|
||||
master_log_file = 'master-bin.000001',
|
||||
master_log_pos = 106 ;
|
||||
start slave;
|
||||
INSERT INTO t1 VALUES ("row2","will go away",2),("row3","will change",3),("row4","D",4);
|
||||
|
@@ -5,8 +5,8 @@ reset slave;
|
||||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||||
start slave;
|
||||
CREATE TABLE t1 (word CHAR(20) NOT NULL);
|
||||
LOAD DATA INFILE '../std_data_ln/words.dat' INTO TABLE t1;
|
||||
LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/std_data/words.dat' INTO TABLE t1;
|
||||
LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
|
||||
LOAD DATA INFILE 'LOAD_FILE' INTO TABLE t1;
|
||||
SELECT * FROM t1 ORDER BY word LIMIT 10;
|
||||
word
|
||||
Aarhus
|
||||
|
@@ -25,12 +25,8 @@ hex(c2) hex(c3) c1
|
||||
0 1 BCDEF
|
||||
1 0 CD
|
||||
0 0 DEFGHIJKL
|
||||
CREATE TEMPORARY TABLE IF NOT EXISTS test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
DELETE FROM test.backup_info;
|
||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
SELECT @the_backup_id:=backup_id FROM test.backup_info;
|
||||
@the_backup_id:=backup_id
|
||||
<the_backup_id>
|
||||
CREATE TEMPORARY TABLE test.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
LOAD DATA INFILE 'DUMP_FILE' INTO TABLE test.backup_info FIELDS TERMINATED BY ',';
|
||||
DROP TABLE test.backup_info;
|
||||
UPDATE t1 SET c2=0 WHERE c3="row2";
|
||||
SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
|
||||
|
@@ -73,7 +73,7 @@ CREATE TABLE ACCOUNT_TYPE ( ACCOUNT_TYPE_ID INT UNSIGNED NOT NULL,
|
||||
#
|
||||
# create "BANK" application
|
||||
#
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankCreator >> $NDB_TOOLS_OUTPUT
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankCreator >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
#
|
||||
# start main loop
|
||||
@@ -88,9 +88,9 @@ while ($2)
|
||||
#
|
||||
# start "BANK" application
|
||||
#
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/bank/bankTransactionMaker >> $NDB_TOOLS_OUTPUT &
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankTimer -w 5 >> $NDB_TOOLS_OUTPUT &
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankMakeGL >> $NDB_TOOLS_OUTPUT &
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/bank/bankTransactionMaker >> $NDB_TOOLS_OUTPUT &
|
||||
|
||||
#
|
||||
# let the "BANK" run for a while
|
||||
@@ -114,10 +114,10 @@ CREATE DATABASE BANK;
|
||||
# start by taking a backup on master
|
||||
--connection master
|
||||
RESET MASTER;
|
||||
--exec $NDB_MGM --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_MGM --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING" -e "start backup" >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
# 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="$NDB_CONNECTSTRING" -d sys --delimiter=',' SYSTAB_0 | grep 520093696 > $MYSQLTEST_VARDIR/tmp.dat
|
||||
CREATE TABLE IF NOT EXISTS mysql.backup_info (id INT, backup_id INT) ENGINE = HEAP;
|
||||
DELETE FROM mysql.backup_info;
|
||||
LOAD DATA INFILE '../tmp.dat' INTO TABLE mysql.backup_info FIELDS TERMINATED BY ',';
|
||||
@@ -128,8 +128,8 @@ let the_backup_id=`select @the_backup_id`;
|
||||
|
||||
# restore on slave, first check that nothing is there
|
||||
--connection slave
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -p 8 -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
#
|
||||
# now setup replication to continue from last epoch
|
||||
@@ -150,7 +150,7 @@ while ($1)
|
||||
--replace_column 1 <Slave_IO_State> 7 <Read_Master_Log_Pos> 8 <Relay_Log_File> 9 <Relay_Log_Pos> 16 <Replicate_Ignore_Table> 22 <Exec_Master_Log_Pos> 23 <Relay_Log_Space> 33 <Seconds_Behind_Master> 34 <Last_IO_Errno> 35 <Last_IO_Error>
|
||||
SHOW SLAVE STATUS;
|
||||
STOP SLAVE;
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT_SLAVE ../storage/ndb/test/ndbapi/bank/bankValidateAllGLs >> $NDB_TOOLS_OUTPUT
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING_SLAVE ../storage/ndb/test/ndbapi/bank/bankValidateAllGLs >> $NDB_TOOLS_OUTPUT
|
||||
START SLAVE;
|
||||
--dec $1
|
||||
}
|
||||
|
@@ -21,8 +21,8 @@ select count(*) from t2;
|
||||
connection master;
|
||||
|
||||
begin;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
|
||||
rollback;
|
||||
|
||||
select count(*) from t1;
|
||||
@@ -35,8 +35,8 @@ connection master;
|
||||
delete from t1;
|
||||
delete from t2;
|
||||
begin;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
|
||||
rollback;
|
||||
|
||||
select count(*) from t1;
|
||||
@@ -51,8 +51,8 @@ delete from t2;
|
||||
begin;
|
||||
insert into t2 values(3),(4);
|
||||
insert into t1 values(3),(4);
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../std_data_ln/rpl_loaddata.dat' into table t1;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t2;
|
||||
load data infile '../../../std_data/rpl_loaddata.dat' into table t1;
|
||||
rollback;
|
||||
|
||||
select count(*) from t1;
|
||||
|
@@ -62,5 +62,5 @@ CREATE TABLE SERVER
|
||||
#
|
||||
# start "load" application
|
||||
#
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
|
||||
--exec NDB_CONNECTSTRING=localhost:$NDBCLUSTER_PORT ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbCreate >> $NDB_TOOLS_OUTPUT
|
||||
--exec NDB_CONNECTSTRING=$NDB_CONNECTSTRING ../storage/ndb/test/ndbapi/DbAsyncGenerator >> $NDB_TOOLS_OUTPUT
|
||||
|
@@ -39,8 +39,8 @@ SELECT hex(c1),hex(c2),c3 FROM t1 ORDER BY c3;
|
||||
# we should have no tables
|
||||
SHOW TABLES;
|
||||
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
#
|
||||
# BUG#11960
|
||||
@@ -50,8 +50,8 @@ SHOW TABLES;
|
||||
DROP DATABASE ndbsynctest;
|
||||
CREATE DATABASE ndbsynctest;
|
||||
USE ndbsynctest;
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="localhost:$NDBCLUSTER_PORT_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 1 -m -r --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
--exec $NDB_TOOLS_DIR/ndb_restore --no-defaults --ndb-connectstring="$NDB_CONNECTSTRING_SLAVE" -b $the_backup_id -n 2 -r -e --print --print_meta $NDB_BACKUP_DIR/BACKUP/BACKUP-$the_backup_id >> $NDB_TOOLS_OUTPUT
|
||||
|
||||
# continue test
|
||||
SHOW TABLES;
|
||||
|
@@ -4,8 +4,8 @@
|
||||
-- source include/ndb_master-slave.inc
|
||||
|
||||
--exec echo Running ndbapi_simple_dual
|
||||
--exec $NDB_EXAMPLES_DIR/ndbapi_simple_dual/ndbapi_simple_dual $MASTER_MYSOCK "localhost:$NDBCLUSTER_PORT" $SLAVE_MYSOCK "localhost:$NDBCLUSTER_PORT_SLAVE" >> $NDB_EXAMPLES_OUTPUT
|
||||
--exec $NDB_EXAMPLES_DIR/ndbapi_simple_dual/ndbapi_simple_dual $MASTER_MYSOCK "$NDB_CONNECTSTRING" $SLAVE_MYSOCK "$NDB_CONNECTSTRING_SLAVE" >> $NDB_EXAMPLES_OUTPUT
|
||||
|
||||
--exec echo Running mgmapi_logevent
|
||||
--exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "localhost:$NDBCLUSTER_PORT" "localhost:$NDBCLUSTER_PORT_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
|
||||
--exec $NDB_EXAMPLES_DIR/mgmapi_logevent/mgmapi_logevent "$NDB_CONNECTSTRING" "$NDB_CONNECTSTRING_SLAVE" 1 >> $NDB_EXAMPLES_OUTPUT
|
||||
|
||||
|
Reference in New Issue
Block a user