mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
2c631fe880
- make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_commit_after_flush.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_delete_no_where.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_insert_ignore.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_log.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_multi_update2.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_multi_update3.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_relayrotate.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_001.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_UUID.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_basic.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_blob.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_charset.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_func003.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_sp003.test: make tests wait until ndb connects properly mysql-test/extra/rpl_tests/rpl_row_sp006.test: make tests wait until ndb connects properly mysql-test/include/have_multi_ndb.inc: make tests wait until ndb connects properly mysql-test/include/have_ndb.inc: make tests wait until ndb connects properly mysql-test/include/ndb_not_readonly.inc: make tests wait until ndb connects properly mysql-test/t/rpl_commit_after_flush.test: make tests wait until ndb connects properly mysql-test/t/rpl_delete_no_where.test: make tests wait until ndb connects properly mysql-test/t/rpl_insert_ignore.test: make tests wait until ndb connects properly mysql-test/t/rpl_multi_update2.test: make tests wait until ndb connects properly mysql-test/t/rpl_multi_update3.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_2innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_2myisam.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_UUID.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_auto_inc.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_bank.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_basic.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_blob.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_blob2.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_charset.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_circular.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_circular_simplex.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_commit_afterflush.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_dd_advance.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_dd_basic.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_dd_partitions.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_ddl.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_delete_nowhere.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_do_db.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_do_table.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_extraCol.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_func003.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_idempotent.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_innodb2ndb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_innodb_trans.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_insert_ignore.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_load.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_log.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_multi.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_multi_update2.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_multi_update3.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_myisam2ndb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_relayrotate.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_rep_ignore.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_row_001.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_sp003.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_sp006.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_stm_innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_sync.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndb_trig004.test: make tests wait until ndb connects properly mysql-test/t/rpl_ndbapi_multi.test: make tests wait until ndb connects properly mysql-test/t/rpl_relayrotate.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_001.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_UUID.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_basic_2myisam.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_basic_3innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_basic_7ndb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_blob_innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_blob_myisam.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_charset.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_func003.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_log.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_log_innodb.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_sp003.test: make tests wait until ndb connects properly mysql-test/t/rpl_row_sp006_InnoDB.test: make tests wait until ndb connects properly mysql-test/t/rpl_stm_log.test: make tests wait until ndb connects properly mysql-test/t/rpl_truncate_7ndb.test: make tests wait until ndb connects properly mysql-test/include/ndb_master-slave.inc: New BitKeeper file ``mysql-test/include/ndb_master-slave.inc''
77 lines
2.6 KiB
Text
77 lines
2.6 KiB
Text
# When the relay log gets rotated while the I/O thread
|
|
# is reading a transaction, the transaction spans on two or more
|
|
# relay logs. If STOP SLAVE occurs while the SQL thread is
|
|
# executing a part of the transaction in the non-first relay logs,
|
|
# we test if START SLAVE will resume in the beginning of the
|
|
# transaction (i.e., step back to the first relay log)
|
|
|
|
# The slave is started with max_binlog_size=16384 bytes,
|
|
# to force many rotations (approximately 30 rotations)
|
|
|
|
# We have to sync with master, to ensure slave had time to start properly
|
|
# before we stop it. If not, we get errors about UNIX_TIMESTAMP() in the log.
|
|
connection master;
|
|
sync_slave_with_master;
|
|
connection slave;
|
|
stop slave;
|
|
connection master;
|
|
--disable_warnings
|
|
eval create table t1 (a int) engine=$engine_type;
|
|
--enable_warnings
|
|
let $1=8000;
|
|
disable_query_log;
|
|
begin;
|
|
while ($1)
|
|
{
|
|
# eval means expand $ expressions
|
|
eval insert into t1 values( $1 );
|
|
dec $1;
|
|
}
|
|
commit;
|
|
# This will generate a 500kB master's binlog,
|
|
# which corresponds to 30 slave's relay logs.
|
|
enable_query_log;
|
|
save_master_pos;
|
|
connection slave;
|
|
reset slave;
|
|
start slave;
|
|
# We wait 1 sec for the SQL thread to be somewhere in
|
|
# the middle of the transaction, hopefully not in
|
|
# the first relay log, and hopefully before the COMMIT.
|
|
# Usually it stops when the SQL thread is around the 15th relay log.
|
|
# We cannot use MASTER_POS_WAIT() as master's position
|
|
# increases only when the slave executes the COMMIT.
|
|
# Note that except when using Valgrind, 1 second is enough for the I/O slave
|
|
# thread to fetch the whole master's binlog.
|
|
sleep 1;
|
|
stop slave;
|
|
# We suppose the SQL thread stopped before COMMIT.
|
|
# If so the transaction was rolled back
|
|
# and the table is now empty.
|
|
# Now restart
|
|
start slave;
|
|
# And see if the table contains '8000'
|
|
# which proves that the transaction restarted at
|
|
# the right place.
|
|
# We must wait for the transaction to commit before
|
|
# reading, with a sync_with_master.
|
|
sync_with_master;
|
|
select max(a) from t1;
|
|
connection master;
|
|
|
|
# The following DROP is a very important cleaning task:
|
|
# imagine the next test is run with --skip-innodb: it will do
|
|
# DROP TABLE IF EXISTS t1; but this will delete the frm and leave
|
|
# some data in the InnoDB datafile (because at that time mysqld
|
|
# does not know about InnoDB : --skip-innodb). So if later in the
|
|
# test suite a test wants to create an InnoDB table called t1, it
|
|
# will fail with
|
|
# InnoDB: Error: table t1 already exists in InnoDB internal
|
|
# InnoDB: data dictionary. Have you deleted the .frm file etc
|
|
drop table t1;
|
|
# wait until this drop is executed on slave
|
|
save_master_pos;
|
|
connection slave;
|
|
sync_with_master;
|
|
|
|
# End of 4.1 tests
|