summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorVasil Dimov <vasil.dimov@oracle.com>2013-06-18 17:12:28 +0300
committerVasil Dimov <vasil.dimov@oracle.com>2013-06-18 17:12:28 +0300
commit9696ca9d877c38906dff1a9b3f8ac7fd6d8d3d44 (patch)
treed889e93741f7ddee39f6468ee541d22f1672ab61 /storage
parent27d831b91eb22583afd18aebcdbba22b3f385661 (diff)
downloadmariadb-git-9696ca9d877c38906dff1a9b3f8ac7fd6d8d3d44.tar.gz
Fix Bug#16907783 5.5 STILL CRASHES IN DICT_UPDATE_STATISTICS WITH CONCURRENT
DDL AND I_S QUERIES Skip partially created indexes (ones whose name starts with TEMP_INDEX_PREFIX) from stats gathering. Because InnoDB reports HA_INPLACE_ADD_INDEX_NO_WRITE to MySQL, the latter allows parallel execution of ha_innobase::add_index() and ha_innobase::info(). Reviewed by: Inaam (rb:2613)
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/dict/dict0dict.c19
-rw-r--r--storage/innobase/handler/ha_innodb.cc2
2 files changed, 17 insertions, 4 deletions
diff --git a/storage/innobase/dict/dict0dict.c b/storage/innobase/dict/dict0dict.c
index 699897b41f8..0cf8efd0466 100644
--- a/storage/innobase/dict/dict0dict.c
+++ b/storage/innobase/dict/dict0dict.c
@@ -23,6 +23,8 @@ Data dictionary system
Created 1/8/1996 Heikki Tuuri
***********************************************************************/
+#include <my_sys.h>
+
#include "dict0dict.h"
#ifdef UNIV_NONINL
@@ -1832,6 +1834,11 @@ undo_size_ok:
dict_index_is_ibuf(index)
? SYNC_IBUF_INDEX_TREE : SYNC_INDEX_TREE);
+ DBUG_EXECUTE_IF(
+ "index_partially_created_should_kick",
+ DEBUG_SYNC_C("index_partially_created");
+ );
+
if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
new_index->stat_n_diff_key_vals = mem_heap_alloc(
@@ -4499,7 +4506,13 @@ dict_update_statistics(
return;
}
- do {
+ for (; index != NULL; index = dict_table_get_next_index(index)) {
+
+ /* Skip incomplete indexes. */
+ if (index->name[0] == TEMP_INDEX_PREFIX) {
+ continue;
+ }
+
if (UNIV_LIKELY
(srv_force_recovery < SRV_FORCE_NO_IBUF_MERGE
|| (srv_force_recovery < SRV_FORCE_NO_LOG_REDO
@@ -4553,9 +4566,7 @@ fake_statistics:
(1 + dict_index_get_n_unique(index))
* sizeof(*index->stat_n_non_null_key_vals));
}
-
- index = dict_table_get_next_index(index);
- } while (index);
+ }
index = dict_table_get_first_index(table);
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index 86cf458c7ca..e6a5c731d5d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -8130,6 +8130,8 @@ ha_innobase::info_low(
prebuilt->trx->op_info = "updating table statistics";
+ DEBUG_SYNC_C("info_before_stats_update");
+
dict_update_statistics(
ib_table,
FALSE, /* update even if initialized */