Commit 7cf27d38 authored by Vasil Dimov's avatar Vasil Dimov

Revert the fix of Bug#38996 Race condition in ANALYZE TABLE

This is branches/zip@r6032 in SVN and _is part_ of
revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6113
in BZR.

This is being reverted because now the code is serialized directly on
index->stat_n_diff_key_vals[] as the fix for
Bug#53046 dict_update_statistics_low can still be run concurrently on same table
goes.
parent 1a489632
...@@ -108,7 +108,6 @@ static ulong commit_threads = 0; ...@@ -108,7 +108,6 @@ static ulong commit_threads = 0;
static pthread_mutex_t commit_threads_m; static pthread_mutex_t commit_threads_m;
static pthread_cond_t commit_cond; static pthread_cond_t commit_cond;
static pthread_mutex_t commit_cond_m; static pthread_mutex_t commit_cond_m;
static pthread_mutex_t analyze_mutex;
static bool innodb_inited = 0; static bool innodb_inited = 0;
#define INSIDE_HA_INNOBASE_CC #define INSIDE_HA_INNOBASE_CC
...@@ -2237,7 +2236,6 @@ innobase_change_buffering_inited_ok: ...@@ -2237,7 +2236,6 @@ innobase_change_buffering_inited_ok:
pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST); pthread_mutex_init(&prepare_commit_mutex, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST); pthread_mutex_init(&commit_threads_m, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST); pthread_mutex_init(&commit_cond_m, MY_MUTEX_INIT_FAST);
pthread_mutex_init(&analyze_mutex, MY_MUTEX_INIT_FAST);
pthread_cond_init(&commit_cond, NULL); pthread_cond_init(&commit_cond, NULL);
innodb_inited= 1; innodb_inited= 1;
#ifdef MYSQL_DYNAMIC_PLUGIN #ifdef MYSQL_DYNAMIC_PLUGIN
...@@ -2292,7 +2290,6 @@ innobase_end( ...@@ -2292,7 +2290,6 @@ innobase_end(
pthread_mutex_destroy(&prepare_commit_mutex); pthread_mutex_destroy(&prepare_commit_mutex);
pthread_mutex_destroy(&commit_threads_m); pthread_mutex_destroy(&commit_threads_m);
pthread_mutex_destroy(&commit_cond_m); pthread_mutex_destroy(&commit_cond_m);
pthread_mutex_destroy(&analyze_mutex);
pthread_cond_destroy(&commit_cond); pthread_cond_destroy(&commit_cond);
} }
...@@ -7663,15 +7660,9 @@ ha_innobase::analyze( ...@@ -7663,15 +7660,9 @@ ha_innobase::analyze(
THD* thd, /*!< in: connection thread handle */ THD* thd, /*!< in: connection thread handle */
HA_CHECK_OPT* check_opt) /*!< in: currently ignored */ HA_CHECK_OPT* check_opt) /*!< in: currently ignored */
{ {
/* Serialize ANALYZE TABLE inside InnoDB, see
Bug#38996 Race condition in ANALYZE TABLE */
pthread_mutex_lock(&analyze_mutex);
/* Simply call ::info() with all the flags */ /* Simply call ::info() with all the flags */
info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE); info(HA_STATUS_TIME | HA_STATUS_CONST | HA_STATUS_VARIABLE);
pthread_mutex_unlock(&analyze_mutex);
return(0); return(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment