summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index 215059b8a46..646babea6a1 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -792,9 +792,15 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh,
{
if (thd->global_read_lock) // This thread had the read locks
{
- my_error(ER_CANT_UPDATE_WITH_READLOCK,MYF(0));
+ if (is_not_commit)
+ my_error(ER_CANT_UPDATE_WITH_READLOCK,MYF(0));
(void) pthread_mutex_unlock(&LOCK_open);
- DBUG_RETURN(1);
+ /*
+ We allow FLUSHer to COMMIT; we assume FLUSHer knows what it does.
+ This allowance is needed to not break existing versions of innobackup
+ which do a BEGIN; INSERT; FLUSH TABLES WITH READ LOCK; COMMIT.
+ */
+ DBUG_RETURN(is_not_commit);
}
old_message=thd->enter_cond(&COND_refresh, &LOCK_open,
"Waiting for release of readlock");