summaryrefslogtreecommitdiff
path: root/sql/lock.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2017-05-22 09:20:20 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2017-05-22 09:46:51 +0300
commit70505dd45bd36516206eeeb5dcaa28e5f5a1d6dd (patch)
tree14d0c4dba49e36dc0d80c1ba99757b4074781d2d /sql/lock.cc
parent7edadde72eb23e9110db8cea810c023104e9d15e (diff)
parent13a350ac29eeb43153c7bca65b73b5dfa9f8ffb5 (diff)
downloadmariadb-git-70505dd45bd36516206eeeb5dcaa28e5f5a1d6dd.tar.gz
Merge 10.1 into 10.2
Diffstat (limited to 'sql/lock.cc')
-rw-r--r--sql/lock.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/lock.cc b/sql/lock.cc
index a51c34365fa..06cb00fe32d 100644
--- a/sql/lock.cc
+++ b/sql/lock.cc
@@ -422,6 +422,7 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock)
void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock, bool free_lock)
{
DBUG_ENTER("mysql_unlock_tables");
+ bool errors= thd->is_error();
THD_STAGE_INFO(thd, stage_unlocking_tables);
if (sql_lock->table_count)
@@ -430,6 +431,8 @@ void mysql_unlock_tables(THD *thd, MYSQL_LOCK *sql_lock, bool free_lock)
thr_multi_unlock(sql_lock->locks, sql_lock->lock_count, 0);
if (free_lock)
my_free(sql_lock);
+ if (!errors)
+ thd->clear_error();
DBUG_VOID_RETURN;
}