If you are writing a replication test case, the first line
of the test file should be source
include/master-slave.inc;. To switch between
master and slave, use connection master;
and connection slave;. If you need to do
something on an alternative connection, you can do
connection master1; for the master, and
connection slave1; for the slave.
If you need to do something in a loop, you can use something
like this:
let $1=1000;
while ($1)
{
# execute your statements here
dec $1;
}
To sleep between statements, use the
sleep command. It supports fractions of a
second. For example, sleep 1.3; sleeps
1.3 seconds. Try not to use sleep or
real_sleep commands more than necessary.
The more of them there are, the slower the test suite
becomes.
To run the slave with additional options for your test case,
put them in the command-line format in
mysql-test/t/test_name-slave.opt.
For the master, put them in
mysql-test/t/test_name-master.opt.
Some test cases depend on being run on local storage, and
may fail when run on remote storage such as a network share.
For example, if the test result can be affected by
differences between local and remote filesystem times, the
expected result might not be obtained. Failure of these test
cases under such circumstances does not indicate an actual
malfunction. It is not generally possible to determine
whether tests are being run on local storage.