• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

collections/H07-May-2022-736603

extra/H09-Nov-2021-37,72931,916

include/H09-Nov-2021-88,00775,470

lib/H09-Nov-2021-22,61814,662

r/H07-May-2022-1,295,1171,287,814

std_data/H07-May-2022-82,25381,914

suite/H09-Nov-2021-3,883,1873,676,464

t/H07-May-2022-294,118247,403

READMEH A D09-Nov-20212.7 KiB7349

README.gcovH A D09-Nov-2021655 1412

README.stressH A D09-Nov-20214.5 KiB12188

asan.suppH A D09-Nov-20211.2 KiB2723

lsan.suppH A D09-Nov-20211.2 KiB2725

mdl_lockup.shH A D09-Nov-2021562 2213

mtr.out-of-sourceH A D09-Nov-2021213 63

mysql-stress-test.plH A D09-Nov-202136.4 KiB1,248857

mysql-test-run.plH A D09-Nov-2021224 KiB7,8075,427

valgrind.suppH A D09-Nov-202131 KiB1,8861,727

README

1This directory contains a test suite for the MySQL daemon. To run
2the currently existing test cases, simply execute ./mysql-test-run in
3this directory. It will fire up the newly built mysqld and test it.
4
5Note that you do not have to have to do "make install", and you could
6actually have a co-existing MySQL installation. The tests will not
7conflict with it.
8
9All tests must pass. If one or more of them fail on your system, please
10read the following manual section for instructions on how to report the
11problem:
12
13http://dev.mysql.com/doc/mysql/en/mysql-test-suite.html
14
15If you want to use an already running MySQL server for specific tests,
16use the --extern option to mysql-test-run. Please note that in this mode,
17the test suite expects you to provide the names of the tests to run.
18For example, here is the command to run the "alias" and "analyze" tests
19with an external server:
20
21mysql-test-run --extern alias analyze
22
23To match your setup, you might also need to provide --socket, --user, and
24other relevant options.
25
26With no test cases named on the command line, mysql-test-run falls back
27to the normal "non-extern" behavior. The reason for this is that some
28tests cannot run with an external server.
29
30
31You can create your own test cases. To create a test case, create a new
32file in the t subdirectory using a text editor. The file should have a .test
33extension. For example:
34
35 xemacs t/test_case_name.test
36
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.
39
40 We would appreciate it if you name your test tables t1, t2, t3 ... (to not
41 conflict too much with existing tables).
42
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
45 and over again.
46
47 If you are using mysqltest commands (like result file names) in your
48 test case, you should create the result file as follows:
49
50 mysql-test-run --record test_case_name
51
52 or
53
54 mysqltest --record < t/test_case_name.test
55
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:
58
59 mysql-test-run --record test_case_name
60
61 mysql test < t/test_case_name.test > r/test_case_name.result
62
63 mysqltest --record --record-file=r/test_case_name.result < t/test_case_name.test
64
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.
69
70To submit your test case, put your .test file and .result file(s) into
71a tar.gz or zip archive, create a bug report at http://bugs.mysql.com/
72and attach the archive to the bug report.
73

README.gcov

1To be able to see the level of coverage with the current test suite,
2do the following:
3
4  - Make sure gcov is installed
5  - Compile the MySQL distribution with BUILD/compile-pentium-gcov (if your
6    machine does not have a pentium CPU, hack this script, or just live with
7	the pentium-specific stuff)
8  - In the mysql-test directory, run this command: ./mysql-test-run -gcov
9  - To see the level of coverage for a given source file:
10     grep source_file_name /tmp/gcov.out
11  - To see which lines are not yet covered, look at source_file_name.gcov in
12    the source tree. Then think hard about a test case that will cover those
13    lines, and write one!
14

README.stress

1
2Overview
3--------
4
5The stress script is designed to perform testing of the MySQL server in
6a multi-threaded environment.
7
8All functionality regarding stress testing is implemented in the
9mysql-stress-test.pl script.
10
11The stress script allows:
12
13 - To stress test the mysqltest binary test engine.
14 - To stress test the regular test suite and any additional test suites
15   (such as mysql-test-extra-5.0).
16 - To specify files with lists of tests both for initialization of
17   stress db and for further testing itself.
18 - To define the number of threads to be concurrently used in testing.
19 - To define limitations for the test run. such as the number of tests or
20   loops for execution or duration of testing, delay between test
21   executions, and so forth.
22 - To get a readable log file that can be used for identification of
23   errors that occur during testing.
24
25There are two ways to run the mysql-stress-test.pl script:
26
27 - For most cases, it is enough to use the options below for starting
28   the stress test from the mysql-test-run wrapper. In this case, the
29   server is run automatically, all preparation steps are performed,
30   and after that the stress test is started.
31
32 - In advanced case, you can run the mysql-stress-test.pl script directly.
33   But this requires that you perform some preparation steps and to specify
34   a bunch of options as well, so this invocation method may be a bit
35   complicated.
36
37Usage
38-----
39
40The following mysql-test-run options are specific to stress-testing:
41
42--stress
43  Enable stress mode
44
45--stress-suite=<suite name>
46  Test suite name to use in stress testing.  We assume that all suites
47  are located in the mysql-test/suite directory.
48  There is one special suite name - <main|default> that corresponds
49  to the regular test suite located in the mysql-test directory.
50
51--stress-threads=<number of threads>
52  The number of threads to use in stress testing.
53
54--stress-tests-file=<filename with list of tests>
55  The file that contains the list of tests (without .test suffix) to use in
56  stress testing. The default filename is stress_tests.txt and the default
57  location of this file is suite/<suite name>/stress_tests.txt
58
59--stress-init-file=<filename with list of tests>
60  The file that contains list of tests (without .test suffix) to use in
61  stress testing for initialization of the stress db. These tests will be
62  executed only once before starting the test itself. The default filename
63  is stress_init.txt and the default location of this file is
64  suite/<suite name>/stress_init.txt
65
66--stress-mode=<method which will be used for choosing tests from the list>
67  Possible values are: random(default), seq
68
69  There are two possible modes that affect the order of test selection
70  from the list:
71    - In random mode, tests are selected in random order
72    - In seq mode, each thread executes tests in a loop one by one in
73	  the order specified in the list file.
74
75--stress-test-count=<number>
76  Total number of tests that will be executed concurrently by all threads
77
78--stress-loop-count=<number>
79  Total number of loops in seq mode that will be executed concurrently
80  by all threads
81
82--stress-test-duration=<number>
83  Duration of stress testing in seconds
84
85Examples
86--------
87
881. Example of a simple command line to start a stress test:
89
90 mysql-test-run --stress alias
91
92Runs a stress test with default values for number of threads and number
93of tests, with test 'alias' from suite 'main'.
94
952. Using in stress testing tests from other suites:
96
97 - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
98                 --stress-suite=example  --stress-tests-file=testslist.txt
99
100   Runs a stress test with 10 threads, executes 1000 tests by all
101   threads, tests are used from suite 'example', the list of tests is
102   taken from file 'testslist.txt'
103
104 - mysql-test-run --stress --stress-threads=10 --stress-test-count=1000 \
105                  --stress-suite=example sum_distinct
106
107   Runs stress test with 10 threads, executes 1000 tests by all
108   threads, tests are used from suite 'example', the list of tests
109   contains only one test 'sum_distinct'
110
1113. Debugging of issues found with stress test
112
113 Right now, the stress test is not fully integrated in mysql-test-run
114 and does not support the --gdb option. To debug issues found with the
115 stress test, you must start the MySQL server separately under a debugger
116 and then run the stress test like this:
117
118 - mysql-test-run --extern --stress --stress-threads=10 \
119                  --stress-test-count=1000 --stress-suite=example \
120                  sum_distinct
121