diff options
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 1bb80e01fb0..17629f17291 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -393,7 +393,7 @@ static int lock_external(THD *thd, TABLE **tables, uint count) (*tables)->reginfo.lock_type <= TL_READ_NO_INSERT)) lock_type=F_RDLCK; - if ((error=(*tables)->file->ha_external_lock(thd,lock_type))) + if (unlikely((error=(*tables)->file->ha_external_lock(thd,lock_type)))) { (*tables)->file->print_error(error, MYF(0)); while (--i) @@ -439,7 +439,7 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock, bool free_lock) DBUG_ASSERT(!(sql_lock->flags & GET_LOCK_ON_THD)); my_free(sql_lock); } - if (!errors) + if (likely(!errors)) thd->clear_error(); THD_STAGE_INFO(thd, org_stage); DBUG_VOID_RETURN; @@ -726,7 +726,7 @@ static int unlock_external(THD *thd, TABLE **table,uint count) if ((*table)->current_lock != F_UNLCK) { (*table)->current_lock = F_UNLCK; - if ((error=(*table)->file->ha_external_lock(thd, F_UNLCK))) + if (unlikely((error=(*table)->file->ha_external_lock(thd, F_UNLCK)))) { error_code= error; (*table)->file->print_error(error, MYF(0)); |