Add check for NULL authenticator
The server creation was missing a check for NULL authenticator parameter.
This commit is contained in:
@ -1264,6 +1264,7 @@ bool server_create(const char *name, const char *address, const char *port,
|
|||||||
|
|
||||||
if (server_find_by_unique_name(name) == NULL)
|
if (server_find_by_unique_name(name) == NULL)
|
||||||
{
|
{
|
||||||
|
// TODO: Get default values from the protocol module
|
||||||
if (port == NULL)
|
if (port == NULL)
|
||||||
{
|
{
|
||||||
port = "3306";
|
port = "3306";
|
||||||
@ -1272,6 +1273,12 @@ bool server_create(const char *name, const char *address, const char *port,
|
|||||||
{
|
{
|
||||||
protocol = "MySQLBackend";
|
protocol = "MySQLBackend";
|
||||||
}
|
}
|
||||||
|
if (authenticator == NULL && (authenticator = get_default_authenticator(protocol)) == NULL)
|
||||||
|
{
|
||||||
|
MXS_ERROR("No authenticator defined for server '%s' and no default "
|
||||||
|
"authenticator for protocol '%s'.", name, protocol);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** First check if this service has been created before */
|
/** First check if this service has been created before */
|
||||||
SERVER *server = find_destroyed_server(name, protocol, authenticator,
|
SERVER *server = find_destroyed_server(name, protocol, authenticator,
|
||||||
|
Reference in New Issue
Block a user