Merge remote-tracking branch 'origin/develop' into MXS-105

Conflicts (resolved):
	server/modules/routing/schemarouter/schemarouter.c
This commit is contained in:
counterpoint
2015-05-05 10:54:09 +01:00
39 changed files with 853 additions and 784 deletions

View File

@ -210,12 +210,33 @@ int rval;
conn = mysql_init(NULL);
if (conn) {
if (mysql_real_connect(conn, NULL, NULL, NULL, NULL, 0, NULL, 0)) {
char *ptr;
version_string = (char *)mysql_get_server_info(conn);
ptr = strstr(version_string, "-embedded");
char *ptr,*tmp;
tmp = (char *)mysql_get_server_info(conn);
unsigned int server_version = mysql_get_server_version(conn);
if(version_string)
free(version_string);
if((version_string = malloc(strlen(tmp) + strlen("5.5.5-") + 1)) == NULL)
return 0;
if (server_version >= 100000)
{
strcpy(version_string,"5.5.5-");
strcat(version_string,tmp);
}
else
{
strcpy(version_string,tmp);
}
ptr = strstr(tmp, "-embedded");
if (ptr) {
*ptr = '\0';
}
}
mysql_close(conn);
}
@ -1288,7 +1309,7 @@ int i;
}
else if (strcmp(name, "ms_timestamp") == 0)
{
skygw_set_highp(atoi(value));
skygw_set_highp(config_truth_value(value));
}
else
{
@ -1296,7 +1317,7 @@ int i;
{
if (strcasecmp(name, lognames[i].logname) == 0)
{
if (atoi(value))
if (config_truth_value(value))
skygw_log_enable(lognames[i].logfile);
else
skygw_log_disable(lognames[i].logfile);
@ -1475,10 +1496,10 @@ SERVER *server;
user,
auth);
if (enable_root_user)
serviceEnableRootUser(service, atoi(enable_root_user));
serviceEnableRootUser(service, config_truth_value(enable_root_user));
if (connection_timeout)
serviceSetTimeout(service, atoi(connection_timeout));
serviceSetTimeout(service, config_truth_value(connection_timeout));
if(auth_all_servers)
@ -1491,7 +1512,7 @@ SERVER *server;
if (allow_localhost_match_wildcard_host)
serviceEnableLocalhostMatchWildcardHost(
service,
atoi(allow_localhost_match_wildcard_host));
config_truth_value(allow_localhost_match_wildcard_host));
/** Read, validate and set max_slave_connections */
max_slave_conn_str =
@ -1631,7 +1652,7 @@ SERVER *server;
user,
auth);
if (enable_root_user)
serviceEnableRootUser(obj->element, atoi(enable_root_user));
serviceEnableRootUser(obj->element, config_truth_value(enable_root_user));
if (connection_timeout)
serviceSetTimeout(obj->element, atoi(connection_timeout));
@ -1639,7 +1660,7 @@ SERVER *server;
if (allow_localhost_match_wildcard_host)
serviceEnableLocalhostMatchWildcardHost(
obj->element,
atoi(allow_localhost_match_wildcard_host));
config_truth_value(allow_localhost_match_wildcard_host));
}
}
}
@ -2014,15 +2035,18 @@ bool config_set_qualified_param(
int
config_truth_value(char *str)
{
if (strcasecmp(str, "true") == 0 || strcasecmp(str, "on") == 0 || strcasecmp(str, "yes") == 0)
if (strcasecmp(str, "true") == 0 || strcasecmp(str, "on") == 0 ||
strcasecmp(str, "yes") == 0 || strcasecmp(str, "1") == 0)
{
return 1;
}
if (strcasecmp(str, "false") == 0 || strcasecmp(str, "off") == 0 || strcasecmp(str, "no") == 0)
if (strcasecmp(str, "false") == 0 || strcasecmp(str, "off") == 0 ||
strcasecmp(str, "no") == 0|| strcasecmp(str, "0") == 0)
{
return 0;
}
return atoi(str);
skygw_log_write(LOGFILE_ERROR,"Error: Not a boolean value: %s",str);
return -1;
}