Fix to MXS-288: https://mariadb.atlassian.net/browse/MXS-288 Added MySQL 5.7 authentication

The change to the mysql.user table in MySQL 5.7 caused MaxScale to stop
working with it. This commit adds functionality that checks which version of
the user data query should be made. It also moves common code related to
server version strings to server.c
This commit is contained in:
Markus Makela
2015-11-12 11:57:29 +02:00
parent bdfd72404b
commit 5efd564573
7 changed files with 120 additions and 39 deletions

View File

@ -942,3 +942,24 @@ int i;
return ServerBits[i].bit;
return 0;
}
/**
* Set the version string of the server.
* @param server Server to update
* @param string Version string
* @return True if the assignment of the version string was successful, false if
* memory allocation failed.
*/
bool server_set_version_string(SERVER* server, const char* string)
{
bool rval = true;
spinlock_acquire(&server->lock);
free(server->server_string);
if ((server->server_string = strdup(string)) == NULL)
{
MXS_ERROR("Memory allocation failed.");
rval = false;
}
spinlock_release(&server->lock);
return rval;
}