Prevent loading modules compiled for a different version
pull/190/head
Jesmar Cannaò 11 years ago
parent 0717312c50
commit d4f9c49e1b

@ -361,6 +361,8 @@ struct _global_variables_t {
//pthread_rwlock_t rwlock_global;
pthread_rwlock_t rwlock_usernames;
bool has_debug;
volatile int shutdown;
bool nostart;
int reload;

@ -40,6 +40,14 @@ class Standard_MySQL_Authentication: public MySQL_Authentication {
// PtrArray cred_array;
public:
Standard_MySQL_Authentication() {
#ifdef DEBUG
if (glovars.has_debug==false) {
#else
if (glovars.has_debug==true) {
#endif /* DEBUG */
perror("Incompatible debagging version");
exit(EXIT_FAILURE);
}
spinlock_rwlock_init(&creds_backends.lock);
spinlock_rwlock_init(&creds_frontends.lock);
};

@ -205,6 +205,14 @@ class Standard_MySQL_Threads_Handler: public MySQL_Threads_Handler
} variables;
public:
Standard_MySQL_Threads_Handler() {
#ifdef DEBUG
if (glovars.has_debug==false) {
#else
if (glovars.has_debug==true) {
#endif /* DEBUG */
perror("Incompatible debagging version");
exit(EXIT_FAILURE);
}
num_threads=0;
mysql_threads=NULL;
stacksize=0;

@ -1319,6 +1319,14 @@ public:
*/
Standard_ProxySQL_Admin::Standard_ProxySQL_Admin() {
// int i;
#ifdef DEBUG
if (glovars.has_debug==false) {
#else
if (glovars.has_debug==true) {
#endif /* DEBUG */
perror("Incompatible debagging version");
exit(EXIT_FAILURE);
}
SPA=this;
spinlock_rwlock_init(&rwlock);

@ -321,6 +321,14 @@ virtual double area() const {
};
Standard_Query_Cache() {
#ifdef DEBUG
if (glovars.has_debug==false) {
#else
if (glovars.has_debug==true) {
#endif /* DEBUG */
perror("Incompatible debagging version");
exit(EXIT_FAILURE);
}
QCnow=time(NULL);
//test=0;
size=SHARED_QUERY_CACHE_HASH_TABLES;

@ -243,6 +243,14 @@ protected:
public:
Standard_Query_Processor() {
#ifdef DEBUG
if (glovars.has_debug==false) {
#else
if (glovars.has_debug==true) {
#endif /* DEBUG */
perror("Incompatible debagging version");
exit(EXIT_FAILURE);
}
proxy_debug(PROXY_DEBUG_MYSQL_QUERY_PROCESSOR, 4, "Initializing Query Processor with version=0\n");
spinlock_rwlock_init(&rwlock);
version=0;

@ -190,6 +190,12 @@ int main(int argc, const char * argv[]) {
{
#ifdef DEBUG
glovars.has_debug=true;
#else
glovars.has_debug=false;
#endif /* DEBUG */
__thr_sfp=l_mem_init();
{

@ -3,4 +3,3 @@
//#include "proxysql_glovars.hpp"
#include "cpp.h"
//ProxySQL_GlobalVariables GloVars;

Loading…
Cancel
Save