mirror of
https://github.com/MariaDB/server.git
synced 2025-02-01 03:21:53 +01:00
Fix an assertion failure with UNIV_DEBUG is set. Initialize a
dict_index_t structure to NULL in dict_load_index(), we could enter SYS_INDEXES and got table id value comparision failure for system tables such as SYS_TABLES. In addition, remove dict_sys mutex assertion when fill I_S table, as we no longer hold mutex accross the fill operation. rb://367 approved by Marko.
This commit is contained in:
parent
00dfb12b92
commit
a51779c7c2
2 changed files with 11 additions and 15 deletions
|
@ -1168,6 +1168,10 @@ static const char* dict_load_index_id_err = "SYS_INDEXES.TABLE_ID mismatch";
|
|||
|
||||
/********************************************************************//**
|
||||
Loads an index definition from a SYS_INDEXES record to dict_index_t.
|
||||
If "cached" is set to "TRUE", we will create a dict_index_t structure
|
||||
and fill it accordingly. Otherwise, the dict_index_t will
|
||||
be supplied by the caller and filled with information read from
|
||||
the record.
|
||||
@return error message, or NULL on success */
|
||||
UNIV_INTERN
|
||||
const char*
|
||||
|
@ -1192,6 +1196,12 @@ dict_load_index_low(
|
|||
ulint type;
|
||||
ulint space;
|
||||
|
||||
if (cached) {
|
||||
/* If "cached" is set to TRUE, no dict_index_t will
|
||||
be supplied. Initialize "*index" to NULL */
|
||||
*index = NULL;
|
||||
}
|
||||
|
||||
if (UNIV_UNLIKELY(rec_get_deleted_flag(rec, 0))) {
|
||||
return(dict_load_index_del);
|
||||
}
|
||||
|
@ -1331,7 +1341,7 @@ dict_load_indexes(
|
|||
btr_pcur_open_on_user_rec(sys_index, tuple, PAGE_CUR_GE,
|
||||
BTR_SEARCH_LEAF, &pcur, &mtr);
|
||||
for (;;) {
|
||||
dict_index_t* index;
|
||||
dict_index_t* index = NULL;
|
||||
const char* err_msg;
|
||||
|
||||
if (!btr_pcur_is_on_user_rec(&pcur)) {
|
||||
|
|
|
@ -1978,8 +1978,6 @@ i_s_dict_fill_sys_tables(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_tables");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
table_id = ut_conv_dulint_to_longlong(table->id);
|
||||
|
@ -2245,8 +2243,6 @@ i_s_dict_fill_sys_tablestats(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_tablestats");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
table_id = ut_conv_dulint_to_longlong(table->id);
|
||||
|
@ -2510,8 +2506,6 @@ i_s_dict_fill_sys_indexes(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_indexes");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
table_id = ut_conv_dulint_to_longlong(tableid);
|
||||
|
@ -2754,8 +2748,6 @@ i_s_dict_fill_sys_columns(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_columns");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
table_id = ut_conv_dulint_to_longlong(tableid);
|
||||
|
@ -2966,8 +2958,6 @@ i_s_dict_fill_sys_fields(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_fields");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
index_id = ut_conv_dulint_to_longlong(indexid);
|
||||
|
@ -3194,8 +3184,6 @@ i_s_dict_fill_sys_foreign(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_foreign");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
OK(field_store_string(fields[SYS_FOREIGN_ID], foreign->id));
|
||||
|
@ -3411,8 +3399,6 @@ i_s_dict_fill_sys_foreign_cols(
|
|||
|
||||
DBUG_ENTER("i_s_dict_fill_sys_foreign_cols");
|
||||
|
||||
ut_ad(mutex_own(&(dict_sys->mutex)));
|
||||
|
||||
fields = table_to_fill->field;
|
||||
|
||||
OK(field_store_string(fields[SYS_FOREIGN_COL_ID], name));
|
||||
|
|
Loading…
Add table
Reference in a new issue