MXS-1249: Modifications after rebase on develop
This commit is contained in:
@ -88,9 +88,7 @@ mxs_mysql_name_kind_t mxs_mysql_name_to_pcre(char *pcre,
|
|||||||
*
|
*
|
||||||
* @param mysql A MySQL handle to the server.
|
* @param mysql A MySQL handle to the server.
|
||||||
* @param server The server whose version information should be updated.
|
* @param server The server whose version information should be updated.
|
||||||
*
|
|
||||||
* @return True, if the information could be set, false if an error occurred.
|
|
||||||
*/
|
*/
|
||||||
bool mxs_mysql_set_server_version(MYSQL* mysql, SERVER* server);
|
void mxs_mysql_set_server_version(MYSQL* mysql, SERVER* server);
|
||||||
|
|
||||||
MXS_END_DECLS
|
MXS_END_DECLS
|
||||||
|
|||||||
@ -286,10 +286,8 @@ mxs_mysql_name_kind_t mxs_mysql_name_to_pcre(char *pcre,
|
|||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mxs_mysql_set_server_version(MYSQL* mysql, SERVER* server)
|
void mxs_mysql_set_server_version(MYSQL* mysql, SERVER* server)
|
||||||
{
|
{
|
||||||
bool rv = false;
|
|
||||||
|
|
||||||
const char* s = mysql_get_server_info(mysql);
|
const char* s = mysql_get_server_info(mysql);
|
||||||
|
|
||||||
if (s)
|
if (s)
|
||||||
@ -300,8 +298,6 @@ bool mxs_mysql_set_server_version(MYSQL* mysql, SERVER* server)
|
|||||||
unsigned long minor = (v - major * 10000) / 100;
|
unsigned long minor = (v - major * 10000) / 100;
|
||||||
unsigned long patch = v - major * 10000 - minor * 100;
|
unsigned long patch = v - major * 10000 - minor * 100;
|
||||||
|
|
||||||
rv = server_set_version(server, s, major, minor, patch);
|
server_set_version(server, s, major, minor, patch);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1114,22 +1114,14 @@ void server_set_version_string(SERVER* server, const char* version)
|
|||||||
* @param major The major version.
|
* @param major The major version.
|
||||||
* @param minor The minor version.
|
* @param minor The minor version.
|
||||||
* @param patch The patch version.
|
* @param patch The patch version.
|
||||||
*
|
|
||||||
* @return True if the assignment of the version string was successful, false if
|
|
||||||
* memory allocation failed.
|
|
||||||
*/
|
*/
|
||||||
bool server_set_version(SERVER* server, const char* string, uint32_t major, uint32_t minor, uint32_t patch)
|
void server_set_version(SERVER* server, const char* string, uint32_t major, uint32_t minor, uint32_t patch)
|
||||||
{
|
{
|
||||||
bool rv = server_set_version_string(server, string);
|
server_set_version_string(server, string);
|
||||||
|
|
||||||
if (rv)
|
|
||||||
{
|
|
||||||
server->version.major = major;
|
server->version.major = major;
|
||||||
server->version.minor = minor;
|
server->version.minor = minor;
|
||||||
server->version.patch = patch;
|
server->version.patch = patch;
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -315,7 +315,7 @@ monitorDatabase(MXS_MONITOR *mon, MXS_MONITOR_SERVERS *database)
|
|||||||
|
|
||||||
/* get server version string */
|
/* get server version string */
|
||||||
mxs_mysql_set_server_version(database->con, database->server);
|
mxs_mysql_set_server_version(database->con, database->server);
|
||||||
server_string = database->server->server_string;
|
server_string = database->server->version_string;
|
||||||
|
|
||||||
/* Check if the the Galera FSM shows this node is joined to the cluster */
|
/* Check if the the Galera FSM shows this node is joined to the cluster */
|
||||||
char *cluster_member = "SHOW STATUS WHERE Variable_name IN"
|
char *cluster_member = "SHOW STATUS WHERE Variable_name IN"
|
||||||
|
|||||||
@ -263,7 +263,7 @@ monitorDatabase(MXS_MONITOR* mon, MXS_MONITOR_SERVERS *database)
|
|||||||
|
|
||||||
/* get server version string */
|
/* get server version string */
|
||||||
mxs_mysql_set_server_version(database->con, database->server);
|
mxs_mysql_set_server_version(database->con, database->server);
|
||||||
server_string = database->server->server_string;
|
server_string = database->server->version_string;
|
||||||
|
|
||||||
/* get server_id form current node */
|
/* get server_id form current node */
|
||||||
if (mysql_query(database->con, "SELECT @@server_id") == 0
|
if (mysql_query(database->con, "SELECT @@server_id") == 0
|
||||||
|
|||||||
@ -728,7 +728,7 @@ monitorDatabase(MXS_MONITOR *mon, MXS_MONITOR_SERVERS *database)
|
|||||||
|
|
||||||
/* get server version string */
|
/* get server version string */
|
||||||
mxs_mysql_set_server_version(database->con, database->server);
|
mxs_mysql_set_server_version(database->con, database->server);
|
||||||
server_string = database->server->server_string;
|
server_string = database->server->version_string;
|
||||||
|
|
||||||
MYSQL_SERVER_INFO *serv_info = hashtable_fetch(handle->server_info, database->server->unique_name);
|
MYSQL_SERVER_INFO *serv_info = hashtable_fetch(handle->server_info, database->server->unique_name);
|
||||||
ss_dassert(serv_info);
|
ss_dassert(serv_info);
|
||||||
|
|||||||
@ -226,7 +226,7 @@ monitorDatabase(MXS_MONITOR_SERVERS *database, char *defaultUser, char *defaultP
|
|||||||
|
|
||||||
/* get server version string */
|
/* get server version string */
|
||||||
mxs_mysql_set_server_version(database->con, database->server);
|
mxs_mysql_set_server_version(database->con, database->server);
|
||||||
server_string = database->server->server_string;
|
server_string = database->server->version_string;
|
||||||
|
|
||||||
/* Check if the the SQL node is able to contact one or more data nodes */
|
/* Check if the the SQL node is able to contact one or more data nodes */
|
||||||
if (mysql_query(database->con, "SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'") == 0
|
if (mysql_query(database->con, "SHOW STATUS LIKE 'Ndb_number_of_ready_data_nodes'") == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user