Merge branch '2.3' into develop

This commit is contained in:
Markus Mäkelä
2019-02-01 13:55:54 +02:00
31 changed files with 743 additions and 175 deletions

View File

@ -1217,6 +1217,10 @@ bool config_load_global(const char* filename)
"cache. To enable it, add '%s' to the configuration file.",
CN_QUERY_CLASSIFIER_CACHE_SIZE);
}
else if (gateway.qc_cache_properties.max_size == 0)
{
MXS_NOTICE("Query classifier cache is disabled");
}
else
{
MXS_NOTICE("Using up to %s of memory for query classifier cache",
@ -1275,6 +1279,34 @@ const MXS_MODULE* get_module(CONFIG_CONTEXT* obj, const char* param_name, const
return module ? get_module(module, module_type) : NULL;
}
const char* get_missing_module_parameter_name(const CONFIG_CONTEXT* obj)
{
std::string type = config_get_string(obj->parameters, CN_TYPE);
if (type == CN_SERVICE && !config_get_param(obj->parameters, CN_ROUTER))
{
return CN_ROUTER;
}
else if (type == CN_LISTENER && !config_get_param(obj->parameters, CN_PROTOCOL))
{
return CN_PROTOCOL;
}
else if (type == CN_SERVER && !config_get_param(obj->parameters, CN_PROTOCOL))
{
return CN_PROTOCOL;
}
else if (type == CN_MONITOR && !config_get_param(obj->parameters, CN_MODULE))
{
return CN_MODULE;
}
else if (type == CN_FILTER && !config_get_param(obj->parameters, CN_MODULE))
{
return CN_MODULE;
}
return nullptr;
}
std::pair<const MXS_MODULE_PARAM*, const MXS_MODULE*> get_module_details(const CONFIG_CONTEXT* obj)
{
std::string type = config_get_string(obj->parameters, CN_TYPE);
@ -3038,6 +3070,15 @@ static bool check_config_objects(CONFIG_CONTEXT* context)
continue;
}
const char* no_module_defined = get_missing_module_parameter_name(obj);
if (no_module_defined)
{
MXS_ERROR("'%s' is missing the required parameter '%s'", obj->object, no_module_defined);
rval = false;
continue;
}
const MXS_MODULE_PARAM* param_set = nullptr;
const MXS_MODULE* mod = nullptr;
std::tie(param_set, mod) = get_module_details(obj);