MYSQLTEST(1) MySQL Database System MYSQLTEST(1)

2
3
4

NAME

6       mysqltest - program to run test cases
7       mysqltest_embedded - program to run embedded test cases
8

SYNOPSIS

10       mysqltest [options] [db_name]
11
12       mysqltest_embedded [options] [db_name]
13

DESCRIPTION

15       The mysqltest program runs a test case against a MySQL server and
16       optionally compares the output with a result file. This program reads
17       input written in a special test language. Typically, you invoke
18       mysqltest via mysql-test-run.pl rather than invoking it directly.
19
20       mysqltest_embedded is similar but is built with support for the
21       libmysqld embedded server.
22
23       Features of mysqltest:
24
25       ·  Can send SQL statements to MySQL servers for execution
26
27       ·  Can execute external shell commands
28
29       ·  Can test whether the result from a SQL statement or shell command is
30          as expected
31
32       ·  Can connect to one or more standalone mysqld servers and switch
33          between connections
34
35       ·  Can connect to an embedded server (libmysqld), if MySQL is compiled
36          with support for libmysqld. (In this case, the executable is named
37          mysqltest_embedded rather than mysqltest.)
38
39
40By default, mysqltest reads the test case on the standard input. To run

mysqltest this way, you normally invoke it like this:

42
43   shell> mysqltest [options] [db_name] < test_file
44
45You can also name the test case file with a --test-file=file_name option.
46

mysqltest supports the following options:

48
49·  --help, -?
50
51   Display a help message and exit.
52
53·  --basedir=dir_name, -b dir_name
54
55   The base directory for tests.
56
57·  --big-test, -B
58
59   Define the mysqltest variable $BIG_TEST as 1.
60
61·  --character-sets-dir=path
62
63   The directory where character sets are installed. This option was added in
64   MySQL 4.1.23, 5.0.32, and 5.1.14.
65
66·  --compress, -C
67
68   Compress all information sent between the client and the server if both
69   support compression.
70
71·  --cursor-protocol
72
73   Use cursors for prepared statements (implies --ps-protocol). This option
74   was added in MySQL 5.0.19.
75
76·  --database=db_name, -D db_name
77
78   The default database to use.
79
80·  --debug[=debug_options], -#[debug_options]
81
82   Write a debugging log if MySQL is built with debugging support. The default
83   debug_options value is ´d:t:S:i:O,/tmp/mysqltest.trace'.
84
85·  --debug-info
86
87   Print some debugging information when the program exits. This option was
88   added in MySQL 5.1.14.
89
90·  --host=host_name, -h host_name
91
92   Connect to the MySQL server on the given host.
93
94·  --include=file_name, -i file_name
95
96   Include the contents of the given file before processing the contents of
97   the test file. The included file should have the same format as other
98   mysqltest test files. This option has the same effect as putting a --source
99   file_name command as the first line of the test file. This option was added
100   in MySQL 5.1.7.
101
102·  --logdir=dir_name
103
104   The directory to use for log files. This option was added in MySQL 5.1.14.
105
106·  --mark-progress
107
108   Write the line number and elapsed time to test_file.progress. This option
109   was added in MySQL 4.1.23, 5.0.32, and 5.1.12.
110
111·  --max-connect-retries=num
112
113   The maximum number of connection attempts when connecting to server. This
114   option was added in MySQL 4.1.23, 5.0.23, and 5.1.11.
115
116·  --no-defaults
117
118   Do not read default options from any option files.
119
120·  --password[=password], -p[password]
121
122   The password to use when connecting to the server. If you use the short
123   option form (-p), you cannot have a space between the option and the
124   password. If you omit the password value following the --password or -p
125   option on the command line, you are prompted for one.
126
127·  --port=port_num, -P port_num
128
129   The TCP/IP port number to use for the connection.
130
131·  --ps-protocol
132
133   Use the prepared-statement protocol for communication.
134
135·  --quiet
136
137   Suppress all normal output. This is a synonym for --silent.
138
139·  --record, -r
140
141   Record the output that results from running the test file into the file
142   named by the --result-file option, if that option is given.
143
144·  --result-file=file_name, -R file_name
145
146   This option specifies the file for test case expected results.
147   --result-file, together with --record, determines how mysqltest treats the
148   test actual and expected results for a test case:
149
150   ·  If the test produces no results, mysqltest exits with an error message
151      to that effect.
152
153   ·  Otherwise, if --result-file is not given, mysqltest sends test results
154      to the standard output.
155
156   ·  With --result-file but not --record, mysqltest reads the expected
157      results from the given file and compares them with the actual results.
158      If the results do not match, mysqltest writes a .reject file in the same
159      directory as the result file and exits with an error.
160
161   ·  With both --result-file and --record, mysqltest updates the given file
162      by writing the actual test results to it.
163
164·  --server-arg=value, -A value
165
166   Pass the argument as an argument to the embedded server. For example,
167   --server-arg=--tmpdir=/tmp or --server-arg=--core. Up to 64 arguments can
168   be given.
169
170·  --server-file=file_name, -F file_name
171
172   Read arguments for the embedded server from the given file. The file should
173   contain one argument per line.
174
175·  --silent, -s
176
177   Suppress all normal output.
178
179·  --skip-safemalloc
180
181   Do not use memory allocation checking.
182
183·  --sleep=num, -T num
184
185   Cause all sleep commands in the test case file to sleep num seconds. This
186   option does not affect real_sleep commands.
187
188   As of MySQL 5.0.23, an option value of 0 can be used, which effectively
189   disables sleep commands in the test case.
190
191·  --socket=path, -S path
192
193   The socket file to use when connecting to localhost (which is the default
194   host).
195
196·  --sp-protocol
197
198   Execute DML statements within a stored procedure. For every DML statement,
199   mysqltest creates and invokes a stored procedure that executes the
200   statement rather than executing the statement directly. This option was
201   added in MySQL 5.0.19.
202
203·  --test-file=file_name, -x file_name
204
205   Read test input from this file. The default is to read from the standard
206   input.
207
208·  --timer-file=file_name, -m file_name
209
210   The file where the timing in microseconds is written.
211
212·  --tmpdir=dir_name, -t dir_name
213
214   The temporary directory where socket files are put.
215
216·  --user=user_name, -u user_name
217
218   The MySQL username to use when connecting to the server.
219
220·  --verbose, -v
221
222   Verbose mode. Print out more information what the program does.
223
224·  --version, -V
225
226   Display version information and exit.
227
228·  --view-protocol
229
230   Every SELECT statement is wrapped inside a view. This option was added in
231   MySQL 5.0.19.
232
234       Copyright 2006-2007 MySQL AB
235
236       This documentation is NOT distributed under a GPL license. Use of this
237       documentation is subject to the following terms: You may create a
238       printed copy of this documentation solely for your own personal use.
239       Conversion to other formats is allowed as long as the actual content is
240       not altered or edited in any way. You shall not publish or distribute
241       this documentation in any form or on any media, except if you
242       distribute the documentation in a manner similar to how MySQL
243       disseminates it (that is, electronically for download on a Web site
244       with the software) or on a CD-ROM or similar medium, provided however
245       that the documentation is disseminated together with the software on
246       the same medium. Any other use, such as any dissemination of printed
247       copies or use of this documentation, in whole or in part, in another
248       publication, requires the prior written consent from an authorized
249       representative of MySQL AB. MySQL AB reserves any and all rights to
250       this documentation not expressly granted above.
251
252       Please email <docs@mysql.com> for more information or if you are
253       interested in doing a translation.
254

SEE ALSO

256       For more information, please refer to the MySQL Reference Manual, which
257       may already be installed locally and which is also available online at
258       http://dev.mysql.com/doc/.
259

AUTHOR

261       MySQL AB (http://www.mysql.com/).  This software comes with no
262       warranty.
263
264
265
266MySQL                             06/19/2007                      MYSQLTEST(1)
Impressum