summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-05-12 14:27:49 +0200
committerSergei Golubchik <serg@mariadb.org>2017-05-15 22:23:10 +0200
commitf9264280d68dcbca2f9312c7d8620b2bcc9d0694 (patch)
tree4d68b8c47e162b862db88793d312bb93beab8e8b /sql/handler.cc
parent52aa200919b1fd9357c05bcdfc66a42e51f242b3 (diff)
downloadmariadb-git-f9264280d68dcbca2f9312c7d8620b2bcc9d0694.tar.gz
MDEV-12761 Error return from external_lock make the server crash
bunch of bugs when external_lock() fails on unlock: * mi_lock_database() used mi_mark_crashed() under share->intern_lock, but mi_mark_crashed() itself locks this mutex. * handler::close() required table to be unlocked, but failed external_lock didn't count as unlock * mysql_unlock_tables() ignored all unlock errors, but they still set the error status in stmt_da.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index fc70ed5affc..e51f17f1712 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -5944,7 +5944,7 @@ int handler::ha_external_lock(THD *thd, int lock_type)
MYSQL_TABLE_LOCK_WAIT(m_psi, PSI_TABLE_EXTERNAL_LOCK, lock_type,
{ error= external_lock(thd, lock_type); })
- if (error == 0)
+ if (error == 0 || lock_type == F_UNLCK)
{
m_lock_type= lock_type;
cached_table_flags= table_flags();