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

..03-May-2022-

collections/H10-Feb-2022-1,1291,086

include/H10-Feb-2022-54,77349,063

lib/H10-Feb-2022-18,50711,904

main/H07-May-2022-1,302,0151,235,091

std_data/H07-May-2022-9,9448,705

suite/H10-Feb-2022-3,402,9063,217,962

READMEH A D10-Feb-20224.1 KiB10473

README-gcovH A D10-Feb-2022766 1614

README.stressH A D10-Feb-20224.5 KiB12188

asan.suppH A D10-Feb-202220 21

dgcov.plH A D10-Feb-20225.5 KiB201154

lsan.suppH A D10-Feb-2022435 1815

mtr.out-of-sourceH A D10-Feb-2022217 63

mysql-stress-test.plH A D10-Feb-202236 KiB1,242857

mysql-test-run.plH A D10-Feb-2022174.3 KiB5,9024,200

purify.suppH A D10-Feb-20221.4 KiB2927

suite.pmH A D10-Feb-20223.1 KiB8957

unstable-testsH A D10-Feb-202255 KiB859751

valgrind.suppH A D10-Feb-202235.3 KiB1,8151,618

README

1This directory contains test suites for the MariaDB server. To run
2currently existing test cases, execute ./mysql-test-run in this directory.
3
4Some tests are known to fail on some platforms or be otherwise unreliable.
5The file "unstable-tests" contains the list of such tests along with
6a comment for every test.
7To exclude them from the test run, execute
8  # ./mysql-test-run --skip-test-list=unstable-tests
9
10In general you do not have to have to do "make install", and you can have
11a co-existing MariaDB installation, the tests will not conflict with it.
12To run the tests in a source directory, you must do "make" first.
13
14In Red Hat distributions, you should run the script as user "mysql".
15The user is created with nologin shell, so the best bet is something like
16  # su -
17  # cd /usr/share/mysql-test
18  # su -s /bin/bash mysql -c "./mysql-test-run --skip-test-list=unstable-tests"
19
20This will use the installed MariaDB executables, but will run a private
21copy of the server process (using data files within /usr/share/mysql-test),
22so you need not start the mysqld service beforehand.
23
24You can omit --skip-test-list option if you want to check whether
25the listed failures occur for you.
26
27To clean up afterwards, remove the created "var" subdirectory, e.g.
28  # su -s /bin/bash - mysql -c "rm -rf /usr/share/mysql-test/var"
29
30If one or more tests fail on your system on reasons other than listed
31in lists of unstable tests, please read the following manual section
32for instructions on how to report the problem:
33
34https://mariadb.com/kb/en/reporting-bugs
35
36If you want to use an already running MySQL server for specific tests,
37use the --extern option to mysql-test-run. Please note that in this mode,
38you are expected to provide names of the tests to run.
39
40For example, here is the command to run the "alias" and "analyze" tests
41with an external server:
42
43  # mysql-test-run --extern socket=/tmp/mysql.sock alias analyze
44
45To match your setup, you might need to provide other relevant options.
46
47With no test names on the command line, mysql-test-run will attempt
48to execute the default set of tests, which will certainly fail, because
49many tests cannot run with an external server (they need to control the
50options with which the server is started, restart the server during
51execution, etc.)
52
53You can create your own test cases. To create a test case, create a new
54file in the main subdirectory using a text editor. The file should have a .test
55extension. For example:
56
57  # xemacs t/test_case_name.test
58
59In the file, put a set of SQL statements that create some tables,
60load test data, and run some queries to manipulate it.
61
62Your test should begin by dropping the tables you are going to create and
63end by dropping them again. This ensures that you can run the test over
64and over again.
65
66If you are using mysqltest commands in your test case, you should create
67the result file as follows:
68
69  # mysql-test-run --record test_case_name
70
71  or
72
73  # mysqltest --record < t/test_case_name.test
74
75If you only have a simple test case consisting of SQL statements and
76comments, you can create the result file in one of the following ways:
77
78  # mysql-test-run --record test_case_name
79
80  # mysql test < t/test_case_name.test > r/test_case_name.result
81
82  # mysqltest --record --database test --result-file=r/test_case_name.result < t/test_case_name.test
83
84When this is done, take a look at r/test_case_name.result.
85If the result is incorrect, you have found a bug. In this case, you should
86edit the test result to the correct results so that we can verify that
87the bug is corrected in future releases.
88
89If you want to submit your test case you can send it
90to maria-developers@lists.launchpad.net or attach it to a bug report on
91https://mariadb.org/jira/.
92
93If the test case is really big or if it contains 'not public' data,
94then put your .test file and .result file(s) into a tar.gz archive,
95add a README that explains the problem, ftp the archive to
96ftp://ftp.askmonty.org/private and submit a report to
97https://mariadb.org/jira about it.
98
99The latest information about mysql-test-run can be found at:
100https://mariadb.com/kb/en/mariadb/mysqltest/
101
102If you want to create .rdiff files, check
103https://mariadb.com/kb/en/mariadb/mysql-test-auxiliary-files/
104

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-pentium64-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 -1 source_file_name ../mysql-test-gcov.msg
11  - To see which lines are not yet covered, look at source_file_name.gcov in
12    the source tree.  You can find this by doing something like:
13    find source-directory -name "mysqld.cc.gcov"
14    Then think hard about a test case that will cover those lines, and write
15    one!
16

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