From f9f33b85be6b5006f0ecd0de7961c71d415a9d73 Mon Sep 17 00:00:00 2001 From: Monty Date: Mon, 30 Mar 2020 20:12:02 +0300 Subject: Handle errors from external_unlock & mysql_unlock_tables Other things: - Handler errors from ha_maria::implict_commit - Disable DBUG in safe_mutex_lock to get trace file easier to read --- mysys/thr_mutex.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mysys/thr_mutex.c') diff --git a/mysys/thr_mutex.c b/mysys/thr_mutex.c index 4f495048f63..9db1e0efabf 100644 --- a/mysys/thr_mutex.c +++ b/mysys/thr_mutex.c @@ -233,6 +233,7 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file, int error; DBUG_PRINT("mutex", ("%s (0x%lx) locking", mp->name ? mp->name : "Null", (ulong) mp)); + DBUG_PUSH(""); pthread_mutex_lock(&mp->global); if (!mp->file) @@ -283,7 +284,7 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file, { error= pthread_mutex_trylock(&mp->mutex); if (error == EBUSY) - return error; + goto end; } else error= pthread_mutex_lock(&mp->mutex); @@ -393,7 +394,10 @@ int safe_mutex_lock(safe_mutex_t *mp, myf my_flags, const char *file, } } - DBUG_PRINT("mutex", ("%s (0x%lx) locked", mp->name, (ulong) mp)); +end: + DBUG_POP(); + if (!error) + DBUG_PRINT("mutex", ("%s (0x%lx) locked", mp->name, (ulong) mp)); return error; } -- cgit v1.2.1