summaryrefslogtreecommitdiff
path: root/mysql-test/t/mysqld_option_err.test
blob: 0c38eba7ca923412acb2d8ddcd449a6520567875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#
# Test error checks on mysqld command line option parsing.
#
# Call mysqld with different invalid options, and check that it fails in each case.
#
# This means that a test failure results in mysqld starting up, which is only
# caught when the test case times out. This is not ideal, but I did not find an
# easy way to have the server shut down after a successful startup.
#

--source include/not_embedded.inc

# mysqld refuses to run as root normally.
-- source include/not_as_root.inc

# We have not run (and do not need) bootstrap of the server. We just
# give it a dummy data directory (for log files etc).

mkdir $MYSQLTEST_VARDIR/tmp/mysqld_option_err;


--echo Test that unknown option is not silently ignored.
--error 2
--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


--echo Test bad binlog format.
--error 1
--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


--echo Test bad default storage engine.
--error 1
--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


--echo Test non-numeric value passed to number option.
--error 1
--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


# Test for MBug#423035: error in parsing enum value for plugin
# variable in mysqld command-line option.
# See also Bug#32034.
--echo Test that bad value for plugin enum option is rejected correctly.
--error 7
--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

#
# Test that an wrong option with --help --verbose gives an error
#

--echo Test that --help --verbose works
--exec $MYSQLD_BOOTSTRAP_CMD --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1
--echo Test that --not-known-option --help --verbose gives error
--error 2
--exec $MYSQLD_BOOTSTRAP_CMD --not-known-option --help --verbose >>$MYSQLTEST_VARDIR/tmp/mysqld_option_err/mysqltest.log 2>&1

--echo Done.