From 924a81a548994bd61e9b8ea662bdb64ef1c12ea0 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 18 Feb 2017 15:06:25 +0100 Subject: [PATCH] bugfix: DEBUG_SYNC() invoked with no THD While DEBUG_SYNC doesn't make sense without a valid THD, it might be put in the code that's invoked both within and outside of a THD context (e.g. in maria_open(), there is no THD during recovery). --- sql/debug_sync.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 4cff1c09ba7..82203505f50 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1520,6 +1520,8 @@ static void debug_sync(THD *thd, const char *sync_point_name, size_t name_len) { if (!thd) thd= current_thd; + if (!thd) + return; st_debug_sync_control *ds_control= thd->debug_sync_control; st_debug_sync_action *action;