Added libmysqld support to mysql_mon.c, removed comment from router.c
This commit is contained in:
@ -20,6 +20,9 @@
|
|||||||
#include <monitor.h>
|
#include <monitor.h>
|
||||||
#include <mysqlmon.h>
|
#include <mysqlmon.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
|
#include <mysql.h>
|
||||||
|
#include <skygw_utils.h>
|
||||||
|
#include <log_manager.h>
|
||||||
|
|
||||||
static void monitorMain(void *);
|
static void monitorMain(void *);
|
||||||
|
|
||||||
@ -204,15 +207,24 @@ monitorDatabase(MONITOR_SERVERS *database)
|
|||||||
static void
|
static void
|
||||||
monitorMain(void *arg)
|
monitorMain(void *arg)
|
||||||
{
|
{
|
||||||
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg;
|
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg;
|
||||||
MONITOR_SERVERS *ptr;
|
MONITOR_SERVERS *ptr;
|
||||||
|
|
||||||
|
if (mysql_thread_init()) {
|
||||||
|
skygw_log_write_flush(NULL,
|
||||||
|
LOGFILE_ERROR,
|
||||||
|
"Fatal : mysql_init_thread failed in monitor "
|
||||||
|
"module. Exiting.\n");
|
||||||
|
return ;
|
||||||
|
}
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
thread_millisleep(1000);
|
thread_millisleep(1000);
|
||||||
|
|
||||||
if (handle->shutdown)
|
if (handle->shutdown) {
|
||||||
|
mysql_thread_done();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
ptr = handle->databases;
|
ptr = handle->databases;
|
||||||
while (ptr)
|
while (ptr)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -49,9 +49,6 @@ static void vilhos_test_for_query_classifier(void)
|
|||||||
bool failp;
|
bool failp;
|
||||||
MYSQL* mysql = NULL;
|
MYSQL* mysql = NULL;
|
||||||
|
|
||||||
/**
|
|
||||||
* Init libmysqld.
|
|
||||||
*/
|
|
||||||
ss_dassert(mysql_thread_safe());
|
ss_dassert(mysql_thread_safe());
|
||||||
mysql_thread_init();
|
mysql_thread_init();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user