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