Commit 5a1f821b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-31861 Empty INSERT crashes with innodb_force_recovery=6 or innodb_read_only=ON

ha_innobase::extra(): Do not invoke log_buffer_flush_to_disk()
if high_level_read_only holds.

log_buffer_flush_to_disk(): Remove an assertion that duplicates one
at the start of log_write_up_to().
parent 55a96c05
......@@ -37,6 +37,8 @@ SELECT * FROM t;
a
3
SET GLOBAL innodb_max_purge_lag_wait=0;
INSERT INTO mysql.innodb_index_stats
SELECT * FROM mysql.innodb_index_stats LIMIT 0;
# restart
SELECT * FROM t;
a
......
......@@ -39,6 +39,8 @@ SELECT * FROM t;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT * FROM t;
SET GLOBAL innodb_max_purge_lag_wait=0;
INSERT INTO mysql.innodb_index_stats
SELECT * FROM mysql.innodb_index_stats LIMIT 0;
--let $restart_parameters=
--source include/restart_mysqld.inc
SELECT * FROM t;
......
......@@ -15797,7 +15797,8 @@ ha_innobase::extra(
break;
case HA_EXTRA_END_ALTER_COPY:
m_prebuilt->table->skip_alter_undo = 0;
if (!m_prebuilt->table->is_temporary()) {
if (!m_prebuilt->table->is_temporary()
&& !high_level_read_only) {
log_buffer_flush_to_disk();
}
break;
......
......@@ -871,7 +871,6 @@ void log_write_up_to(lsn_t lsn, bool flush_to_disk, bool rotate_key,
@param sync whether to wait for a durable write to complete */
void log_buffer_flush_to_disk(bool sync)
{
ut_ad(!srv_read_only_mode);
log_write_up_to(log_sys.get_lsn(std::memory_order_acquire), sync);
}
......
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