1MYSQLTEST(1)                MariaDB 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 MariaDB 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 MariaDB servers for execution
26
27       ·   Can execute external shell commands
28
29       ·   Can test whether the result from an SQL statement or shell command
30           is 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 MariaDB is
36           compiled with support for libmysqld. (In this case, the executable
37           is named mysqltest_embedded rather than mysqltest.)
38
39       By default, mysqltest reads the test case on the standard input. To run
40       mysqltest this way, you normally invoke it like this:
41
42           shell> mysqltest [options] [db_name] < test_file
43
44       You can also name the test case file with a --test-file=file_name
45       option.
46
47       The exit value from mysqltest is 0 for success, 1 for failure, and 62
48       if it skips the test case (for example, if after checking some
49       preconditions it decides not to run the test).
50
51       mysqltest supports the following options:
52
53       ·   --help, -?
54
55           Display a help message and exit.
56
57       ·   --basedir=dir_name, -b dir_name
58
59           The base directory for tests.
60
61       ·   --character-sets-dir=path
62
63           The directory where character sets are installed.
64
65       ·   --compress, -C
66
67           Compress all information sent between the client and the server if
68           both support compression.
69
70       ·   --connect-timeout=num
71
72           This can be used to set the MYSQL_OPT_CONNECT_TIMEOUT parameter of
73           mysql_options to change the number of seconds before an
74           unsuccessful connection attempt times out.
75
76       ·   --continue-on-error
77
78           Continue test even if we got an error. This is mostly useful when
79           testing a storage engine to see what from a test file it can
80           execute, or to find all syntax errors in a newly created big test
81           file.
82
83       ·   --cursor-protocol
84
85           Use cursors for prepared statements.
86
87       ·   --database=db_name, -D db_name
88
89           The default database to use.
90
91       ·   --debug[=debug_options], -#[debug_options]
92
93           Write a debugging log if MariaDB is built with debugging support.
94           The default debug_options value is
95           ´d:t:S:i:O,/tmp/mysqltest.trace´.
96
97       ·   --debug-check
98
99           Print some debugging information when the program exits.
100
101       ·   --debug-info
102
103           Print debugging information and memory and CPU usage statistics
104           when the program exits.
105
106       ·   --host=host_name, -h host_name
107
108           Connect to the MariaDB server on the given host.
109
110       ·   --logdir=dir_name
111
112           The directory to use for log files.
113
114       ·   --mark-progress
115
116           Write the line number and elapsed time to test_file.progress.
117
118       ·   --max-connect-retries=num
119
120           The maximum number of connection attempts when connecting to
121           server.
122
123       ·   --max-connections=num
124
125           The maximum number of simultaneous server connections per client
126           (that is, per test). If not set, the maximum is 128. Minimum
127           allowed limit is 8, maximum is 5120.
128
129       ·   --no-defaults
130
131           Do not read default options from any option files. If used, this
132           must be the first option.
133
134       ·   --non-blocking-api
135
136           Use the non-blocking client API for communication.
137
138       ·   --overlay-dir=dir_name
139
140           Overlay directory.
141
142       ·   --password[=password], -p[password]
143
144           The password to use when connecting to the server. If you use the
145           short option form (-p), you cannot have a space between the option
146           and the password. If you omit the password value following the
147           --password or -p option on the command line, you are prompted for
148           one.
149
150       ·   --plugin-dir=dir_name
151
152           Directory for client-side plugins.
153
154       ·   --port=port_num, -P port_num
155
156           The TCP/IP port number to use for the connection or 0 for default
157           to, in order of preference, my.cnf, $MYSQL_TCP_PORT, /etc/services,
158           built-in default (3306).
159
160       ·   --prologue=name
161
162           Include the contents of the given file before processing the
163           contents of the test file. The included file should have the same
164           format as other mysqltest test files. This option has the same
165           effect as putting a --source file_name command as the first line of
166           the test file.
167
168       ·   --protocol={TCP|SOCKET|PIPE|MEMORY}
169
170           The connection protocol to use for connecting to the server. It is
171           useful when the other connection parameters normally would cause a
172           protocol to be used other than the one you want.
173
174       ·   --ps-protocol
175
176           Use the prepared-statement protocol for communication.
177
178       ·   --quiet
179
180           Suppress all normal output. This is a synonym for --silent.
181
182       ·   --record, -r
183
184           Record the output that results from running the test file into the
185           file named by the --result-file option, if that option is given. It
186           is an error to use this option without also using --result-file.
187
188       ·   --result-file=file_name, -R file_name
189
190           This option specifies the file for test case expected results.
191           --result-file, together with --record, determines how mysqltest
192           treats the test actual and expected results for a test case:
193
194           ·   If the test produces no results, mysqltest exits with an error
195               message to that effect, unless --result-file is given and the
196               named file is an empty file.
197
198           ·   Otherwise, if --result-file is not given, mysqltest sends test
199               results to the standard output.
200
201           ·   With --result-file but not --record, mysqltest reads the
202               expected results from the given file and compares them with the
203               actual results. If the results do not match, mysqltest writes a
204               .reject file in the same directory as the result file, outputs
205               a diff of the two files, and exits with an error.
206
207           ·   With both --result-file and --record, mysqltest updates the
208               given file by writing the actual test results to it.
209
210       ·   --result-format-version=#
211
212           Version of the result file format to use.
213
214       ·   --server-arg=value, -A value
215
216           Pass the argument as an argument to the embedded server. For
217           example, --server-arg=--tmpdir=/tmp or --server-arg=--core. Up to
218           64 arguments can be given.
219
220       ·   --server-file=file_name, -F file_name
221
222           Read arguments for the embedded server from the given file. The
223           file should contain one argument per line.
224
225       ·   --silent, -s
226
227           Suppress all normal output.
228
229       ·   --sleep=num, -T num
230
231           Cause all sleep commands in the test case file to sleep num
232           seconds. This option does not affect real_sleep commands.
233
234           An option value of 0 can be used, which effectively disables sleep
235           commands in the test case.
236
237       ·   --socket=path, -S path
238
239           The socket file to use when connecting to localhost (which is the
240           default host).
241
242       ·   --sp-protocol
243
244           Execute DML statements within a stored procedure. For every DML
245           statement, mysqltest creates and invokes a stored procedure that
246           executes the statement rather than executing the statement
247           directly.
248
249       ·   --ssl
250
251           Enable SSL for connection (automatically enabled with other flags).
252           Disable with --skip-ssl.
253
254       ·   --ssl-ca=name
255
256           CA file in PEM format (check OpenSSL docs, implies --ssl).
257
258       ·   --ssl-capath=name
259
260           CA directory (check OpenSSL docs, implies --ssl).
261
262       ·   --ssl-cert=name
263
264           X509 cert in PEM format (check OpenSSL docs, implies --ssl).
265
266       ·   --ssl-cipher=name
267
268           SSL cipher to use (check OpenSSL docs, implies --ssl).
269
270       ·   --ssl-key=name
271
272           X509 key in PEM format (check OpenSSL docs, implies --ssl).
273
274       ·   --ssl-crl=name
275
276           Certificate revocation list (check OpenSSL docs, implies --ssl).
277
278       ·   --ssl-crlpath=name
279
280           Certificate revocation list path (check OpenSSL docs, implies
281           --ssl).
282
283       ·   --ssl-verify-server-cert
284
285           Verify server's "Common Name" in its cert against hostname used
286           when connecting. This option is disabled by default.
287
288       ·   --suite-dir=dir_name
289
290           Suite directory.
291
292       ·   --tail-lines=nn
293
294           Specify how many lines of the result to include in the output if
295           the test fails because an SQL statement fails. The default is 0,
296           meaning no lines of result printed.
297
298       ·   --test-file=file_name, -x file_name
299
300           Read test input from this file. The default is to read from the
301           standard input.
302
303       ·   --timer-file=file_name, -m file_name
304
305           If given, the number of microseconds spent running the test will be
306           written to this file. This is used by mysql-test-run.pl for its
307           reporting.
308
309       ·   --tmpdir=dir_name, -t dir_name
310
311           The temporary directory where socket files are created.
312
313       ·   --user=user_name, -u user_name
314
315           The MariaDB user name to use when connecting to the server.
316
317       ·   --verbose, -v
318
319           Verbose mode. Print out more information about what the program
320           does.
321
322       ·   --version, -V
323
324           Display version information and exit.
325
326       ·   --view-protocol
327
328           Every SELECT statement is wrapped inside a view.
329
331       Copyright © 2007, 2010, Oracle and/or its affiliates, 2010-2015 MariaDB
332       Foundation
333
334       This documentation is free software; you can redistribute it and/or
335       modify it only under the terms of the GNU General Public License as
336       published by the Free Software Foundation; version 2 of the License.
337
338       This documentation is distributed in the hope that it will be useful,
339       but WITHOUT ANY WARRANTY; without even the implied warranty of
340       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
341       General Public License for more details.
342
343       You should have received a copy of the GNU General Public License along
344       with the program; if not, write to the Free Software Foundation, Inc.,
345       51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
346       http://www.gnu.org/licenses/.
347
348

SEE ALSO

350       For more information, please refer to the MariaDB Knowledge Base,
351       available online at https://mariadb.com/kb/
352

AUTHOR

354       MariaDB Foundation (http://www.mariadb.org/).
355
356
357
358MariaDB 10.3                      9 May 2017                      MYSQLTEST(1)
Impressum