1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

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)
This commit is contained in:
Vasil Dimov
2013-06-18 17:12:28 +03:00
parent e8b7f7b449
commit 0818d6c7e2
2 changed files with 17 additions and 4 deletions

View File

@@ -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);

View File

@@ -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 */