Skip to content

Commit f1f8ebc

Browse files
committed
Merge 10.0 into 10.1
2 parents 6fbfb4c + afb4615 commit f1f8ebc

File tree

13 files changed

+581
-364
lines changed

13 files changed

+581
-364
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--let $_server_id= `SELECT @@server_id`
2+
--let $_expect_file_name= $MYSQLTEST_VARDIR/tmp/mysqld.$_server_id.expect
3+
4+
if ($restart_parameters)
5+
{
6+
--echo # Kill and restart: $restart_parameters
7+
--exec echo "restart: $restart_parameters" > $_expect_file_name
8+
}
9+
if (!$restart_parameters)
10+
{
11+
--echo # Kill and restart
12+
--exec echo "restart" > $_expect_file_name
13+
}
14+
15+
--shutdown_server 0
16+
--source include/wait_until_disconnected.inc
17+
--enable_reconnect
18+
--source include/wait_until_connected_again.inc
19+
--disable_reconnect
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
select @@max_binlog_stmt_cache_size;
2+
@@max_binlog_stmt_cache_size
3+
18446744073709547520
4+
set global max_binlog_stmt_cache_size= 18446744073709547520;
5+
select @@max_binlog_stmt_cache_size;
6+
@@max_binlog_stmt_cache_size
7+
18446744073709547520
8+
set global max_binlog_stmt_cache_size= 18446744073709547519;
9+
Warnings:
10+
Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '18446744073709547519'
11+
select @@max_binlog_stmt_cache_size;
12+
@@max_binlog_stmt_cache_size
13+
18446744073709543424
14+
set global max_binlog_stmt_cache_size= 18446744073709551615;
15+
Warnings:
16+
Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '18446744073709551615'
17+
select @@max_binlog_stmt_cache_size;
18+
@@max_binlog_stmt_cache_size
19+
18446744073709547520
20+
set global max_binlog_stmt_cache_size= 18446744073709551614;
21+
Warnings:
22+
Warning 1292 Truncated incorrect max_binlog_stmt_cache_size value: '18446744073709551614'
23+
select @@max_binlog_stmt_cache_size;
24+
@@max_binlog_stmt_cache_size
25+
18446744073709547520
26+
set global max_binlog_stmt_cache_size= 18446744073709551616;
27+
ERROR 42000: Incorrect argument type to variable 'max_binlog_stmt_cache_size'
28+
select @@max_binlog_stmt_cache_size;
29+
@@max_binlog_stmt_cache_size
30+
18446744073709547520
31+
set global max_binlog_stmt_cache_size= 18446744073709547520;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--max_binlog_stmt_cache_size=18446744073709547520
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
source include/have_log_bin.inc;
2+
select @@max_binlog_stmt_cache_size;
3+
4+
--let $cache_size=`select @@max_binlog_stmt_cache_size;`
5+
6+
set global max_binlog_stmt_cache_size= 18446744073709547520;
7+
select @@max_binlog_stmt_cache_size;
8+
9+
set global max_binlog_stmt_cache_size= 18446744073709547519;
10+
select @@max_binlog_stmt_cache_size;
11+
12+
set global max_binlog_stmt_cache_size= 18446744073709551615;
13+
select @@max_binlog_stmt_cache_size;
14+
15+
set global max_binlog_stmt_cache_size= 18446744073709551614;
16+
select @@max_binlog_stmt_cache_size;
17+
18+
--error ER_WRONG_TYPE_FOR_VAR
19+
set global max_binlog_stmt_cache_size= 18446744073709551616;
20+
select @@max_binlog_stmt_cache_size;
21+
22+
--eval set global max_binlog_stmt_cache_size= $cache_size
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
call mtr.add_suppression("InnoDB: Resizing redo log");
2+
call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files");
3+
call mtr.add_suppression("InnoDB: New log files created");
4+
call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
5+
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
6+
BEGIN;
7+
INSERT INTO t1 VALUES (42);
8+
# Kill and restart: --innodb-log-file-size=6M
9+
SELECT * FROM t1;
10+
a
11+
INSERT INTO t1 VALUES (42);
12+
BEGIN;
13+
DELETE FROM t1;
14+
# Kill and restart: --innodb-log-files-in-group=3 --innodb-log-file-size=5M
15+
SELECT * FROM t1;
16+
a
17+
42
18+
INSERT INTO t1 VALUES (123);
19+
BEGIN;
20+
DELETE FROM t1;
21+
# Kill the server
22+
--innodb-force-recovery-crash=1
23+
--innodb-force-recovery-crash=3
24+
--innodb-force-recovery-crash=4
25+
--innodb-force-recovery-crash=5
26+
--innodb-force-recovery-crash=6
27+
--innodb-force-recovery-crash=7
28+
--innodb-force-recovery-crash=8
29+
--innodb-force-recovery-crash=9
30+
--innodb-force-recovery-crash=10
31+
SELECT * FROM t1;
32+
a
33+
42
34+
123
35+
DROP TABLE t1;
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
# Test resizing the InnoDB redo log.
2+
3+
--source include/have_innodb.inc
4+
5+
# Embedded server does not support crashing
6+
--source include/not_embedded.inc
7+
# Avoid CrashReporter popup on Mac
8+
--source include/not_crashrep.inc
9+
# innodb-force-recovery-crash needs debug
10+
--source include/have_debug.inc
11+
12+
if (`SELECT @@innodb_log_file_size = 1048576`) {
13+
--skip Test requires innodb_log_file_size>1M.
14+
}
15+
16+
call mtr.add_suppression("InnoDB: Resizing redo log");
17+
call mtr.add_suppression("InnoDB: Starting to delete and rewrite log files");
18+
call mtr.add_suppression("InnoDB: New log files created");
19+
call mtr.add_suppression("InnoDB: The log sequence numbers [0-9]+ and [0-9]+ in ibdata files do not match the log sequence number [0-9]+ in the ib_logfiles");
20+
21+
CREATE TABLE t1(a INT PRIMARY KEY) ENGINE=InnoDB;
22+
BEGIN;
23+
INSERT INTO t1 VALUES (42);
24+
25+
let $restart_parameters = --innodb-log-file-size=6M;
26+
--source include/kill_and_restart_mysqld.inc
27+
28+
SELECT * FROM t1;
29+
30+
INSERT INTO t1 VALUES (42);
31+
BEGIN;
32+
DELETE FROM t1;
33+
34+
let $restart_parameters = --innodb-log-files-in-group=3 --innodb-log-file-size=5M;
35+
--source include/kill_and_restart_mysqld.inc
36+
37+
SELECT * FROM t1;
38+
39+
INSERT INTO t1 VALUES (123);
40+
41+
let MYSQLD_DATADIR= `select @@datadir`;
42+
let SEARCH_ABORT = NOT FOUND;
43+
let SEARCH_FILE= $MYSQLTEST_VARDIR/log/my_restart.err;
44+
let $args=--innodb --unknown-option --loose-console --core-file > $SEARCH_FILE 2>&1;
45+
let $crash=--innodb --unknown-option --loose-console > $SEARCH_FILE 2>&1 --innodb-force-recovery-crash;
46+
47+
BEGIN;
48+
DELETE FROM t1;
49+
50+
--source include/kill_mysqld.inc
51+
52+
--error 2
53+
--exec $MYSQLD_CMD $args --innodb-log-group-home-dir=foo\;bar
54+
let SEARCH_PATTERN= syntax error in innodb_log_group_home_dir;
55+
--source include/search_pattern_in_file.inc
56+
--remove_file $SEARCH_FILE
57+
58+
--echo --innodb-force-recovery-crash=1
59+
--error 3
60+
--exec $MYSQLD_CMD $crash=1
61+
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
62+
--source include/search_pattern_in_file.inc
63+
--remove_file $SEARCH_FILE
64+
--echo --innodb-force-recovery-crash=3
65+
--error 3
66+
--exec $MYSQLD_CMD $crash=3
67+
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
68+
--source include/search_pattern_in_file.inc
69+
--remove_file $SEARCH_FILE
70+
71+
--error 2
72+
--exec $MYSQLD_CMD $args --innodb-read-only
73+
let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
74+
--source include/search_pattern_in_file.inc
75+
--remove_file $SEARCH_FILE
76+
77+
--echo --innodb-force-recovery-crash=4
78+
--error 3
79+
--exec $MYSQLD_CMD $crash=4
80+
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
81+
--source include/search_pattern_in_file.inc
82+
let SEARCH_PATTERN= InnoDB: Resizing redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
83+
--source include/search_pattern_in_file.inc
84+
--remove_file $SEARCH_FILE
85+
--echo --innodb-force-recovery-crash=5
86+
--error 3
87+
--exec $MYSQLD_CMD $crash=5
88+
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
89+
--source include/search_pattern_in_file.inc
90+
let SEARCH_PATTERN= InnoDB: Resizing redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
91+
--source include/search_pattern_in_file.inc
92+
--remove_file $SEARCH_FILE
93+
94+
--error 2
95+
--exec $MYSQLD_CMD $args --innodb-read-only
96+
let SEARCH_PATTERN= InnoDB: innodb_read_only prevents crash recovery;
97+
--source include/search_pattern_in_file.inc
98+
--remove_file $SEARCH_FILE
99+
100+
--echo --innodb-force-recovery-crash=6
101+
--error 3
102+
--exec $MYSQLD_CMD $crash=6
103+
let SEARCH_PATTERN= InnoDB: Starting an apply batch of log records;
104+
--source include/search_pattern_in_file.inc
105+
let SEARCH_PATTERN= InnoDB: Resizing redo log from 3\*[0-9]+ to 2\*[0-9]+ pages;
106+
--source include/search_pattern_in_file.inc
107+
--remove_file $SEARCH_FILE
108+
--echo --innodb-force-recovery-crash=7
109+
--error 3
110+
--exec $MYSQLD_CMD $crash=7
111+
# this crashes right after deleting all log files
112+
--remove_file $SEARCH_FILE
113+
114+
--error 2
115+
--exec $MYSQLD_CMD $args --innodb-read-only
116+
let SEARCH_PATTERN= InnoDB: Cannot create log files in read-only mode;
117+
--source include/search_pattern_in_file.inc
118+
--remove_file $SEARCH_FILE
119+
120+
--echo --innodb-force-recovery-crash=8
121+
--error 3
122+
--exec $MYSQLD_CMD $crash=8
123+
let SEARCH_PATTERN= InnoDB: Setting log file .*ib_logfile[0-9]+ size to;
124+
--source include/search_pattern_in_file.inc
125+
--remove_file $SEARCH_FILE
126+
--echo --innodb-force-recovery-crash=9
127+
--error 3
128+
--exec $MYSQLD_CMD $crash=9
129+
let SEARCH_PATTERN= InnoDB: Setting log file .*ib_logfile[0-9]+ size to;
130+
--source include/search_pattern_in_file.inc
131+
--remove_file $SEARCH_FILE
132+
133+
# We should have perfectly synced files here.
134+
# Rename the log files, and trigger an error in recovery.
135+
--move_file $MYSQLD_DATADIR/ib_logfile101 $MYSQLD_DATADIR/ib_logfile0
136+
--move_file $MYSQLD_DATADIR/ib_logfile1 $MYSQLD_DATADIR/ib_logfile1_hidden
137+
--error 2
138+
--exec $MYSQLD_CMD $args
139+
let SEARCH_PATTERN= InnoDB: Only one log file found;
140+
--source include/search_pattern_in_file.inc
141+
--remove_file $SEARCH_FILE
142+
--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
143+
144+
perl;
145+
die unless open(FILE, ">$ENV{MYSQLD_DATADIR}/ib_logfile0");
146+
print FILE "garbage";
147+
close(FILE);
148+
EOF
149+
--error 2
150+
--exec $MYSQLD_CMD $args
151+
let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile0 size 7 is not a multiple of innodb_page_size;
152+
--source include/search_pattern_in_file.inc
153+
--remove_file $SEARCH_FILE
154+
--remove_file $MYSQLD_DATADIR/ib_logfile0
155+
--move_file $MYSQLD_DATADIR/ib_logfile101 $MYSQLD_DATADIR/ib_logfile0
156+
157+
perl;
158+
die unless open(FILE, ">$ENV{MYSQLD_DATADIR}/ib_logfile1");
159+
print FILE "junkfill" x 131072;
160+
close(FILE);
161+
EOF
162+
163+
--error 2
164+
--exec $MYSQLD_CMD $args
165+
let SEARCH_PATTERN= InnoDB: Log file .*ib_logfile1 is of different size 1048576 bytes than other log files;
166+
--source include/search_pattern_in_file.inc
167+
--remove_file $SEARCH_FILE
168+
--remove_file $MYSQLD_DATADIR/ib_logfile1
169+
--move_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile101
170+
--move_file $MYSQLD_DATADIR/ib_logfile1_hidden $MYSQLD_DATADIR/ib_logfile1
171+
172+
--echo --innodb-force-recovery-crash=10
173+
--error 3
174+
--exec $MYSQLD_CMD $crash=10
175+
let SEARCH_PATTERN= InnoDB: Setting log file .*ib_logfile[0-9]+ size to;
176+
--source include/search_pattern_in_file.inc
177+
let SEARCH_PATTERN= InnoDB: Renaming log file .*ib_logfile101 to .*ib_logfile0;
178+
--source include/search_pattern_in_file.inc
179+
--remove_file $SEARCH_FILE
180+
181+
--let $restart_parameters=
182+
--source include/start_mysqld.inc
183+
184+
SELECT * FROM t1;
185+
DROP TABLE t1;

0 commit comments

Comments
 (0)