summaryrefslogtreecommitdiff
path: root/mysql-test/main/mysqld--help.test
blob: 35b3363e8d89a0308cc0429418d8b8f3c7190349 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#
# mysqld --help
#
--source include/not_embedded.inc
--source include/not_asan.inc
--source include/not_ubsan.inc
--source include/have_perfschema.inc
--source include/have_profiling.inc
--source include/platform.inc

#
# force lower-case-table-names=1 (linux/macosx have different defaults)
# force symbolic-links=0 (valgrind build has a different default)
#

exec $MYSQLD_BOOTSTRAP_CMD --symbolic-links=0 --log-bin=foo --lower-case-table-names=1 --help --verbose > $MYSQL_TMP_DIR/mysqld--help.txt 2>&1;

# The inline perl code below will copy $MYSQL_TMP_DIR/mysqld--help.txt
# to output, but filter away some variable stuff (e.g. paths).

perl;
  # Variables which we don't want to display in the result file since
  # their paths may vary:
  @skipvars=qw/basedir open-files-limit general-log-file log plugin-dir plugin-maturity
               log-slow-queries pid-file slow-query-log-file log-basename
               log-slow-query-file
               datadir slave-load-tmpdir tmpdir socket thread-pool-size
               large-files-support lower-case-file-system system-time-zone
               collation-server character-set-server log-tc-size table-cache
               table-open-cache table-open-cache-instances max-connections
               tls-version version.* password-reuse-check
               password-reuse-check-interval/;

  # Plugins which may or may not be there:
  @plugins=qw/innodb archive blackhole federated partition s3
              feedback debug temp-pool ssl des-key-file xtradb sequence
              thread-concurrency super-large-pages mutex-deadlock-detector
              connect null-audit aria oqgraph sphinx thread-handling
              test-sql-discovery query-cache-info password-reuse-check
              query-response-time metadata-lock-info locales unix-socket
              wsrep file-key-management cracklib-password-check user-variables
              provider-bzip2 provider-lzma provider-lzo
              thread-pool-groups thread-pool-queues thread-pool-stats
              thread-pool-waits hashicorp provider/;

  # And substitute the content some environment variables with their
  # names:
  @env=qw/MYSQLTEST_VARDIR MYSQL_TEST_DIR MYSQL_CHARSETSDIR MYSQL_SHAREDIR/;

  $re1=join('|', @skipvars, @plugins);
  $re2=join('|', @plugins);
  $skip=0;
  open(F, '<', "$ENV{MYSQL_TMP_DIR}/mysqld--help.txt") or die;
  print "Windows bug: new line disappears when it is exactly at the right offset.\n";
  while (<F>) {
    next if 1../The following groups are read/;
    # formatting, skip line consisting entirely of dashes and blanks
    next if /^[\- ]+\s?$/;
    next if /Value \(after reading options\)/; # skip table header
    next if /^($re1) /;
    next if /^($re2)-/;
    $skip=0 if /^  -/ or /^$/;
    $skip=1 if / --($re2)\b/;
    y!\\!/!;
    s/[ ]+/ /; # squeeze spaces to remove table formatting
    # fixes for 32-bit
    s/\b4294967295\b/18446744073709551615/;
    s/\b2146435072\b/9223372036853727232/;
    s/\b392192\b/299008/;
    s/\b4294963200\b/18446744073709547520/;
    foreach $var (@env) { s/\Q$ENV{$var}\E/$var/ }
    next if /use --skip-(use-)?symbolic-links to disable/; # for valgrind, again
    next if $skip;
    print;
  }
  close F;
EOF