Commit cc136307 authored by Marko Mäkelä's avatar Marko Mäkelä

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 1122ac97 (MDEV-33545).
parent 8c8b3ab7
......@@ -186,6 +186,11 @@ t1 CREATE TABLE `t1` (
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
SET GLOBAL innodb_doublewrite=ON;
SELECT @@GLOBAL.innodb_doublewrite "OFF expected";
OFF expected
OFF
SET GLOBAL innodb_buf_flush_list_now=ON;
# restart
FTS_INDEX_1.ibd
FTS_INDEX_2.ibd
......
......@@ -87,6 +87,10 @@ SELECT * FROM t1 WHERE MATCH(b,c) AGAINST ('column');
SHOW CREATE TABLE t1;
CHECK TABLE t1;
SET GLOBAL innodb_doublewrite=ON;
SELECT @@GLOBAL.innodb_doublewrite "OFF expected";
SET GLOBAL innodb_buf_flush_list_now=ON;
--let $restart_parameters=
--source include/restart_mysqld.inc
--replace_regex /FTS_[0-9a-f]*_[0-9a-f]*/FTS/
......
......@@ -18420,7 +18420,8 @@ static void innodb_data_file_write_through_update(THD *, st_mysql_sys_var*,
static void innodb_doublewrite_update(THD *, st_mysql_sys_var*,
void *, const void *save)
{
fil_system.set_use_doublewrite(*static_cast<const ulong*>(save));
if (!srv_read_only_mode)
fil_system.set_use_doublewrite(*static_cast<const ulong*>(save));
}
static void innodb_log_file_size_update(THD *thd, st_mysql_sys_var*,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment