1MYSQLTEST(1) MySQL Database System MYSQLTEST(1)
2
3
4
6 mysqltest - program to run test cases
7 mysqltest_embedded - program to run embedded test cases
8
10 mysqltest [options] [db_name]
11
12 mysqltest_embedded [options] [db_name]
13
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 using 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 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 MySQL is compiled
36 with support for libmysqld. (In this case, the executable is named
37 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 · --cursor-protocol
71
72 Use cursors for prepared statements.
73
74 · --database=db_name, -D db_name
75
76 The default database to use.
77
78 · --debug[=debug_options], -#[debug_options]
79
80 Write a debugging log if MySQL is built with debugging support. The
81 default debug_options value is 'd:t:S:i:O,/tmp/mysqltest.trace'.
82
83 · --debug-check
84
85 Print some debugging information when the program exits.
86
87 · --debug-info
88
89 Print debugging information and memory and CPU usage statistics
90 when the program exits.
91
92 · --host=host_name, -h host_name
93
94 Connect to the MySQL server on the given host.
95
96 · --include=file_name, -i file_name
97
98 Include the contents of the given file before processing the
99 contents of the test file. The included file should have the same
100 format as other mysqltest test files. This option has the same
101 effect as putting a --source file_name command as the first line of
102 the test file.
103
104 · --logdir=dir_name
105
106 The directory to use for log files.
107
108 · --mark-progress
109
110 Write the line number and elapsed time to test_file.progress.
111
112 · --max-connect-retries=num
113
114 The maximum number of connection attempts when connecting to
115 server.
116
117 · --max-connections=num
118
119 The maximum number of simultaneous server connections per client
120 (that is, per test). If not set, the maximum is 128. Minimum
121 allowed limit is 8, maximum is 5120.
122
123 This option is available from MySQL 5.1.45.
124
125 · --no-defaults
126
127 Do not read default options from any option files. If used, this
128 must be the first option.
129
130 · --plugin-dir=path
131
132 The directory in which to look for plugins. It may be necessary to
133 specify this option if the default_auth argument is used for the
134 connect() command to specify an authentication plugin but mysqltest
135 does not find it. This option was added in MySQL 5.5.7.
136
137 · --password[=password], -p[password]
138
139 The password to use when connecting to the server. If you use the
140 short option form (-p), you cannot have a space between the option
141 and the password. If you omit the password value following the
142 --password or -p option on the command line, you are prompted for
143 one.
144
145 · --port=port_num, -P port_num
146
147 The TCP/IP port number to use for the connection.
148
149 · --protocol={TCP|SOCKET|PIPE|MEMORY}
150
151 Choose the protocol for communication with the server. SOCKET is
152 default.
153
154 The --protocol option is available from MySQL 5.1.51. It is ignored
155 if running with the embedded server.
156
157 · --ps-protocol
158
159 Use the prepared-statement protocol for communication.
160
161 · --quiet
162
163 Suppress all normal output. This is a synonym for --silent.
164
165 · --record, -r
166
167 Record the output that results from running the test file into the
168 file named by the --result-file option, if that option is given. It
169 is an error to use this option without also using --result-file.
170
171 · --result-file=file_name, -R file_name
172
173 This option specifies the file for test case expected results.
174 --result-file, together with --record, determines how mysqltest
175 treats the test actual and expected results for a test case:
176
177 · If the test produces no results, mysqltest exits with an error
178 message to that effect, unless --result-file is given and the
179 named file is an empty file.
180
181 · Otherwise, if --result-file is not given, mysqltest sends test
182 results to the standard output.
183
184 · With --result-file but not --record, mysqltest reads the
185 expected results from the given file and compares them with the
186 actual results. If the results do not match, mysqltest writes a
187 .reject file in the same directory as the result file, outputs
188 a diff of the two files, and exits with an error.
189
190 · With both --result-file and --record, mysqltest updates the
191 given file by writing the actual test results to it.
192
193 · --server-arg=value, -A value
194
195 Pass the argument as an argument to the embedded server. For
196 example, --server-arg=--tmpdir=/tmp or --server-arg=--core. Up to
197 64 arguments can be given.
198
199 · --server-file=file_name, -F file_name
200
201 Read arguments for the embedded server from the given file. The
202 file should contain one argument per line.
203
204 · --server-public-key-path=file_name
205
206 The path name to a file containing the server RSA public key. The
207 file must be in PEM format. The public key is used for RSA
208 encryption of the client password for connections to the server
209 made using accounts that authenticate with the sha256_password
210 plugin. This option is ignored for client accounts that do not
211 authenticate with that plugin. It is also ignored if password
212 encryption is not needed, as is the case when the client connects
213 to the server using an SSL connection.
214
215 The server sends the public key to the client as needed, so it is
216 not necessary to use this option for RSA password encryption to
217 occur. It is more efficient to do so because then the server need
218 not send the key.
219
220 For additional discussion regarding use of the sha256_password
221 plugin, including how to get the RSA public key, see The SHA-256
222 Authentication Plugin[1].
223
224 This option is available only if MySQL was built using OpenSSL. It
225 was added in MySQL 5.6.6 under the name --server-public-key and
226 renamed in 5.6.7 to --server-public-key-path.
227
228 · --silent, -s
229
230 Suppress all normal output.
231
232 · --skip-safemalloc
233
234 Do not use memory allocation checking.
235
236 · --sleep=num, -T num
237
238 Cause all sleep commands in the test case file to sleep num
239 seconds. This option does not affect real_sleep commands.
240
241 As of MySQL 5.0.23, an option value of 0 can be used, which
242 effectively disables sleep commands in the test case.
243
244 · --socket=path, -S path
245
246 The socket file to use when connecting to localhost (which is the
247 default host).
248
249 · --sp-protocol
250
251 Execute DML statements within a stored procedure. For every DML
252 statement, mysqltest creates and invokes a stored procedure that
253 executes the statement rather than executing the statement
254 directly.
255
256 · --tail-lines=nn
257
258 Specify how many lines of the result to include in the output if
259 the test fails because an SQL statement fails. The default is 0,
260 meaning no lines of result printed.
261
262 · --test-file=file_name, -x file_name
263
264 Read test input from this file. The default is to read from the
265 standard input.
266
267 · --timer-file=file_name, -m file_name
268
269 If given, the number of millisecond spent running the test will be
270 written to this file. This is used by mysql-test-run.pl for its
271 reporting.
272
273 · --tmpdir=dir_name, -t dir_name
274
275 The temporary directory where socket files are created.
276
277 · --user=user_name, -u user_name
278
279 The MySQL user name to use when connecting to the server.
280
281 · --verbose, -v
282
283 Verbose mode. Print out more information about what the program
284 does.
285
286 · --version, -V
287
288 Display version information and exit.
289
290 · --view-protocol
291
292 Every SELECT statement is wrapped inside a view. This option was
293 added in MySQL 5.0.19.
294
296 Copyright © 2006, 2013, Oracle and/or its affiliates. All rights
297 reserved.
298
299 This documentation is free software; you can redistribute it and/or
300 modify it only under the terms of the GNU General Public License as
301 published by the Free Software Foundation; version 2 of the License.
302
303 This documentation is distributed in the hope that it will be useful,
304 but WITHOUT ANY WARRANTY; without even the implied warranty of
305 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
306 General Public License for more details.
307
308 You should have received a copy of the GNU General Public License along
309 with the program; if not, write to the Free Software Foundation, Inc.,
310 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see
311 http://www.gnu.org/licenses/.
312
313
315 1. The SHA-256 Authentication Plugin
316 http://dev.mysql.com/doc/refman/5.6/en/sha256-authentication-plugin.html
317
319 For more information, please refer to the MySQL Reference Manual, which
320 may already be installed locally and which is also available online at
321 http://dev.mysql.com/doc/.
322
324 Oracle Corporation (http://dev.mysql.com/).
325
326
327
328MySQL 11/04/2013 MYSQLTEST(1)