Commit 3e4931cd authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-20675 Crash in SHOW ENGINE INNODB STATUS with innodb_force_recovery=5

lock_print_info::operator(): Do not dereference purge_sys.query in case
it is NULL. We would not initialize purge_sys if innodb_force_recovery
is set to 5 or 6.

The test case will be added by merge from 10.2.
parent b6bb64e5
......@@ -4684,12 +4684,15 @@ lock_trx_print_locks(
/** Functor to display all transactions */
struct lock_print_info
{
lock_print_info(FILE* file, time_t now) : file(file), now(now) {}
lock_print_info(FILE* file, time_t now) :
file(file), now(now),
purge_trx(purge_sys.query ? purge_sys.query->trx : NULL)
{}
void operator()(const trx_t* trx) const
{
ut_ad(mutex_own(&trx_sys.mutex));
if (trx == purge_sys.query->trx)
if (UNIV_UNLIKELY(trx == purge_trx))
return;
lock_trx_print_wait_and_mvcc_state(file, trx, now);
......@@ -4699,6 +4702,7 @@ struct lock_print_info
FILE* const file;
const time_t now;
const trx_t* const purge_trx;
};
/*********************************************************************//**
......
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