Skip to content

Commit cc13630

Browse files
committed
MDEV-34455 innodb_read_only=ON fails to imply innodb_doublewrite=OFF
innodb_doublewrite_update(): Disallow any change if srv_read_only_mode holds, that is, the server was started with innodb_read_only=ON or innodb_force_recovery=6. This fixes up commit 1122ac9 (MDEV-33545).
1 parent 8c8b3ab commit cc13630

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

mysql-test/suite/innodb/r/alter_copy.result

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ t1 CREATE TABLE `t1` (
186186
CHECK TABLE t1;
187187
Table Op Msg_type Msg_text
188188
test.t1 check status OK
189+
SET GLOBAL innodb_doublewrite=ON;
190+
SELECT @@GLOBAL.innodb_doublewrite "OFF expected";
191+
OFF expected
192+
OFF
193+
SET GLOBAL innodb_buf_flush_list_now=ON;
189194
# restart
190195
FTS_INDEX_1.ibd
191196
FTS_INDEX_2.ibd

mysql-test/suite/innodb/t/alter_copy.test

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ SELECT * FROM t1 WHERE MATCH(b,c) AGAINST ('column');
8787
SHOW CREATE TABLE t1;
8888
CHECK TABLE t1;
8989

90+
SET GLOBAL innodb_doublewrite=ON;
91+
SELECT @@GLOBAL.innodb_doublewrite "OFF expected";
92+
SET GLOBAL innodb_buf_flush_list_now=ON;
93+
9094
--let $restart_parameters=
9195
--source include/restart_mysqld.inc
9296
--replace_regex /FTS_[0-9a-f]*_[0-9a-f]*/FTS/

storage/innobase/handler/ha_innodb.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18420,7 +18420,8 @@ static void innodb_data_file_write_through_update(THD *, st_mysql_sys_var*,
1842018420
static void innodb_doublewrite_update(THD *, st_mysql_sys_var*,
1842118421
void *, const void *save)
1842218422
{
18423-
fil_system.set_use_doublewrite(*static_cast<const ulong*>(save));
18423+
if (!srv_read_only_mode)
18424+
fil_system.set_use_doublewrite(*static_cast<const ulong*>(save));
1842418425
}
1842518426

1842618427
static void innodb_log_file_size_update(THD *thd, st_mysql_sys_var*,

0 commit comments

Comments
 (0)