MXS-2304 Convert static config parameter methods to non-static
Parameter handling changed in several places.
This commit is contained in:
@ -320,10 +320,10 @@ int test(FilterModule& filter_module, const TEST_CASE& tc)
|
||||
int rv = 1;
|
||||
|
||||
auto params = filter_module.create_default_parameters();
|
||||
MXS_CONFIG_PARAMETER::set(¶ms, "cache_in_transactions", to_string(tc.cit));
|
||||
MXS_CONFIG_PARAMETER::set(¶ms, "debug", "31");
|
||||
MXS_CONFIG_PARAMETER::set(¶ms, "cached_data", "shared");
|
||||
MXS_CONFIG_PARAMETER::set(¶ms, "selects", "verify_cacheable");
|
||||
params->set("cache_in_transactions", to_string(tc.cit));
|
||||
params->set("debug", "31");
|
||||
params->set("cached_data", "shared");
|
||||
params->set("selects", "verify_cacheable");
|
||||
|
||||
auto_ptr<FilterModule::Instance> sInstance = filter_module.createInstance("test", params);
|
||||
|
||||
|
@ -817,8 +817,8 @@ int test(FilterModule& filter_module, const FW_TEST& t)
|
||||
file.write(t.zRules);
|
||||
|
||||
auto params = filter_module.create_default_parameters();
|
||||
MXS_CONFIG_PARAMETER::set(¶ms, "action", zAction);
|
||||
MXS_CONFIG_PARAMETER::set(¶ms, "rules", file.name());
|
||||
params->set("action", zAction);
|
||||
params->set("rules", file.name());
|
||||
|
||||
auto_ptr<FilterModule::Instance> sInstance = filter_module.createInstance("test", params);
|
||||
|
||||
|
@ -23,13 +23,13 @@ namespace maxscale
|
||||
|
||||
MXS_CONFIG_PARAMETER* Module::create_default_parameters() const
|
||||
{
|
||||
MXS_CONFIG_PARAMETER* rval = nullptr;
|
||||
MXS_CONFIG_PARAMETER* rval = new MXS_CONFIG_PARAMETER;
|
||||
const MXS_MODULE_PARAM* param_definition = m_module.parameters;
|
||||
while (param_definition->name)
|
||||
{
|
||||
if (param_definition->default_value)
|
||||
{
|
||||
MXS_CONFIG_PARAMETER::set(&rval, param_definition->name, param_definition->default_value);
|
||||
rval->set(param_definition->name, param_definition->default_value);
|
||||
}
|
||||
++param_definition;
|
||||
}
|
||||
|
@ -698,7 +698,7 @@ void MariaDBMonitor::assign_new_master(MariaDBServer* new_master)
|
||||
*/
|
||||
void MariaDBMonitor::disable_setting(const std::string& setting)
|
||||
{
|
||||
MXS_CONFIG_PARAMETER::set(¶meters, setting, "false");
|
||||
parameters->set(setting, "false");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -799,16 +799,15 @@ static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params
|
||||
{
|
||||
// Declared in config.cc and needs to be removed if/when blr is refactored
|
||||
extern const MXS_MODULE_PARAM config_server_params[];
|
||||
MXS_CONFIG_PARAMETER* params = nullptr;
|
||||
MXS_CONFIG_PARAMETER::set_from_list(¶ms,
|
||||
{
|
||||
{"address", "_none_"},
|
||||
{"port", "3306"},
|
||||
{"protocol", "mariadbbackend"},
|
||||
{"authenticator", "MySQLBackendAuth"}
|
||||
}, config_server_params);
|
||||
MXS_CONFIG_PARAMETER params;
|
||||
params.set_from_list({
|
||||
{"address", "_none_"},
|
||||
{"port", "3306"},
|
||||
{"protocol", "mariadbbackend"},
|
||||
{"authenticator", "MySQLBackendAuth"}
|
||||
}, config_server_params);
|
||||
|
||||
Server* server = Server::server_alloc("binlog_router_master_host", params);
|
||||
Server* server = Server::server_alloc("binlog_router_master_host", ¶ms);
|
||||
|
||||
if (server == NULL)
|
||||
{
|
||||
|
@ -133,21 +133,20 @@ int main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
MXS_CONFIG_PARAMETER::free_all(&ctx.parameters);
|
||||
delete ctx.parameters;
|
||||
|
||||
// Declared in config.cc and needs to be removed if/when blr is refactored
|
||||
extern const MXS_MODULE_PARAM config_server_params[];
|
||||
|
||||
MXS_CONFIG_PARAMETER* params = nullptr;
|
||||
MXS_CONFIG_PARAMETER::set_from_list(¶ms,
|
||||
{
|
||||
{"address", "_none_"},
|
||||
{"port", "3306"},
|
||||
{"protocol", "MySQLBackend"},
|
||||
{"authenticator", "MySQLBackendAuth"}
|
||||
}, config_server_params);
|
||||
MXS_CONFIG_PARAMETER params;
|
||||
params.set_from_list({
|
||||
{"address", "_none_"},
|
||||
{"port", "3306"},
|
||||
{"protocol", "MySQLBackend"},
|
||||
{"authenticator", "MySQLBackendAuth"}
|
||||
}, config_server_params);
|
||||
|
||||
Server* server = Server::server_alloc("binlog_router_master_host", params);
|
||||
Server* server = Server::server_alloc("binlog_router_master_host", ¶ms);
|
||||
if (server == NULL)
|
||||
{
|
||||
printf("Failed to allocate 'server' object\n");
|
||||
|
Reference in New Issue
Block a user