diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 5847394ae51..108f9686def 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1979,6 +1979,11 @@ bool debug_sync_set_action(THD *thd, const char *action_str, size_t len) { assert(thd); assert(action_str); + // A zero value keeps the facility disabled. + if (!opt_debug_sync_timeout) { + return false; + } + value = strmake_root(thd->mem_root, action_str, len); rc = debug_sync_eval_action(thd, value); return rc;