summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorSachin Setiya <sachin.setiya@mariadb.com>2017-03-17 02:05:20 +0530
committerSachin Setiya <sachin.setiya@mariadb.com>2017-03-17 02:05:20 +0530
commitf66395f7c06f357e7ace74317e6563a1e5dbc3ae (patch)
treed1669b069aa722c9c73abe52e5924b7bbba41b39 /sql/sql_class.cc
parentc401773c8dd97bd9f6bf6cff9fcafdf24fbd0ee1 (diff)
parentc4f3e64c23fe7f7fd18c0a79f87f9771df15fe9f (diff)
downloadmariadb-git-f66395f7c06f357e7ace74317e6563a1e5dbc3ae.tar.gz
Merge tag 'mariadb-10.0.30' into bb-sachin-10.0-galera-merge
Signed-off-by: Sachin Setiya <sachin.setiya@mariadb.com>
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index b210a4d32dc..57c228900fe 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -1272,7 +1272,6 @@ THD::THD()
m_internal_handler= NULL;
m_binlog_invoker= INVOKER_NONE;
- arena_for_cached_items= 0;
memset(&invoker_user, 0, sizeof(invoker_user));
memset(&invoker_host, 0, sizeof(invoker_host));
prepare_derived_at_open= FALSE;
@@ -6849,7 +6848,13 @@ wait_for_commit::reinit()
So in this case, do a re-init of the mutex. In release builds, we want to
avoid the overhead of a re-init though.
+
+ To ensure that no one is locking the mutex, we take a lock of it first.
+ For full explanation, see wait_for_commit::~wait_for_commit()
*/
+ mysql_mutex_lock(&LOCK_wait_commit);
+ mysql_mutex_unlock(&LOCK_wait_commit);
+
mysql_mutex_destroy(&LOCK_wait_commit);
mysql_mutex_init(key_LOCK_wait_commit, &LOCK_wait_commit, MY_MUTEX_INIT_FAST);
#endif