1
This directory contains a test suite for the MySQL daemon. To run
2
the currently existing test cases, simply execute ./mysql-test-run in
3
this directory. It will fire up the newly built mysqld and test it.
5
Note that you do not have to have to do "make install", and you could
6
actually have a co-existing MySQL installation. The tests will not
9
All tests must pass. If one or more of them fail on your system, please
10
read the following manual section for instructions on how to report the
13
http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
15
If you want to use an already running MySQL server for specific tests,
16
use the --extern option to mysql-test-run. Please note that in this mode,
17
the test suite expects you to provide the names of the tests to run.
18
For example, here is the command to run the "alias" and "analyze" tests
19
with an external server:
21
mysql-test-run --extern alias analyze
23
To match your setup, you might also need to provide --socket, --user, and
24
other relevant options.
26
With no test cases named on the command line, mysql-test-run falls back
27
to the normal "non-extern" behavior. The reason for this is that some
28
tests cannot run with an external server.
31
You can create your own test cases. To create a test case, create a new
32
file in the t subdirectory using a text editor. The file should have a .test
33
extension. For example:
35
xemacs t/test_case_name.test
37
In the file, put a set of SQL statements that create some tables,
38
load test data, and run some queries to manipulate it.
40
We would appreciate it if you name your test tables t1, t2, t3 ... (to not
41
conflict too much with existing tables).
43
Your test should begin by dropping the tables you are going to create and
44
end by dropping them again. This ensures that you can run the test over
47
If you are using mysqltest commands (like result file names) in your
48
test case, you should create the result file as follows:
50
mysql-test-run --record test_case_name
54
mysqltest --record < t/test_case_name.test
56
If you only have a simple test cases consisting of SQL statements and
57
comments, you can create the test case in one of the following ways:
59
mysql-test-run --record test_case_name
61
mysql test < t/test_case_name.test > r/test_case_name.result
63
mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test
65
When this is done, take a look at r/test_case_name.result
66
- If the result is incorrect, you have found a bug. In this case, you should
67
edit the test result to the correct results so that we can verify
68
that the bug is corrected in future releases.
70
To submit your test case, put your .test file and .result file(s) into
71
a tar.gz archive, add a README that explains the problem, ftp the
72
archive to ftp://support.mysql.com/pub/mysql/secret/ and send a mail
73
to bugs@lists.mysql.com