mirror of
https://github.com/MariaDB/server.git
synced 2025-01-29 18:20:07 +01:00
Backport for WL#4416
This commit is contained in:
parent
76623d35b8
commit
9e3b092c92
6 changed files with 53 additions and 19 deletions
|
@ -36,7 +36,7 @@ SELECT LENGTH(data) FROM test.t1 WHERE c1 = 3;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
sleep 5;
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
--echo
|
--echo
|
||||||
--echo **** Data Insert Validation Slave Section test.t1 ****
|
--echo **** Data Insert Validation Slave Section test.t1 ****
|
||||||
--echo
|
--echo
|
||||||
|
@ -56,12 +56,10 @@ UPDATE t1 set data=repeat('c',17*1024) where c1 = 2;
|
||||||
--echo
|
--echo
|
||||||
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 1;
|
||||||
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
SELECT LENGTH(data) FROM test.t1 WHERE c1 = 2;
|
||||||
# Sleep is needed for NDB to allow time for
|
|
||||||
# Injector thread to populate the bin log.
|
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
sleep 5;
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
--echo
|
--echo
|
||||||
--echo **** Data Update Validation Slave Section test.t1 ****
|
--echo **** Data Update Validation Slave Section test.t1 ****
|
||||||
--echo
|
--echo
|
||||||
|
@ -132,7 +130,7 @@ FROM test.t2 WHERE c1=2;
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
sleep 5;
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
--echo
|
--echo
|
||||||
--echo **** Data Insert Validation Slave Section test.t2 ****
|
--echo **** Data Insert Validation Slave Section test.t2 ****
|
||||||
--echo
|
--echo
|
||||||
|
@ -155,12 +153,10 @@ SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
||||||
FROM test.t2 WHERE c1=1;
|
FROM test.t2 WHERE c1=1;
|
||||||
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
SELECT c1, LENGTH(c2), SUBSTR(c2,1+2*900,2), LENGTH(c4), SUBSTR(c4,1+3*900,3)
|
||||||
FROM test.t2 WHERE c1=2;
|
FROM test.t2 WHERE c1=2;
|
||||||
# Sleep is needed for NDB to allow time for
|
|
||||||
# Injector thread to populate the bin log.
|
|
||||||
save_master_pos;
|
save_master_pos;
|
||||||
connection slave;
|
connection slave;
|
||||||
sync_with_master;
|
sync_with_master;
|
||||||
sleep 5;
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
--echo
|
--echo
|
||||||
--echo **** Data Update Validation Slave Section test.t2 ****
|
--echo **** Data Update Validation Slave Section test.t2 ****
|
||||||
--echo
|
--echo
|
||||||
|
|
|
@ -44,9 +44,10 @@ END|
|
||||||
delimiter ;|
|
delimiter ;|
|
||||||
|
|
||||||
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
|
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
|
||||||
sleep 6;
|
let $wait_time= 6;
|
||||||
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
|
INSERT INTO test.t1 VALUES (null,test.f1()),(null,test.f1()),(null,test.f1());
|
||||||
sleep 6;
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
|
|
||||||
#Select in this test are used for debugging
|
#Select in this test are used for debugging
|
||||||
#select * from test.t1;
|
#select * from test.t1;
|
||||||
|
|
|
@ -41,10 +41,7 @@ CALL test.p2();
|
||||||
SELECT release_lock("test");
|
SELECT release_lock("test");
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
#show binlog events;
|
#show binlog events;
|
||||||
# Added sleep for use with NDB to ensure that
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
# the injector thread will populate log before
|
|
||||||
# we switch to the slave.
|
|
||||||
sleep 5;
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
connection slave;
|
connection slave;
|
||||||
SELECT * FROM test.t1;
|
SELECT * FROM test.t1;
|
||||||
|
|
|
@ -68,8 +68,8 @@ enable_query_log;
|
||||||
connection slave;
|
connection slave;
|
||||||
lock tables t1 read;
|
lock tables t1 read;
|
||||||
start slave;
|
start slave;
|
||||||
#hope this is long enough for I/O thread to fetch over 16K relay log data
|
connection master;
|
||||||
sleep 3;
|
--source include/sync_slave_io_with_master.inc
|
||||||
unlock tables;
|
unlock tables;
|
||||||
|
|
||||||
#test handling of aborted connection in the middle of update
|
#test handling of aborted connection in the middle of update
|
||||||
|
|
|
@ -35,9 +35,8 @@ INSERT INTO test.t2 VALUES (1, 0.0);
|
||||||
#show binlog events;
|
#show binlog events;
|
||||||
select * from test.t1;
|
select * from test.t1;
|
||||||
select * from test.t2;
|
select * from test.t2;
|
||||||
# Have to sleep for a few seconds to allow
|
let $wait_time= 10;
|
||||||
# NDB injector thread to populate binlog
|
--source include/wait_for_ndb_to_binlog.inc
|
||||||
sleep 10;
|
|
||||||
sync_slave_with_master;
|
sync_slave_with_master;
|
||||||
connection slave;
|
connection slave;
|
||||||
select * from test.t1;
|
select * from test.t1;
|
||||||
|
|
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
41
mysql-test/include/wait_for_ndb_to_binlog.inc
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# ==== Purpose ====
|
||||||
|
#
|
||||||
|
# Several test primitives from mysql-test/extra/rpl_tests
|
||||||
|
# shared for test cases for MyISAM, InnoDB, NDB and other
|
||||||
|
# engines. But for NDB all events will be added by NDB
|
||||||
|
# injector and now there are no way to detect the state of
|
||||||
|
# NDB injector therefore this primitive waits 5 sec
|
||||||
|
# if engine type is NDB.
|
||||||
|
# In future that should be fixed by waiting of proper
|
||||||
|
# state of NDB injector.
|
||||||
|
#
|
||||||
|
# ==== Usage ====
|
||||||
|
#
|
||||||
|
# let $engine_type= NDB;
|
||||||
|
# --source include/wait_for_ndb_to_binlog.inc
|
||||||
|
#
|
||||||
|
# ==== Parameters =====
|
||||||
|
#
|
||||||
|
# $engine_type
|
||||||
|
# Type of engine. If type is NDB then it waits $wait_time sec
|
||||||
|
#
|
||||||
|
# $wait_time
|
||||||
|
# Test will wait $wait_time seconds
|
||||||
|
|
||||||
|
let $_wait_time= 5;
|
||||||
|
|
||||||
|
if (!$wait_time) {
|
||||||
|
let $_wait_time= $wait_time;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (`SELECT UPPER(LEFT('$engine_type',3)) = 'NDB'`) {
|
||||||
|
while (!$_wait_time) {
|
||||||
|
let $_wait_time_internal= 10;
|
||||||
|
while (!$_wait_time_internal) {
|
||||||
|
sleep 0.1;
|
||||||
|
dec $_wait_time_internal;
|
||||||
|
}
|
||||||
|
dec $_wait_time;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue