Fix for Bug #466, http://bugs.skysql.com/show_bug.cgi?id=466
hintparser.c:hint_parser:when string token is found, create a copy of the token value instead of copying the its address because token will be freed before the value is used. hint_next_token:didn't recognize '=' as TOK_EQUAL, fixed that. Read the code. hint.c:hint_create_parameter: copy the pointer to parameter name instead of creating copy of it - pname is already copied from token before the call readwritesplit.c:routeQuery:Hint name was copied when hint value was supposed to be copied, thus resulting invalid value for hinted parameter. Also fixed server type in trace log command. skygw_debug.h:Added string for Relay server to macro STRSRVSTATUS.
This commit is contained in:
@ -1417,7 +1417,7 @@ static int routeQuery(
|
||||
"max_slave_replication_lag",
|
||||
strlen("max_slave_replication_lag")) == 0))
|
||||
{
|
||||
int val = (int) strtol((char *)hint->data,
|
||||
int val = (int) strtol((char *)hint->value,
|
||||
(char **)NULL, 10);
|
||||
|
||||
if (val != 0 || errno == 0)
|
||||
@ -2308,9 +2308,7 @@ static bool select_connect_backend_servers(
|
||||
LOGIF(LT, (skygw_log_write(
|
||||
LOGFILE_TRACE,
|
||||
"Selected %s in \t%s:%d",
|
||||
(btype == BE_MASTER ? "master" :
|
||||
(btype == BE_SLAVE ? "slave" :
|
||||
"unknown node type")),
|
||||
STRSRVSTATUS(b->backend_server),
|
||||
b->backend_server->name,
|
||||
b->backend_server->port)));
|
||||
}
|
||||
|
Reference in New Issue
Block a user