Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.11, 10.4(EOL), 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL)
-
None
Description
With thanks to elenst and nayuta-yanagisawa.
In principle, it should not be possible to make a connection to the same local instance without setting spider_same_server_link to 1.
However, as seen in several recent bugs, it is possible to create a socket (and possibly a tcp) connection to the same local instance with this variable still set to 0/off (the default).
As a sidethought, when this is fixed, any testcase which does not have spider_same_server_link=1 set, may need to be updated.
Relevant code:
if (!spider_param_same_server_link(thd))
|
{
|
if (!strcmp(tgt_host, my_localhost))
|
{
|
if (!strcmp(tgt_socket, *spd_mysqld_unix_port))
|
{
|
my_printf_error(ER_SPIDER_SAME_SERVER_LINK_NUM,
|
ER_SPIDER_SAME_SERVER_LINK_STR1, MYF(0),
|
tgt_host, tgt_socket);
|
DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM);
|
}
|
} else if (!strcmp(tgt_host, "127.0.0.1") ||
|
!strcmp(tgt_host, glob_hostname))
|
{
|
if (tgt_port == (long) *spd_mysqld_port)
|
{
|
my_printf_error(ER_SPIDER_SAME_SERVER_LINK_NUM,
|
ER_SPIDER_SAME_SERVER_LINK_STR2, MYF(0),
|
tgt_host, tgt_port);
|
DBUG_RETURN(ER_SPIDER_SAME_SERVER_LINK_NUM);
|
}
|
}
|
}
|