diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 3c11e6731b7f983e38afd72a5c4294733400b885..6ffa8fb3ea80df1f5ccadfefa613b16a607c4390 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -1742,6 +1742,7 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
       - block assigned but not yet read from file (invalid data).
   */
 
+#if THREAD
   if (keycache->in_resize)
   {
     /* This is a request during a resize operation */
@@ -1983,6 +1984,9 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
     }
     DBUG_RETURN(0);
   }
+#else /* THREAD */
+  DBUG_ASSERT(!keycache->in_resize);
+#endif
 
   if (page_status == PAGE_READ &&
       (block->status & (BLOCK_IN_EVICTION | BLOCK_IN_SWITCH |