diff options
author | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
---|---|---|
committer | Galina Shalygina <galina.shalygina@mariadb.com> | 2018-06-01 21:57:10 +0200 |
commit | 6db465d7ce455cf75ec224108cbe61ca8be63d3d (patch) | |
tree | 9648ff1fc677eebb60b278c2e2c13131934ed2a0 /sql/lock.cc | |
parent | ffe83e8e7bef32eb2a80aad2d382f0b023dd3a44 (diff) | |
parent | 4a49f7f88cfa82ae6eb8e7b5a528e91416b33b52 (diff) | |
download | mariadb-git-shagalla-10.4.tar.gz |
Merge 10.3.7 into 10.4shagalla-10.4
Diffstat (limited to 'sql/lock.cc')
-rw-r--r-- | sql/lock.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/lock.cc b/sql/lock.cc index 2d9409fc7c3..17629f17291 100644 --- a/sql/lock.cc +++ b/sql/lock.cc @@ -379,7 +379,7 @@ end: static int lock_external(THD *thd, TABLE **tables, uint count) { - reg1 uint i; + uint i; int lock_type,error; DBUG_ENTER("lock_external"); @@ -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; @@ -539,7 +539,7 @@ void mysql_lock_remove(THD *thd, MYSQL_LOCK *locked,TABLE *table) { if (locked) { - reg1 uint i; + uint i; for (i=0; i < locked->table_count; i++) { if (locked->table[i] == table) @@ -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)); |