diff --git a/storage/innobase/srv/srv0srv.c b/storage/innobase/srv/srv0srv.c index 5445bd264d8..36f0fc0f0cc 100644 --- a/storage/innobase/srv/srv0srv.c +++ b/storage/innobase/srv/srv0srv.c @@ -2322,7 +2322,15 @@ srv_lock_check_wait( srv_sys_mutex_enter(); - slot_trx = thr_get_trx(slot->thr); + /* If the slot has been freed and is not being reused + then the slot->thr entry should be NULL. */ + if (slot->thr != NULL) { + ut_a(slot->in_use) + slot_trx = thr_get_trx(slot->thr); + } else { + ut_a(!slot->in_use) + slot_trx = NULL; + } /* We can't compare the pointers here because the memory can be recycled. Transaction ids are not