MXS-2304 Add contains() to test if a parameter exists
Replaces uses of config_get_param() in modules either with contains() or get_string(). The config_get_param() is moved to internal headers, as it allows seeing inside a config setting.
This commit is contained in:
@ -31,9 +31,10 @@ Config::Config(MXS_CONFIG_PARAMETER* conf)
|
||||
ignored_dbs.insert("performance_schema");
|
||||
|
||||
// TODO: Don't process this in the router
|
||||
if (MXS_CONFIG_PARAMETER* p = config_get_param(conf, "ignore_databases"))
|
||||
std::string ignored_dbs_str = conf->get_string("ignore_databases");
|
||||
if (!ignored_dbs_str.empty())
|
||||
{
|
||||
for (const auto& a : mxs::strtok(p->value, ", \t"))
|
||||
for (const auto& a : mxs::strtok(ignored_dbs_str, ", \t"))
|
||||
{
|
||||
ignored_dbs.insert(a);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ SchemaRouter::~SchemaRouter()
|
||||
|
||||
SchemaRouter* SchemaRouter::create(SERVICE* pService, MXS_CONFIG_PARAMETER* params)
|
||||
{
|
||||
if ((config_get_param(params, "auth_all_servers")) == NULL)
|
||||
if (!params->contains("auth_all_servers"))
|
||||
{
|
||||
MXS_NOTICE("Authentication data is fetched from all servers. To disable this "
|
||||
"add 'auth_all_servers=0' to the service.");
|
||||
|
Reference in New Issue
Block a user