Initial changes to implement test before creating maxscale_schema.
This commit is contained in:

committed by
Markus Makela

parent
ff7634113b
commit
ec42413db8
@ -1441,11 +1441,17 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* create the maxscale_schema database */
|
/* create the maxscale_schema database */
|
||||||
if (mysql_query(database->con, "CREATE DATABASE IF NOT EXISTS maxscale_schema"))
|
if (mysql_query(database->con, "SELECT table_name FROM information_schema.tables WHERE table_schema = 'maxscale_schema' AND table_name = 'replication_heartbeat'")) {
|
||||||
{
|
MXS_ERROR( "[mysql_mon]: Error checking for replication_heartbeat in Master server"
|
||||||
MXS_ERROR("[mysql_mon]: Error creating maxscale_schema database in Master server"
|
|
||||||
": %s", mysql_error(database->con));
|
": %s", mysql_error(database->con));
|
||||||
|
database->server->rlag = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 == mysql_num_rows(mysql_store_result(database->con)))
|
||||||
|
{
|
||||||
|
if (mysql_query(database->con, "CREATE DATABASE IF NOT EXISTS maxscale_schema")) {
|
||||||
|
MXS_ERROR( "[mysql_mon]: Error creating maxscale_schema database in Master server"
|
||||||
|
": %s", mysql_error(database->con));
|
||||||
database->server->rlag = -1;
|
database->server->rlag = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1463,6 +1469,7 @@ static void set_master_heartbeat(MYSQL_MONITOR *handle, MONITOR_SERVERS *databas
|
|||||||
|
|
||||||
database->server->rlag = -1;
|
database->server->rlag = -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* auto purge old values after 48 hours*/
|
/* auto purge old values after 48 hours*/
|
||||||
purge_time = time(0) - (3600 * 48);
|
purge_time = time(0) - (3600 * 48);
|
||||||
|
Reference in New Issue
Block a user