From 5b18ade0df6b86ab9b4cffcb0bbd122ae3317b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 3 Jun 2020 16:49:06 +0300 Subject: MDEV-22787 fts_optimize_shutdown() deletes timer prematurely fts_optimize_shutdown(): Wait for fts_optimize_callback() to terminate before deleting the timer that it uses. --- storage/innobase/fts/fts0opt.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'storage/innobase') diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 849cbb7e15b..325d1366f72 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -3014,8 +3014,6 @@ fts_optimize_shutdown() /* We tell the OPTIMIZE thread to switch to state done, we can't delete the work queue here because the add thread needs deregister the FTS tables. */ - delete timer; - timer = NULL; task_group.cancel_pending(&task); msg = fts_optimize_create_msg(FTS_MSG_STOP, NULL); @@ -3026,6 +3024,8 @@ fts_optimize_shutdown() os_event_destroy(fts_opt_shutdown_event); fts_opt_thd = NULL; + delete timer; + timer = NULL; } /** Sync the table during commit phase -- cgit v1.2.1