diff options
author | Rinat Ibragimov <ri@tempesta-tech.com> | 2020-10-21 23:34:36 +0300 |
---|---|---|
committer | Monty <monty@mariadb.org> | 2020-10-22 00:18:33 +0300 |
commit | 709ba7dcae871e365697f67677c908b55ad4a964 (patch) | |
tree | dde2860dddbc468d6f1a4484b8e109baff7226a5 /sql/backup.cc | |
parent | ac8d20579512e05001f9bf8193187e47c870d35a (diff) | |
download | mariadb-git-709ba7dcae871e365697f67677c908b55ad4a964.tar.gz |
MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure
MDEV-20945: BACKUP UNLOCK + FTWRL assertion failure | SIGSEGV in I_P_List
from MDL_context::release_lock on INSERT w/ BACKUP LOCK (on optimized
builds) | Assertion `ticket->m_duration == MDL_EXPLICIT' failed
BACKUP LOCK behavior is modified so it won't be used wrong:
- BACKUP LOCK should commit any active transactions.
- BACKUP LOCK should not be allowed in stored procedures.
- When BACKUP LOCK is active, don't allow any DDL's for that connection.
- FTWRL is forbidden on the same connection while BACKUP LOCK is active.
Reviewed-by: monty@mariadb.com
Diffstat (limited to 'sql/backup.cc')
-rw-r--r-- | sql/backup.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/backup.cc b/sql/backup.cc index 813485ea29a..cff14415d96 100644 --- a/sql/backup.cc +++ b/sql/backup.cc @@ -377,7 +377,13 @@ bool backup_reset_alter_copy_lock(THD *thd) bool backup_lock(THD *thd, TABLE_LIST *table) { + /* We should leave the previous table unlocked in case of errors */ backup_unlock(thd); + if (thd->locked_tables_mode) + { + my_error(ER_LOCK_OR_ACTIVE_TRANSACTION, MYF(0)); + return 1; + } table->mdl_request.duration= MDL_EXPLICIT; if (thd->mdl_context.acquire_lock(&table->mdl_request, thd->variables.lock_wait_timeout)) |