summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-09-26 13:18:22 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-09-26 13:18:22 +0300
commit3e4931cdf3485a8762235401bd8ca3128ab31a4e (patch)
tree90c8b33a96ef52afa9337463109e8667cea1bf32
parentb6bb64e54a3e34a20cda34e25b6ec62a097955ef (diff)
downloadmariadb-git-3e4931cdf3485a8762235401bd8ca3128ab31a4e.tar.gz
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.
-rw-r--r--storage/innobase/lock/lock0lock.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index f4a57e4955a..28055676f74 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -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;
};
/*********************************************************************//**