From 95606370c89046207c803aab4c1e3d34be2004eb Mon Sep 17 00:00:00 2001 From: Esa Korhonen Date: Mon, 10 Jun 2019 17:06:03 +0300 Subject: [PATCH] MXS-2551 Do not print deprecated parameters into serialized config files In MaxScale, a "deprecated" parameter is not in use and can be ignored. Leaving the parameters out of serialized configuration files avoids warning messages. --- server/core/config.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/server/core/config.cc b/server/core/config.cc index 473f38441..486bf19a9 100644 --- a/server/core/config.cc +++ b/server/core/config.cc @@ -5001,9 +5001,24 @@ void dump_param_list(int file, const MXS_MODULE_PARAM* common_params, const MXS_MODULE_PARAM* module_params) { + // Generate a set which contains deprecated parameter names. These parameters are not printed. + set deprecated_names; + for (auto param_def_list : {common_params, module_params}) + { + const MXS_MODULE_PARAM* param_def = param_def_list; + for (int i = 0; param_def[i].name; i++) + { + if (param_def[i].options & MXS_MODULE_OPT_DEPRECATED) + { + deprecated_names.insert(param_def[i].name); + } + } + } + for (auto p = list; p; p = p->next) { - if (ignored.count(p->name) == 0 && *p->value) + string param_name = p->name; + if (ignored.count(param_name) == 0 && deprecated_names.count(param_name) == 0 && *p->value) { if (dprintf(file, "%s=%s\n", p->name, p->value) == -1) {