Merge commit '05ed272c1627b21ff623b7fdf5a60f2ba2f4f5d0' into develop
This commit is contained in:
commit
dda2c1964d
@ -3156,6 +3156,15 @@ const char* param_type_to_str(const MXS_MODULE_PARAM* params, const char* name)
|
||||
return "<unknown parameter name>";
|
||||
}
|
||||
|
||||
static bool wrong_protocol_type(const std::string& type, const std::string& protocol)
|
||||
{
|
||||
bool have_server_proto = strcasecmp(protocol.c_str(), "mariadbbackend") == 0
|
||||
|| strcasecmp(protocol.c_str(), "mysqlbackend") == 0;
|
||||
bool have_server_type = type == CN_SERVER;
|
||||
|
||||
return have_server_proto != have_server_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check that the configuration objects have valid parameters
|
||||
*
|
||||
@ -3201,6 +3210,14 @@ static bool check_config_objects(CONFIG_CONTEXT* context)
|
||||
continue;
|
||||
}
|
||||
|
||||
// TODO: Separate the listener and server protocol objects, hard-coded checks are not good
|
||||
if (wrong_protocol_type(type, obj->m_parameters.get_string(CN_PROTOCOL)))
|
||||
{
|
||||
MXS_ERROR("Wrong protocol module type for '%s'", obj->m_name.c_str());
|
||||
rval = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
mxb_assert(param_set);
|
||||
std::vector<std::string> to_be_removed;
|
||||
|
||||
|
@ -4287,7 +4287,7 @@ int validate_connection_name(ROUTER_INSTANCE* router, const std::string& name, c
|
||||
|
||||
int index = -1;
|
||||
|
||||
char custom_message[BINLOG_ERROR_MSG_LEN + 1];
|
||||
char custom_message[BINLOG_ERROR_MSG_LEN];
|
||||
|
||||
const char* message = DEFAULT_MESSAGE;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user