From a758479c103f513077a0b90a9285b17229ee8289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 3 Jan 2017 15:44:44 +0200 Subject: [PATCH] Post-fix for MDEV-11688 fil_crypt_threads_end() tries to create threads fil_crypt_threads_cleanup(): Do nothing if nothing was initialized. --- storage/innobase/fil/fil0crypt.cc | 3 +++ storage/xtradb/fil/fil0crypt.cc | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/storage/innobase/fil/fil0crypt.cc b/storage/innobase/fil/fil0crypt.cc index ff30b3a09e9..a0c9fbf57ac 100644 --- a/storage/innobase/fil/fil0crypt.cc +++ b/storage/innobase/fil/fil0crypt.cc @@ -2397,6 +2397,9 @@ void fil_crypt_threads_cleanup() /*=======================*/ { + if (!fil_crypt_threads_inited) { + return; + } os_event_destroy(fil_crypt_event); os_event_destroy(fil_crypt_threads_event); mutex_free(&fil_crypt_threads_mutex); diff --git a/storage/xtradb/fil/fil0crypt.cc b/storage/xtradb/fil/fil0crypt.cc index 3670f0fac4f..6252a5470bd 100644 --- a/storage/xtradb/fil/fil0crypt.cc +++ b/storage/xtradb/fil/fil0crypt.cc @@ -2465,8 +2465,9 @@ void fil_crypt_threads_end() /*===================*/ { - /* stop threads */ - fil_crypt_set_thread_cnt(0); + if (fil_crypt_threads_inited) { + fil_crypt_set_thread_cnt(0); + } } /********************************************************************* @@ -2476,6 +2477,9 @@ void fil_crypt_threads_cleanup() /*=======================*/ { + if (!fil_crypt_threads_inited) { + return; + } os_event_free(fil_crypt_event); os_event_free(fil_crypt_threads_event); mutex_free(&fil_crypt_threads_mutex);