Commit 53623d93 authored by Jan Lindström's avatar Jan Lindström

MDEV-8522: InnoDB: Assertion failure in file fil0fil.cc line 475

Analysis: In fil_crypt_space_needs_rotation we first make sure that
tablespace is found and then separately that it is normal tablespace.
Thus, tablespace could be dropped between these two functions calls.

Fix: If space is not found from fil_system return tablespace type
ULINT_UNDEFINED and naturally do not continue rotating space.
parent 62b5a561
......@@ -457,7 +457,7 @@ fil_space_get_latch(
/*******************************************************************//**
Returns the type of a file space.
@return FIL_TABLESPACE or FIL_LOG */
@return ULINT_UNDEFINED, or FIL_TABLESPACE or FIL_LOG */
UNIV_INTERN
ulint
fil_space_get_type(
......@@ -465,6 +465,7 @@ fil_space_get_type(
ulint id) /*!< in: space id */
{
fil_space_t* space;
ulint type = ULINT_UNDEFINED;
ut_ad(fil_system);
......@@ -472,11 +473,13 @@ fil_space_get_type(
space = fil_space_get_by_id(id);
ut_a(space);
mutex_exit(&fil_system->mutex);
return(space->purpose);
if (space) {
type = space->purpose;
}
return(type);
}
#endif /* !UNIV_HOTBACKUP */
......
......@@ -460,7 +460,7 @@ fil_space_get_latch(
/*******************************************************************//**
Returns the type of a file space.
@return FIL_TABLESPACE or FIL_LOG */
@return ULINT_UNDEFINED, or FIL_TABLESPACE or FIL_LOG */
UNIV_INTERN
ulint
fil_space_get_type(
......@@ -468,6 +468,7 @@ fil_space_get_type(
ulint id) /*!< in: space id */
{
fil_space_t* space;
ulint type = ULINT_UNDEFINED;
ut_ad(fil_system);
......@@ -475,11 +476,13 @@ fil_space_get_type(
space = fil_space_get_by_id(id);
ut_a(space);
mutex_exit(&fil_system->mutex);
return(space->purpose);
if (space) {
type = space->purpose;
}
return(type);
}
#endif /* !UNIV_HOTBACKUP */
......
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