Merge pull request #4 from skysql/MAX-119

Fix to bug #438 http://bugs.skysql.com/show_bug.cgi?id=438
This commit is contained in:
Mark Riddoch 2014-05-27 14:38:07 +01:00
commit 056b5d5f37
8 changed files with 15 additions and 6 deletions

View File

@ -41,7 +41,7 @@ UTILSPATH := $(ROOT_PATH)/utils
CC=cc
CFLAGS=-c -I/usr/include -I../include -I../inih \
CFLAGS=-c -I/usr/include -I../include -I../modules/include -I../inih \
$(MYSQL_HEADERS) \
-I$(LOGPATH) -I$(UTILSPATH) \
-Wall -g
@ -59,7 +59,7 @@ SRCS= atomic.c buffer.c spinlock.c gateway.c \
monitor.c adminusers.c secrets.c
HDRS= ../include/atomic.h ../include/buffer.h ../include/dcb.h \
../include/gw.h ../include/mysql_protocol.h \
../include/gw.h ../modules/include/mysql_client_server_protocol.h \
../include/session.h ../include/spinlock.h ../include/thread.h \
../include/modules.h ../include/poll.h ../include/config.h \
../include/users.h ../include/hashtable.h ../include/gwbitmask.h \

View File

@ -42,6 +42,7 @@
#include <skygw_utils.h>
#include <log_manager.h>
#include <secrets.h>
#include <mysql_client_server_protocol.h>
#define USERS_QUERY_NO_ROOT " AND user NOT IN ('root')"
#define LOAD_MYSQL_USERS_QUERY "SELECT user, host, password, concat(user,host,password) AS userdata FROM mysql.user WHERE user IS NOT NULL AND user <> ''"

View File

@ -67,6 +67,7 @@
#include <atomic.h>
#include <skygw_utils.h>
#include <log_manager.h>
#include <hashtable.h>
extern int lm_enabled_logfiles_bitmask;

View File

@ -27,6 +27,7 @@
#include <gwbitmask.h>
#include <skygw_utils.h>
#include <log_manager.h>
#include <gw.h>
extern int lm_enabled_logfiles_bitmask;

View File

@ -21,6 +21,7 @@
#include <skygw_utils.h>
#include <log_manager.h>
#include <ctype.h>
#include <mysql_client_server_protocol.h>
extern int lm_enabled_logfiles_bitmask;
/**

View File

@ -667,7 +667,7 @@ SERVICE *ptr;
* @param dcb DCB to print data to
* @param service The service to print
*/
dprintService(DCB *dcb, SERVICE *service)
void dprintService(DCB *dcb, SERVICE *service)
{
SERVER *server = service->databases;

View File

@ -126,7 +126,7 @@ MYSQL_MONITOR *handle;
handle->defaultPasswd = NULL;
spinlock_init(&handle->lock);
}
handle->tid = thread_start(monitorMain, handle);
handle->tid = (THREAD)thread_start(monitorMain, handle);
return handle;
}
@ -141,7 +141,7 @@ stopMonitor(void *arg)
MYSQL_MONITOR *handle = (MYSQL_MONITOR *)arg;
handle->shutdown = 1;
thread_wait(handle->tid);
thread_wait((void *)handle->tid);
}
/**

View File

@ -283,6 +283,11 @@ static int gw_read_backend_event(DCB *dcb) {
}
if (backend_protocol->state == MYSQL_AUTH_FAILED) {
/**
* protocol state won't change anymore,
* lock can be freed
*/
spinlock_release(&dcb->authlock);
spinlock_acquire(&dcb->delayqlock);
/*<
* vraa : errorHandle
@ -340,7 +345,7 @@ static int gw_read_backend_event(DCB *dcb) {
/* close router_session */
router->closeSession(router_instance, rsession);
rc = 1;
goto return_with_lock;
goto return_rc;
}
else
{