1#
2# Test error checks on mysqld command line option parsing.
3#
4# Call mysqld with different invalid options, and check that it fails in each case.
5#
6# This means that a test failure results in mysqld starting up, which is only
7# caught when the test case times out. This is not ideal, but I did not find an
8# easy way to have the server shut down after a successful startup.
9#
10
11--source include/not_embedded.inc
12
13# mysqld refuses to run as root normally.
14-- source include/not_as_root.inc
15
16# We have not run (and do not need) bootstrap of the server. We just
17# give it a dummy data directory (for log files etc).
18
19mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
20
21
22--echo Test that unknown option is not silently ignored.
23--error 2
24--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --nonexistentoption >$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
25
26
27--echo Test bad binlog format.
28--error 1
29--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --log-bin --binlog-format=badformat >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
30
31
32--echo Test bad default storage engine.
33--error 1
34--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --default-storage-engine=nonexistentengine >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
35
36
37--echo Test non-numeric value passed to number option.
38--error 1
39--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables  --min-examined-row-limit=notanumber >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
40
41
42# Test for MBug#423035: error in parsing enum value for plugin
43# variable in mysqld command-line option.
44# See also Bug#32034.
45--echo Test that bad value for plugin enum option is rejected correctly.
46--error 7
47--exec $MYSQLD_BOOTSTRAP_CMD --skip-networking --datadir=$MYSQLTEST_VARDIR/tmp/mysqld_option_err --skip-grant-tables --plugin-dir=$MYSQLTEST_VARDIR/plugins --plugin-load=example=ha_example.so --plugin-example-enum-var=noexist >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
48
49#
50# Test that an wrong option with --help --verbose gives an error
51#
52
53--echo Test that --help --verbose works
54--exec $MYSQLD_BOOTSTRAP_CMD --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
55--echo Test that --not-known-option --help --verbose gives error
56--error 2
57--exec $MYSQLD_BOOTSTRAP_CMD --not-known-option --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
58
59rmdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;
60
61--echo Done.
62