diff options
author | Monty <monty@mariadb.org> | 2021-02-14 17:42:19 +0200 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2021-02-14 17:42:19 +0200 |
commit | af31e2c55d569de343b2b855131e73c0138e7c2d (patch) | |
tree | e67a72676121b40d9c4cbcb8f81fac5fa0d99205 /sql/log.cc | |
parent | 3cd32a9bafe74d2963418ad679bc73335a0b1391 (diff) | |
download | mariadb-git-af31e2c55d569de343b2b855131e73c0138e7c2d.tar.gz |
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().
Diffstat (limited to 'sql/log.cc')
-rw-r--r-- | sql/log.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sql/log.cc b/sql/log.cc index 480e3b696cc..2a1142d8391 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -6390,8 +6390,9 @@ bool MYSQL_BIN_LOG::write(Log_event *event_info, my_bool *with_annotate) DBUG_ASSERT(!thd->backup_commit_lock); mdl_request.init(MDL_key::BACKUP, "", "", MDL_BACKUP_COMMIT, MDL_EXPLICIT); - thd->mdl_context.acquire_lock(&mdl_request, - thd->variables.lock_wait_timeout); + if (thd->mdl_context.acquire_lock(&mdl_request, + thd->variables.lock_wait_timeout)) + DBUG_RETURN(1); thd->backup_commit_lock= &mdl_request; if ((res= thd->wait_for_prior_commit())) |