Back to home page

MySQL Cross Reference



0001 This directory contains a test suite for the MySQL daemon. To run
0002 the currently existing test cases, simply execute ./mysql-test-run in
0003 this directory. It will fire up the newly built mysqld and test it.
0005 Note that you do not have to have to do "make install", and you could
0006 actually have a co-existing MySQL installation. The tests will not
0007 conflict with it.
0009 All tests must pass. If one or more of them fail on your system, please
0010 read the following manual section for instructions on how to report the
0011 problem:
0015 If you want to use an already running MySQL server for specific tests,
0016 use the --extern option to mysql-test-run. Please note that in this mode,
0017 the test suite expects you to provide the names of the tests to run.
0018 For example, here is the command to run the "alias" and "analyze" tests
0019 with an external server:
0021 mysql-test-run --extern alias analyze
0023 To match your setup, you might also need to provide --socket, --user, and
0024 other relevant options.
0026 With no test cases named on the command line, mysql-test-run falls back
0027 to the normal "non-extern" behavior. The reason for this is that some
0028 tests cannot run with an external server.
0031 You can create your own test cases. To create a test case, create a new
0032 file in the t subdirectory using a text editor. The file should have a .test
0033 extension. For example:
0035  xemacs t/test_case_name.test
0037  In the file, put a set of SQL statements that create some tables,
0038  load test data, and run some queries to manipulate it.
0040  We would appreciate it if you name your test tables t1, t2, t3 ... (to not
0041  conflict too much with existing tables).
0043  Your test should begin by dropping the tables you are going to create and
0044  end by dropping them again.  This ensures that you can run the test over
0045  and over again.
0047  If you are using mysqltest commands (like result file names) in your
0048  test case, you should create the result file as follows:
0050  mysql-test-run --record test_case_name
0052  or
0054  mysqltest --record < t/test_case_name.test
0056  If you only have a simple test cases consisting of SQL statements and
0057  comments, you can create the test case in one of the following ways:
0059  mysql-test-run --record test_case_name
0061  mysql test < t/test_case_name.test > r/test_case_name.result
0063  mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test
0065  When this is done, take a look at r/test_case_name.result
0066  - If the result is incorrect, you have found a bug. In this case, you should
0067    edit the test result to the correct results so that we can verify
0068    that the bug is corrected in future releases.
0070 To submit your test case, put your .test file and .result file(s) into
0071 a tar.gz archive, add a README that explains the problem, ftp the 
0072 archive to and send a mail
0073 to