summaryrefslogtreecommitdiff
path: root/sql/backup.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/backup.cc')
-rw-r--r--sql/backup.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/backup.cc b/sql/backup.cc
index 02570dfd30d..e89f9a108a7 100644
--- a/sql/backup.cc
+++ b/sql/backup.cc
@@ -378,7 +378,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))