|
|
|
|
@ -1,58 +1,4 @@
|
|
|
|
|
#include "MySQL_HostGroups_Manager.h"
|
|
|
|
|
/*
|
|
|
|
|
#include "proxysql.h"
|
|
|
|
|
#include "cpp.h"
|
|
|
|
|
|
|
|
|
|
#include "MySQL_PreparedStatement.h"
|
|
|
|
|
#include "MySQL_Data_Stream.h"
|
|
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <pthread.h>
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
#include <prometheus/counter.h>
|
|
|
|
|
#include <prometheus/detail/builder.h>
|
|
|
|
|
#include <prometheus/family.h>
|
|
|
|
|
#include <prometheus/gauge.h>
|
|
|
|
|
|
|
|
|
|
#include "prometheus_helpers.h"
|
|
|
|
|
#include "proxysql_utils.h"
|
|
|
|
|
|
|
|
|
|
#define char_malloc (char *)malloc
|
|
|
|
|
#define itostr(__s, __i) { __s=char_malloc(32); sprintf(__s, "%lld", __i); }
|
|
|
|
|
|
|
|
|
|
#include "thread.h"
|
|
|
|
|
#include "wqueue.h"
|
|
|
|
|
|
|
|
|
|
#include "ev.h"
|
|
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
#include <mutex>
|
|
|
|
|
#include <type_traits>
|
|
|
|
|
|
|
|
|
|
using std::function;
|
|
|
|
|
|
|
|
|
|
#ifdef TEST_AURORA
|
|
|
|
|
static unsigned long long array_mysrvc_total = 0;
|
|
|
|
|
static unsigned long long array_mysrvc_cands = 0;
|
|
|
|
|
#endif // TEST_AURORA
|
|
|
|
|
|
|
|
|
|
#define SAFE_SQLITE3_STEP(_stmt) do {\
|
|
|
|
|
do {\
|
|
|
|
|
rc=(*proxy_sqlite3_step)(_stmt);\
|
|
|
|
|
if (rc!=SQLITE_DONE) {\
|
|
|
|
|
assert(rc==SQLITE_LOCKED);\
|
|
|
|
|
usleep(100);\
|
|
|
|
|
}\
|
|
|
|
|
} while (rc!=SQLITE_DONE);\
|
|
|
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
extern ProxySQL_Admin *GloAdmin;
|
|
|
|
|
|
|
|
|
|
extern MySQL_Threads_Handler *GloMTH;
|
|
|
|
|
|
|
|
|
|
extern MySQL_Monitor *GloMyMon;
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
class MySrvConnList;
|
|
|
|
|
class MySrvC;
|
|
|
|
|
|