diff --git a/server/core/config.cc b/server/core/config.cc index d3d395a08..adbf12f1a 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -4954,36 +4954,6 @@ MXS_CONFIG_PARAMETER* ParamList::params() } } -void dump_if_changed(const MXS_MODULE_PARAM* params, - int file, - const std::string& key, - const std::string& value) -{ - for (int i = 0; params[i].name; i++) - { - if (params[i].name == key) - { - /** - * This detects only exact matches, not ones that are logically equivalent - * but lexicographically different e.g. 1 and true. This might not - * be a bad thing: it'll distinct user defined values from defaults. - */ - - if (!params[i].default_value || value != params[i].default_value) - { - if (dprintf(file, "%s=%s\n", key.c_str(), value.c_str()) == -1) - { - MXS_ERROR("Failed to serialize service value: %d, %s", - errno, - mxs_strerror(errno)); - } - } - - break; - } - } -} - void dump_param_list(int file, MXS_CONFIG_PARAMETER* list, const std::unordered_set& ignored, @@ -4994,8 +4964,10 @@ void dump_param_list(int file, { if (ignored.count(p->name) == 0 && *p->value) { - dump_if_changed(common_params, file, p->name, p->value); - dump_if_changed(module_params, file, p->name, p->value); + if (dprintf(file, "%s=%s\n", p->name, p->value) == -1) + { + MXS_ERROR("Failed to serialize service value: %d, %s", errno, mxs_strerror(errno)); + } } } }