File: bootstrap.test

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (184 lines) | stat: -rw-r--r-- 7,138 bytes parent folder | download
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
--source include/have_64bit.inc

--echo # Testcase for the following bugs
--echo # Bug#16691130 - ASSERT WHEN INNODB_LOG_GROUP_HOME_DIR DOES NOT EXIST
--echo # Bug#16418661 - CHANGING NAME IN FOR INNODB_DATA_FILE_PATH SHOULD NOT SUCCEED WITH LOG FILES

let bugdir= $MYSQLTEST_VARDIR/tmp/log_file;
--mkdir $bugdir
--mkdir $bugdir/data

--source include/shutdown_mysqld.inc
let SEARCH_FILE = $bugdir/my_restart.err;
let $args=--defaults-file=$bugdir/my.cnf --loose-console --innodb_dedicated_server=OFF --core-file --log-error-verbosity=3 > $SEARCH_FILE 2>&1 ;

--echo # Write tmp/log_file/my.cnf
--write_file $bugdir/my.cnf
[mysqld]
secure_file_priv=""
innodb_fast_shutdown=0
innodb_data_file_path = ibdata1:16M;ibdata2:16M
innodb_rollback_segments = 20
innodb_redo_log_capacity = 60M
loose-skip-log-bin
EOF

--exec echo "datadir = $bugdir/data" >> $bugdir/my.cnf
--exec echo "innodb_data_home_dir = $bugdir/data" >> $bugdir/my.cnf

--echo # Start mysqld without the possibility to create undo tablespaces
--echo # because a directory exists named 'undo_002'.
--mkdir $bugdir/data/undo_002
# In scope of WL#9461,WL#9357, in place upgrade condition requires
# mysql.plugin.frm file. Create the file manually here to allow
# initialization of innodb.
--mkdir $bugdir/data/mysql
write_file $bugdir/data/mysql/plugin.frm;
EOF

--error 1,3,42
--exec $MYSQLD $args
let SEARCH_PATTERN=\[ERROR\] .*MY-\\d+.* File .*ibdata1: 'open' returned OS error 71. Cannot continue operation;
--source include/search_pattern.inc

--remove_file $bugdir/data/mysql_dd_upgrade_info
--force-rmdir $bugdir/data/mysql
--list_files $bugdir/data
--rmdir $bugdir/data/undo_002
--remove_file $bugdir/data/auto.cnf

--echo # Start mysqld to create tablespaces according to my.cnf
--exec $MYSQLD $args --initialize-insecure

--echo # Backup the datadir
--force-cpdir $bugdir/data $bugdir/data_backup

--echo # 1. Start mysqld with non existent innodb_log_group_home_dir
--error 1,3,42
--exec $MYSQLD $args --innodb_log_group_home_dir=/path/to/non-existent/ --innodb-unknown-parameter-1
let SEARCH_PATTERN=\[ERROR\] .* Failed to list redo log files in the redo log directory .path.to.non-existent;
--source include/search_pattern.inc
let SEARCH_PATTERN=\[ERROR\] .* Aborting;
--source include/search_pattern.inc

--echo # 2. Start mysqld without ibdata1
--remove_file $bugdir/data/ibdata1
--error 1,3,42
--exec $MYSQLD $args --innodb-unknown-parameter-2
let SEARCH_PATTERN=\[ERROR\] .* File .*ibdata1: 'open' returned OS error 71. Cannot continue operation;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 3. Start mysqld without ibdata2
--remove_file $bugdir/data/ibdata2
--error 1,3,42
--exec $MYSQLD $args --innodb-unknown-parameter-3
let SEARCH_PATTERN=\[ERROR\] .* Tablespace size stored in header is \d+ pages, but;
--source include/search_pattern.inc
let SEARCH_PATTERN=\[ERROR\] .* Aborting;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 4. Start mysqld without ibdata1 & ibdata2
--remove_file $bugdir/data/ibdata1
--remove_file $bugdir/data/ibdata2
--error 1,3,42
--exec $MYSQLD $args --innodb-unknown-parameter-4
let SEARCH_PATTERN=\[ERROR\] .* File .*ibdata1: 'open' returned OS error 71. Cannot continue operation;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 5. Start mysqld without ibdata*, #ib_redo* and undo_00*
--remove_files_wildcard $bugdir/data ibdata*
--remove_files_wildcard $bugdir/data/#innodb_redo #ib_redo*
--remove_files_wildcard $bugdir/data undo_00*
--error 1,3,42
--exec $MYSQLD $args --innodb-unknown-parameter-5
let SEARCH_PATTERN=\[ERROR\] .* File .*ibdata1: 'open' returned OS error 71. Cannot continue operation;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 6. Start mysqld without undo_002
--remove_file $bugdir/data/undo_002
--error 1,3,42
--exec $MYSQLD $args --innodb-unknown-parameter-6
let SEARCH_PATTERN=\[Note\] .* Creating UNDO Tablespace .*undo_002;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 7. Start mysqld without undo_001, undo_002
--remove_file $bugdir/data/undo_001
--remove_file $bugdir/data/undo_002
--error 1,3,42
--exec $MYSQLD $args --innodb-unknown-parameter-7
let SEARCH_PATTERN=\[Note\] .* Creating UNDO Tablespace .*undo_001;
--source include/search_pattern.inc
let SEARCH_PATTERN=\[Note\] .* Creating UNDO Tablespace .*undo_002;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 8. Start mysqld without #ib_redo*
--remove_files_wildcard $bugdir/data/#innodb_redo #ib_redo*
--error 1
--exec $MYSQLD $args --innodb-unknown-parameter-8
let SEARCH_PATTERN=\[Note\] .* Apply batch completed;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # 9. Add new datafile at the end
--error 1,3,42
--exec $MYSQLD $args --innodb-data_file_path="ibdata1:16M;ibdata2:16M;ibdata3:20M:autoextend" --innodb-unknown-parameter-9
let SEARCH_PATTERN=\[Note\] .* File.*ibdata3. size is now 20 MB;
--source include/search_pattern.inc

--echo # 10. Show that --innodb-undo-directory cannot be an ancestor of the datadir
--error 1,3,42
--exec $MYSQLD $args --innodb-undo-directory=.. --innodb-unknown-parameter-10
let SEARCH_PATTERN=\[ERROR\] .* The innodb_undo_directory is not allowed to be an ancestor of the datadir;
--source include/search_pattern.inc

--echo # 11. Try to initialize InnoDB in directory which has log files
--mkdir $bugdir/step11
--mkdir $bugdir/step11-log
--mkdir $bugdir/step11-log/#innodb_redo
--write_file $bugdir/step11-log/#innodb_redo/#ib_redo42
I love MySQL.
EOF
--error 1,42
--exec $MYSQLD $args --initialize-insecure --innodb_log_group_home_dir=$bugdir/step11-log/ --innodb_data_home_dir=$bugdir/step11/ --datadir=$bugdir/step11 --innodb-unknown-parameter-11
let SEARCH_PATTERN=--initialize specified but the redo log directory .* has redo log files inside;
--source include/search_pattern.inc
--force-rmdir $bugdir/step11-log
--force-rmdir $bugdir/step11
--source ../include/bootstrap_cleanup.inc

--echo # 12. Rename log file after shutdown and start MySQL (should succeed)
let MYSQLD_DATADIR= $bugdir/data;
perl;
  require 'include/ib_redo_log_files.inc';
  use File::Copy qw(move);
  my $files = [];
  foreach (log_get_non_tmp_files()) {
    if ($_ =~ /#ib_redo(\d+)$/) {
      push @{$files}, {id=>$1,name=>$_};
    }
  }
  @$files_ordered_by_id_desc = (sort {$b->{id} <=> $a->{id}} @{$files});
  foreach $file (@{$files_ordered_by_id_desc}) {
    my $old_file_no = $file->{id};
    my $old_file_name = $file->{name};
    my $new_file_no = $file->{id} + 1;
    (my $new_file_name = $file->{name}) =~ s/^(.*#ib_redo)(\d+)$/$1$new_file_no/;
    move $old_file_name, $new_file_name;
  }
EOF
--error 1,42
--exec $MYSQLD $args --skip-networking --socket=$MYSQL_TMP_DIR/tmp.sock --innodb-unknown-parameter-12
let SEARCH_PATTERN=[ERROR].*innodb-unknown-parameter-12.*;
--source include/search_pattern.inc
--source ../include/bootstrap_cleanup.inc

--echo # Cleanup
--force-rmdir $bugdir

--source include/start_mysqld.inc