diff --git a/sql/debug_sync.cc b/sql/debug_sync.cc index 8e42f4fa11d5..71d78c48b392 100644 --- a/sql/debug_sync.cc +++ b/sql/debug_sync.cc @@ -1975,6 +1975,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;