Merge branch 'develop' into sigchld_handler

This commit is contained in:
Markus Makela
2015-07-24 12:25:26 +03:00
3 changed files with 26 additions and 27 deletions

View File

@ -211,7 +211,7 @@ The binlog router module of MaxScale produces diagnostic output that can be view
# Binlog router compatibily # Binlog router compatibility
Binlog Router Plugin is compatible with MySQL 5.6, MariaDB 5.5, the current default. Binlog Router Plugin is compatible with MySQL 5.6, MariaDB 5.5, the current default.
@ -239,7 +239,7 @@ Note:
- If MASTER_LOG_POS is not set with CHANGE MASTER TO it defaults to 4 - If MASTER_LOG_POS is not set with CHANGE MASTER TO it defaults to 4
- Latest binlog file name and pos in MaxScale could be find via maxadmin ouput or from mysql client connected to MaxScale: - Latest binlog file name and pos in MaxScale could be find via maxadmin output or from mysql client connected to MaxScale:
Example: Example:
@ -250,13 +250,13 @@ Example:
File: mysql-bin.000181 File: mysql-bin.000181
Position: 2569 Position: 2569
# Enabling MariaDB 10 compatibilty # Enabling MariaDB 10 compatibility
MariaDB 10 has different slave registration phase so an option is reuqired: MariaDB 10 has different slave registration phase so an option is required:
router_options=...., mariadb10-compatibility=1 router_options=...., mariadb10-compatibility=1
version_string should be modified in order to present MariaDB 10 version wen MaxScale sends server handshake packet. version_string should be modified in order to present MariaDB 10 version when MaxScale sends server handshake packet.
version_string=10.0.17-log version_string=10.0.17-log

View File

@ -259,7 +259,7 @@ GWPROTOCOL *funcs;
{ {
hashtable_free(service->users->data); hashtable_free(service->users->data);
free(service->users); free(service->users);
dcb_free(port->listener); dcb_close(port->listener);
port->listener = NULL; port->listener = NULL;
goto retblock; goto retblock;
} }
@ -330,7 +330,7 @@ GWPROTOCOL *funcs;
"Loaded %d MySQL Users for service [%s].", "Loaded %d MySQL Users for service [%s].",
loaded, service->name))); loaded, service->name)));
} }
} }
else else
{ {
if (service->users == NULL) { if (service->users == NULL) {
@ -342,12 +342,8 @@ GWPROTOCOL *funcs;
if ((funcs=(GWPROTOCOL *)load_module(port->protocol, MODULE_PROTOCOL)) if ((funcs=(GWPROTOCOL *)load_module(port->protocol, MODULE_PROTOCOL))
== NULL) == NULL)
{ {
if (service->users->data) users_free(service->users);
{ dcb_close(port->listener);
hashtable_free(service->users->data);
}
free(service->users);
dcb_free(port->listener);
port->listener = NULL; port->listener = NULL;
LOGIF(LE, (skygw_log_write_flush( LOGIF(LE, (skygw_log_write_flush(
LOGFILE_ERROR, LOGFILE_ERROR,
@ -381,11 +377,7 @@ GWPROTOCOL *funcs;
"Error : Failed to create session to service %s.", "Error : Failed to create session to service %s.",
service->name))); service->name)));
if (service->users->data) users_free(service->users);
{
hashtable_free(service->users->data);
}
free(service->users);
dcb_close(port->listener); dcb_close(port->listener);
port->listener = NULL; port->listener = NULL;
goto retblock; goto retblock;
@ -399,11 +391,7 @@ GWPROTOCOL *funcs;
port->port, port->port,
port->protocol, port->protocol,
service->name))); service->name)));
if (service->users->data) users_free(service->users);
{
hashtable_free(service->users->data);
}
free(service->users);
dcb_close(port->listener); dcb_close(port->listener);
port->listener = NULL; port->listener = NULL;
} }

View File

@ -59,12 +59,16 @@ users_alloc()
USERS *rval; USERS *rval;
if ((rval = calloc(1, sizeof(USERS))) == NULL) if ((rval = calloc(1, sizeof(USERS))) == NULL)
return NULL; {
skygw_log_write(LE,"[%s:%d] Error: Memory allocation failed.",__FUNCTION__,__LINE__);
return NULL;
}
if ((rval->data = hashtable_alloc(USERS_HASHTABLE_DEFAULT_SIZE, user_hash, strcmp)) == NULL) if ((rval->data = hashtable_alloc(USERS_HASHTABLE_DEFAULT_SIZE, user_hash, strcmp)) == NULL)
{ {
free(rval); skygw_log_write(LE,"[%s:%d] Error: Memory allocation failed.",__FUNCTION__,__LINE__);
return NULL; free(rval);
return NULL;
} }
hashtable_memory_fns(rval->data, (HASHMEMORYFN)strdup, (HASHMEMORYFN)strdup, (HASHMEMORYFN)free, (HASHMEMORYFN)free); hashtable_memory_fns(rval->data, (HASHMEMORYFN)strdup, (HASHMEMORYFN)strdup, (HASHMEMORYFN)free, (HASHMEMORYFN)free);
@ -80,8 +84,15 @@ USERS *rval;
void void
users_free(USERS *users) users_free(USERS *users)
{ {
if(users == NULL)
{
skygw_log_write(LE,"[%s:%d] Error: NULL parameter.",__FUNCTION__,__LINE__);
return;
}
if(users->data)
hashtable_free(users->data); hashtable_free(users->data);
free(users); free(users);
} }
/** /**