Debian Codegraph @

mysql-test/suite/perfschema/t/bad_option.test

raw
1 # Tests for PERFORMANCE_SCHEMA
2 # Check error handling for invalid server start options and values
3
4 # The current test unites and replaces all suite/perfschema/t/bad_option_*.test
5 # which were developed by Marc.
6
7 --source include/not_embedded.inc
8 --source include/have_perfschema.inc
9 --source include/not_as_root.inc
10
11 let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err;
12 --error 0,1
13 --remove_file $error_log
14 let SEARCH_FILE= $error_log;
15 # Stop the server
16 let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.expect;
17 --write_line wait $restart_file
18 --shutdown_server
19 --source include/wait_until_disconnected.inc
20 --error 7
21 --exec $MYSQLD_CMD --loose-console --skip-log-error --performance-schema-enabled=maybe > $error_log 2>&1
22 # The server restart aborts
23 # [ERROR] unknown variable 'performance-schema-enabled=maybe'
24 let SEARCH_PATTERN= \[ERROR\].*unknown variable 'performance-schema-enabled=maybe';
25 --source include/search_pattern_in_file.inc
26 --echo # Server start with invalid startup option value 'performance-schema-enabled=maybe' : pass
27
28 --remove_file $error_log
29 --error 7
30 --exec $MYSQLD_CMD --loose-console --skip-log-error --performance-schema-max_=12 > $error_log 2>&1
31 # The server restart aborts
32 # [ERROR] unknown variable 'performance-schema-max_=12'
33 let SEARCH_PATTERN= \[ERROR\].*unknown variable 'performance-schema-max_=12';
34 --source include/search_pattern_in_file.inc
35 --echo # Server start with ambigous startup option 'performance-schema-max_=12' : pass
36 # The important points is here:
37 # 1. There is no option 'performance-schema-max_' or 'performance-schema-max-' at all.
38 # 2. But we have many options where the name starts exact with this pattern.
39 # 3. There is a value assigned.
40 # 4. The server criticizes "variable" and not "option"!
41 # This seems to be caused by 3. because "--performance-schema-unknown=ON" gets
42 # a similar reaction.
43
44 --remove_file $error_log
45 --error 2
46 --exec $MYSQLD_CMD --loose-console --skip-log-error --performance-schema-unknown_99 > $error_log 2>&1
47 # The server restart aborts
48 let SEARCH_PATTERN= \[ERROR\].*unknown option '--performance-schema-unknown_99';
49 --source include/search_pattern_in_file.inc
50 --echo # Server start with invalid startup option '--performance-schema-unknown_99' : pass
51
52 --remove_file $error_log
53 --error 1
54 --exec $MYSQLD_CMD --loose-console --skip-log-error --datadir=bad_option_h_param > $error_log 2>&1
55 # The server restart aborts
56 # [ERROR] failed to set datadir to /work/repo1/mysql-trunk2/bad_option_h_param
57 let SEARCH_PATTERN= Can.t change dir to .*bad_option_h_param;
58 --source include/search_pattern_in_file.inc
59 --echo # Server start with invalid startup option value '--datadir=bad_option_h_param' : pass
60 # The important point is here:
61 # There is no directory "bad_option_h_param".
62
63 --remove_file $error_log
64 # Write file to make mysql-test-run.pl start up the server again
65 --write_line restart $restart_file
66
67 # Turn on reconnect
68 --enable_reconnect
69
70 # Call script that will poll the server waiting for it to be back online again
71 --source include/wait_until_connected_again.inc
72
73 # Turn off reconnect again
74 --disable_reconnect
75