diff --git a/sql/set_var.cc b/sql/set_var.cc index ffc2ab3c745..c05e29be4d1 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1119,10 +1119,13 @@ int set_var::update(THD *thd) { int ret = 0; /* for persist only syntax do not update the value */ if (type != OPT_PERSIST_ONLY) { + auto saved_var_source = var->get_source(); + var->set_source(enum_variable_source::DYNAMIC); if (value) ret = (int)var->update(thd, this); else ret = (int)var->set_default(thd, this); + var->set_source(saved_var_source); } /* For PERSIST_ONLY syntax we dont change the value of the variable