diff options
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index fa199ce7454..fab0a61e506 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -787,7 +787,7 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, bool is_not_commi LINT_INIT(old_message); (void) pthread_mutex_lock(&LOCK_open); - if (need_exit_cond= must_wait) + if ((need_exit_cond= must_wait)) { if (thd->global_read_lock) // This thread had the read locks { @@ -805,7 +805,11 @@ bool wait_if_global_read_lock(THD *thd, bool abort_on_refresh, bool is_not_commi } if (!abort_on_refresh && !result) protect_against_global_read_lock++; - if (unlikely(need_exit_cond)) // global read locks are rare + /* + The following is only true in case of a global read locks (which is rare) + and if old_message is set + */ + if (unlikely(need_exit_cond)) thd->exit_cond(old_message); else pthread_mutex_unlock(&LOCK_open); |