summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authormonty@mysql.com <>2004-10-20 16:24:28 +0300
committermonty@mysql.com <>2004-10-20 16:24:28 +0300
commite1218474b87e1c28f080207558966fac6f4eb292 (patch)
treef3f6e81dac72352598beb9c21f116d2ef7f9c3ef /sql/lock.cc
parentf9cd4a60e466a211024e5efb6840b79a3066f3c8 (diff)
parentb32ffec8fdc9d05377e69c8b1abb92d562670324 (diff)
downloadmariadb-git-e1218474b87e1c28f080207558966fac6f4eb292.tar.gz
Merge with 4.0
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");