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

START SLAVE ,,,,,, is accepted as valid syntax

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.11.4
    • 10.5, 10.6, 10.11
    • Parser
    • None

    Description

      MariaDB [test]> START SLAVE ,,,,,,;
      Query OK, 0 rows affected, 1 warning (0.000 sec)
      

      The same also seems to apply to STOP SLAVE.

      Looking at the code, we see that the syntax for it is defined as follows:

      slave_thread_opt_list:
                slave_thread_opt
      	| slave_thread_opt_list ',' slave_thread_opt
      	;
       
      slave_thread_opt:
                /*empty*/ {}
              | SQL_THREAD   { Lex->slave_thd_opt|=SLAVE_SQL; }
              | RELAY_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
              ;
      

      I believe the empty value should be in slave_thread_opt_list and not in slave_thread_opt; this way an empty value or a list of SQL or IO thread variables is accepted.

      Attachments

        Activity

          markus makela markus makela created issue -
          markus makela markus makela made changes -
          Field Original Value New Value
          Priority Major [ 3 ] Trivial [ 5 ]
          markus makela markus makela made changes -
          Description {code}
          MariaDB [test]> START SLAVE ,,,,,,;
          Query OK, 0 rows affected, 1 warning (0.000 sec)
          {code}

          Looking at the code, we see that the syntax for it is defined as follows:
          {code}
          slave_thread_opt_list:
                    slave_thread_opt
          | slave_thread_opt_list ',' slave_thread_opt
          ;

          slave_thread_opt:
                    /*empty*/ {}
                  | SQL_THREAD { Lex->slave_thd_opt|=SLAVE_SQL; }
                  | RELAY_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
                  ;
          {code}
          I believe the empty value should be in {{slave_thread_opt_list}} and not in {{slave_thread_opt}}; this way an empty value or a list of SQL or IO thread variables is accepted.
          {code}
          MariaDB [test]> START SLAVE ,,,,,,;
          Query OK, 0 rows affected, 1 warning (0.000 sec)
          {code}

          The same also seems to apply to {{STOP SLAVE}}.

          Looking at the code, we see that the syntax for it is defined as follows:
          {code}
          slave_thread_opt_list:
                    slave_thread_opt
          | slave_thread_opt_list ',' slave_thread_opt
          ;

          slave_thread_opt:
                    /*empty*/ {}
                  | SQL_THREAD { Lex->slave_thd_opt|=SLAVE_SQL; }
                  | RELAY_THREAD { Lex->slave_thd_opt|=SLAVE_IO; }
                  ;
          {code}
          I believe the empty value should be in {{slave_thread_opt_list}} and not in {{slave_thread_opt}}; this way an empty value or a list of SQL or IO thread variables is accepted.

          Agree that this was probably not intended. But I'd suggest to not change it. It doesn't seem to hurt anything, and it only risks breaking some odd script out there that accidentally ended up with an extra comma.

          knielsen Kristian Nielsen added a comment - Agree that this was probably not intended. But I'd suggest to not change it. It doesn't seem to hurt anything, and it only risks breaking some odd script out there that accidentally ended up with an extra comma.
          markus makela markus makela added a comment -

          Yes, this is the definition of a cosmetic issue. Perhaps mentioning it in the documentation for the START SLAVE command is enough as a fix.

          markus makela markus makela added a comment - Yes, this is the definition of a cosmetic issue. Perhaps mentioning it in the documentation for the START SLAVE command is enough as a fix.
          serg Sergei Golubchik made changes -
          Priority Trivial [ 5 ] Minor [ 4 ]
          serg Sergei Golubchik made changes -
          Fix Version/s 10.4 [ 22408 ]
          Fix Version/s 10.5 [ 23123 ]
          Fix Version/s 10.6 [ 24028 ]
          Fix Version/s 10.10 [ 27530 ]
          Fix Version/s 10.11 [ 27614 ]
          Fix Version/s 11.0 [ 28320 ]
          Fix Version/s 11.1 [ 28549 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.10 [ 27530 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 11.0 [ 28320 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 10.4 [ 22408 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 11.1 [ 28549 ]

          People

            Unassigned Unassigned
            markus makela markus makela
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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