summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lindström <jan.lindstrom@mariadb.com>2021-02-24 13:30:35 +0200
committerJan Lindström <jan.lindstrom@mariadb.com>2021-02-24 13:31:36 +0200
commitcea03285ecf79312ed70cbd00fbe4233c2ea040f (patch)
tree86c3c2d835df45cb8097141e704bbc0a1295fca9
parentf83e2ecc501573cc500c2ee420e868a40b7910f2 (diff)
downloadmariadb-git-cea03285ecf79312ed70cbd00fbe4233c2ea040f.tar.gz
MDEV-24967 : Signal 11 on ha_innodb.cc::bg_wsrep_kill_trx line 18611
Null poiter reference in case where bf_thd has no trx .e.g. when we have MDL-conflict.
-rw-r--r--storage/innobase/handler/ha_innodb.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index d54987889fd..f870cf7793b 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -18688,10 +18688,12 @@ static void bg_wsrep_kill_trx(void *void_arg)
/* apparently victim trx was meanwhile rolled back.
tell bf thd not to wait, in case it already started to */
trx_t *trx= thd_to_trx(bf_thd);
- if (lock_t *lock= trx->lock.wait_lock) {
- trx_mutex_enter(trx);
- lock_cancel_waiting_and_release(lock);
- trx_mutex_exit(trx);
+ /* note that bf_thd might not have trx e.g. in case of
+ MDL-conflict. */
+ if (lock_t *lock= (trx ? trx->lock.wait_lock : NULL)) {
+ trx_mutex_enter(trx);
+ lock_cancel_waiting_and_release(lock);
+ trx_mutex_exit(trx);
}
goto ret1;
}