mirror of
https://github.com/MariaDB/server.git
synced 2025-08-26 01:44:06 +03:00
Major replication test framework cleanup. This does the following: - Ensure that all tests clean up the replication state when they finish, by making check-testcase check the output of SHOW SLAVE STATUS. This implies: - Slave must not be running after test finished. This is good because it removes the risk for sporadic errors in subsequent tests when a test forgets to sync correctly. - Slave SQL and IO errors must be cleared when test ends. This is good because we will notice if a test gets an unexpected error in the slave threads near the end. - We no longer have to clean up before a test starts. - Ensure that all tests that wait for an error in one of the slave threads waits for a specific error. It is no longer possible to source wait_for_slave_[sql|io]_to_stop.inc when there is an error in one of the slave threads. This is good because: - If a test expects an error but there is a bug that causes another error to happen, or if it stops the slave thread without an error, then we will notice. - When developing tests, wait_for_*_to_[start|stop].inc will fail immediately if there is an error in the relevant slave thread. Before this patch, we had to wait for the timeout. - Remove duplicated and repeated code for setting up unusual replication topologies. Now, there is a single file that is capable of setting up arbitrary topologies (include/rpl_init.inc, but include/master-slave.inc is still available for the most common topology). Tests can now end with include/rpl_end.inc, which will clean up correctly no matter what topology is used. The topology can be changed with include/rpl_change_topology.inc. - Improved debug information when tests fail. This includes: - debug info is printed on all servers configured by include/rpl_init.inc - User can set $rpl_debug=1, which makes auxiliary replication files print relevant debug info. - Improved documentation for all auxiliary replication files. Now they describe purpose, usage, parameters, and side effects. - Many small code cleanups: - Made have_innodb.inc output a sensible error message. - Moved contents of rpl000017-slave.sh into rpl000017.test - Added mysqltest variables that expose the current state of disable_warnings/enable_warnings and friends. - Too many to list here: see per-file comments for details.
136 lines
2.5 KiB
Plaintext
136 lines
2.5 KiB
Plaintext
include/master-slave.inc
|
|
[connection master]
|
|
DROP TABLE IF EXISTS test.t1;
|
|
CREATE TABLE test.t1 (
|
|
dummyKey INTEGER NOT NULL,
|
|
f01 TINYINT,
|
|
f10 TINYINT,
|
|
f12 TINYINT,
|
|
f15 TINYINT,
|
|
f16 TINYINT,
|
|
f7 TINYINT,
|
|
f9 TINYINT,
|
|
f29 TINYINT,
|
|
f0 TINYINT,
|
|
fA1 TINYINT,
|
|
C32 TINYINT,
|
|
A42 TINYINT,
|
|
CA3 TINYINT,
|
|
A044 TINYINT,
|
|
f001 TINYINT,
|
|
A3002 TINYINT,
|
|
fC003 TINYINT,
|
|
CA300 TINYINT,
|
|
A305 TINYINT,
|
|
CA321 TINYINT,
|
|
r001 TINYINT,
|
|
bit1 BIT(6),
|
|
bit2 BIT(6),
|
|
bit3 BIT(6),
|
|
State1 TINYINT,
|
|
State2 TINYINT,
|
|
State3 TINYINT,
|
|
State4 TINYINT,
|
|
SubState TINYINT,
|
|
gState TINYINT,
|
|
oSupp TINYINT,
|
|
tSupp TINYINT,
|
|
sSuppD TINYINT,
|
|
mSuppf TINYINT,
|
|
GSuppDf TINYINT,
|
|
VNotSupp TINYINT,
|
|
x034 TINYINT,
|
|
PRIMARY KEY USING HASH (dummyKey) );
|
|
LOCK TABLES test.t1 WRITE;
|
|
INSERT INTO test.t1 VALUES (6,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'111110',b'110101',4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'111111',b'000000',b'100100',4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (2,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'000000',b'101010',b'010101',4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (3,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,b'101010',b'111111',b'000000',4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (4,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (5,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (7,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
INSERT INTO test.t1 VALUES (8,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,4,5,5,5,5,5,5,5,5,5,3,2,1);
|
|
UNLOCK TABLES;
|
|
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
|
|
oSupp sSuppD GSuppDf VNotSupp x034
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
SELECT hex(bit1) FROM test.t1 ORDER BY bit1;
|
|
hex(bit1)
|
|
0
|
|
0
|
|
0
|
|
0
|
|
0
|
|
2A
|
|
3F
|
|
3F
|
|
SELECT hex(bit2) from test.t1 ORDER BY bit2;
|
|
hex(bit2)
|
|
0
|
|
1
|
|
1
|
|
1
|
|
1
|
|
2A
|
|
3E
|
|
3F
|
|
SELECT hex(bit3) from test.t1 ORDER BY bit3;
|
|
hex(bit3)
|
|
0
|
|
1
|
|
1
|
|
1
|
|
1
|
|
15
|
|
24
|
|
35
|
|
SELECT oSupp, sSuppD, GSuppDf, VNotSupp, x034 FROM test.t1;
|
|
oSupp sSuppD GSuppDf VNotSupp x034
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
5 5 3 2 1
|
|
SELECT hex(bit1) FROM test.t1 ORDER BY bit1;
|
|
hex(bit1)
|
|
0
|
|
0
|
|
0
|
|
0
|
|
0
|
|
2A
|
|
3F
|
|
3F
|
|
SELECT hex(bit2) from test.t1 ORDER BY bit2;
|
|
hex(bit2)
|
|
0
|
|
1
|
|
1
|
|
1
|
|
1
|
|
2A
|
|
3E
|
|
3F
|
|
SELECT hex(bit3) from test.t1 ORDER BY bit3;
|
|
hex(bit3)
|
|
0
|
|
1
|
|
1
|
|
1
|
|
1
|
|
15
|
|
24
|
|
35
|
|
DROP TABLE IF EXISTS test.t1;
|
|
include/rpl_end.inc
|