From 365bd6eb6ef24b7a927651111fb724166ba77062 Mon Sep 17 00:00:00 2001 From: "heikki@donna.mysql.fi" <> Date: Mon, 19 Nov 2001 13:11:37 +0200 Subject: srv0srv.c: Fix a seg fault if a lock wait timeout is exceeded at the some time someone grants the lock --- innobase/srv/srv0srv.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'innobase') diff --git a/innobase/srv/srv0srv.c b/innobase/srv/srv0srv.c index bebb0b1f8ea..37bf59b6b9a 100644 --- a/innobase/srv/srv0srv.c +++ b/innobase/srv/srv0srv.c @@ -2144,10 +2144,14 @@ loop: /* Timeout exceeded or a wrap-around in system time counter: cancel the lock request queued by the transaction and release possible - other transactions waiting behind */ - - lock_cancel_waiting_and_release( - thr_get_trx(slot->thr)->wait_lock); + other transactions waiting behind; it is + possible that the lock has already been + granted: in that case do nothing */ + + if (thr_get_trx(slot->thr)->wait_lock) { + lock_cancel_waiting_and_release( + thr_get_trx(slot->thr)->wait_lock); + } } } } -- cgit v1.2.1