1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-23843 Assertions in Diagnostics_area upon table operations under FTWRL

2 different problems:
- MYSQL_BIN_LOG::write() did not check if mdl_context.acquire_lock() failed
- Sql_cmd_optimize_table::execute() and Sql_cmd_repair_table::execute()
  called write_bin_log(), which could fail if sql_admin() had already
  called my_eof()

Fixed by adding check for aquire_lock() return status and protect
write_bin_log() in the above two functions with set_overwrite_status().
This commit is contained in:
Monty
2021-02-14 17:42:19 +02:00
parent 3cd32a9baf
commit af31e2c55d
4 changed files with 58 additions and 2 deletions

View File

@ -1455,7 +1455,9 @@ bool Sql_cmd_optimize_table::execute(THD *thd)
/*
Presumably, OPTIMIZE and binlog writing doesn't require synchronization
*/
thd->get_stmt_da()->set_overwrite_status(true);
res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
thd->get_stmt_da()->set_overwrite_status(false);
}
m_lex->first_select_lex()->table_list.first= first_table;
m_lex->query_tables= first_table;
@ -1487,7 +1489,9 @@ bool Sql_cmd_repair_table::execute(THD *thd)
/*
Presumably, REPAIR and binlog writing doesn't require synchronization
*/
thd->get_stmt_da()->set_overwrite_status(true);
res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
thd->get_stmt_da()->set_overwrite_status(false);
}
m_lex->first_select_lex()->table_list.first= first_table;
m_lex->query_tables= first_table;