Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-29718

Spider: variable spider_same_server_link not functioning correctly

    XMLWordPrintable

Details

    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);
              }
            }
          }
      

      Attachments

        Activity

          People

            ycp Yuchen Pei
            Roel Roel Van de Paar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.