summaryrefslogtreecommitdiff
path: root/sql/backup.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-10-22 17:08:49 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-10-22 17:08:49 +0300
commit1657b7a583c62deb72267d485bfe201f43909e11 (patch)
treea750e2a44fdd296837b566623331e8a9a707d290 /sql/backup.cc
parentcca75c95bc3c5d0d4a2efb920d3942da3e658654 (diff)
parent9868253b32877554a2707634dc6a6fd79c491053 (diff)
downloadmariadb-git-1657b7a583c62deb72267d485bfe201f43909e11.tar.gz
Merge 10.4 to 10.5
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))