diff options
author | Dmitry Lenev <dlenev@mysql.com> | 2010-02-15 14:23:36 +0300 |
---|---|---|
committer | Dmitry Lenev <dlenev@mysql.com> | 2010-02-15 14:23:36 +0300 |
commit | 68710e2b3681f8405dd57634247ba1b862247f78 (patch) | |
tree | 39dde6eee8e819794694a0c0ad30156877e68e6a /sql/mdl.h | |
parent | 22bc48b2802143e5cebcd7f12c823259c10de265 (diff) | |
download | mariadb-git-68710e2b3681f8405dd57634247ba1b862247f78.tar.gz |
Fix for bug #51136 "Crash in pthread_rwlock_rdlock on
TEMPORARY + HANDLER + LOCK + SP".
Server crashed when one:
1) Opened HANDLER or acquired global read lock
2) Then locked one or several temporary tables with
LOCK TABLES statement (but no base tables).
3) Then issued any statement causing commit (explicit
or implicit).
4) Issued statement which should have closed HANDLER
or released global read lock.
The problem was that when entering LOCK TABLES mode in the
scenario described above we incorrectly set transactional
MDL sentinel to zero. As result during commit all metadata
locks were released (including lock for open HANDLER or
global metadata shared lock). Indeed, attempt to release
metadata lock for the second time which happened during
HANLDER CLOSE or during release of GLR caused crash.
This patch fixes problem by changing MDL_context's
set_trans_sentinel() method to set sentinel to correct
value (it should point to the most recent ticket).
Diffstat (limited to 'sql/mdl.h')
-rw-r--r-- | sql/mdl.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/mdl.h b/sql/mdl.h index d43548fb65f..59bc1f64762 100644 --- a/sql/mdl.h +++ b/sql/mdl.h @@ -501,7 +501,7 @@ public: void set_trans_sentinel() { - m_trans_sentinel= mdl_savepoint(); + m_trans_sentinel= m_tickets.front(); } MDL_ticket *trans_sentinel() const { return m_trans_sentinel; } |