MXS-1066 Add query hint to route to last used server
Add new hint type and support for it in the readwritesplit router.
This commit is contained in:
@ -49,6 +49,7 @@ static struct
|
||||
{ "master", TOK_MASTER},
|
||||
{ "slave", TOK_SLAVE},
|
||||
{ "server", TOK_SERVER},
|
||||
{ "last" , TOK_LAST},
|
||||
{ NULL, static_cast<TOKEN_VALUE>(0)}
|
||||
};
|
||||
|
||||
@ -334,6 +335,12 @@ hint_parser(HINT_SESSION *session, GWBUF *request)
|
||||
rval = hint_create_route(rval,
|
||||
HINT_ROUTE_TO_SLAVE, NULL);
|
||||
break;
|
||||
|
||||
case TOK_LAST:
|
||||
rval = hint_create_route(rval,
|
||||
HINT_ROUTE_TO_LAST_USED, NULL);
|
||||
break;
|
||||
|
||||
case TOK_SERVER:
|
||||
state = HS_ROUTE_SERVER;
|
||||
break;
|
||||
|
@ -40,6 +40,7 @@ typedef enum
|
||||
TOK_MASTER,
|
||||
TOK_SLAVE,
|
||||
TOK_SERVER,
|
||||
TOK_LAST,
|
||||
TOK_LINEBRK,
|
||||
TOK_END
|
||||
} TOKEN_VALUE;
|
||||
|
Reference in New Issue
Block a user