Merge branch 'develop' into binlog_server_waitdata_encryption

This commit is contained in:
MassimilianoPinto
2016-11-28 19:06:22 +01:00
87 changed files with 4060 additions and 2672 deletions

View File

@ -1896,7 +1896,7 @@ int
blr_statistics(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
{
char result[BLRM_COM_STATISTICS_SIZE + 1] = "";
char *ptr;
uint8_t *ptr;
GWBUF *ret;
unsigned long len;
@ -1932,7 +1932,7 @@ blr_statistics(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
int
blr_ping(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
{
char *ptr;
uint8_t *ptr;
GWBUF *ret;
if ((ret = gwbuf_alloc(5)) == NULL)

View File

@ -349,7 +349,7 @@ blr_slave_query(ROUTER_INSTANCE *router, ROUTER_SLAVE *slave, GWBUF *queue)
char *ptr;
extern char *strcasestr();
qtext = GWBUF_DATA(queue);
qtext = (char*)GWBUF_DATA(queue);
query_len = extract_field((uint8_t *)qtext, 24) - 1;
qtext += 5; // Skip header and first byte of the payload
query_text = strndup(qtext, query_len);
@ -4712,35 +4712,28 @@ blr_handle_change_master_token(char *input, char *error, CHANGE_MASTER_OPTIONS *
static char *
blr_get_parsed_command_value(char *input)
{
/* space+TAB+= */
char *sep = " \t=";
char *ret = NULL;
char *word;
char *value = NULL;
if (strlen(input))
if (input && *input)
{
value = MXS_STRDUP_A(input);
}
else
{
return ret;
}
char value[strlen(input) + 1];
strcpy(value, input);
if ((word = get_next_token(NULL, sep, &input)) != NULL)
{
char *ptr;
/* space+TAB+= */
char *sep = " \t=";
char *word;
/* remove trailing spaces */
ptr = value + strlen(value) - 1;
while (ptr > value && isspace(*ptr))
if ((word = get_next_token(NULL, sep, &input)) != NULL)
{
*ptr-- = 0;
/* remove trailing spaces */
char *ptr = value + strlen(value) - 1;
while (ptr > value && isspace(*ptr))
{
*ptr-- = 0;
}
ret = MXS_STRDUP_A(strstr(value, word));
}
ret = MXS_STRDUP_A(strstr(value, word));
MXS_FREE(value);
}
return ret;

View File

@ -26,7 +26,6 @@
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <maxscale/service.h>
#include <maxscale/server.h>
#include <maxscale/router.h>
#include <maxscale/atomic.h>
@ -47,6 +46,9 @@
#include <maxscale/version.h>
// This isn't really a clean way of testing
#include "../../../../core/maxscale/service.h"
static void printVersion(const char *progname);
static void printUsage(const char *progname);
extern int blr_test_parse_change_master_command(char *input, char *error_string, CHANGE_MASTER_OPTIONS *config);