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

Parse error in mtr tests when using $rpl_check_server_ids

Details

    Description

      Task of this MDEV (and related commits) should be:

      1. Make rpl_check_server_ids work again.
      2. Remove extra connections namely server_[1,2,..]_1, that were created during initalization in rpl_init.inc, recreated in rpl_reconnect.inc and removed in rpl_end.inc.
        They are dead connections, not used anywhere in rpl suite.
      3. Cosmetic fixes
        • Fix errors in `rpl_init.inc` regarding the comments
          • sed 's/.cfg/.cnf/'
          • Verifying server_id is not by default but with using rpl_check_server_ids parameter.
          • Add comment why extra connections server_[i,..,N]_1 are needed, since there is no usage of env variables [MASTER,SLAVE]_PORT1 except in rpl_show_slave_hosts.test.
        • Cleanup type,style cleanup
      1. For the first part, consider the test case with configuration options
        • Config rpl_anel.cnf

          !include ../my.cnf
          

        • Test case rpl_anel.test

          --let $rpl_debug= 1
          --let $rpl_check_server_ids= 1
          --source include/master-slave.inc
          SELECT 1;
           
          # End of tests
          --source include/rpl_end.inc
          
          

        • When setting rpl_check_server_ids parsing error is raised

          ---- Check that @@server_id is distinct for all servers ----
          ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
          .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
          # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond=''
          # debug: interpolated_cond=''
           
          CURRENT_TEST: rpl.rpl_anel
          mysqltest: In included file "./include/assert.inc": 
          included from ./include/rpl_init.inc at line 209:
          included from ./include/master-slave.inc at line 39:
          included from /home/anel/GitHub/mariadb/server/src/10.11/mysql-test/suite/rpl/t/rpl_anel.test at line 4:
          At line 148: query 'let $_assert_result= `SELECT $_assert_cond_interp`' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
          

        • This error is obtained from mysql-test/include/rpl_init.inc file, when invoking ./include/assert.inc.
        • As proof of working feature attach the test file with rpl_debug enabled, since currently result file cannot be saved with rpl_debug that is storing the PORT numbers, that are failing in buildbot.

      Attachments

        1. rpl_init_test_assert.result
          11 kB
          Anel Husakovic
        2. rpl_init_test_assert.cnf
          0.0 kB
          Anel Husakovic
        3. rpl_init_test_assert.test
          0.2 kB
          Anel Husakovic

        Activity

          anel Anel Husakovic created issue -
          anel Anel Husakovic made changes -
          Field Original Value New Value
          Status Open [ 1 ] In Progress [ 3 ]
          anel Anel Husakovic made changes -
          Description # Consider the test case with configuration options
          #* Config {{rpl_anel.cnf}}
          {code:noformat}
          !include ../my.cnf
          {code}
          #* Test case {{rpl_anel.test}}
          {code:noformat}
          --let $rpl_debug= 1
          --let $rpl_check_server_ids= 1
          --source include/master-slave.inc
          SELECT 1;

          # End of tests
          --source include/rpl_end.inc

          {code}
          #* When setting {{rpl_check_server_ids}} parsing error is raised
          {code:noformat}
          ---- Check that @@server_id is distinct for all servers ----
          ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
          .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
          # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond=''
          # debug: interpolated_cond=''

          CURRENT_TEST: rpl.rpl_anel
          mysqltest: In included file "./include/assert.inc":
          included from ./include/rpl_init.inc at line 209:
          included from ./include/master-slave.inc at line 39:
          included from /home/anel/GitHub/mariadb/server/src/10.11/mysql-test/suite/rpl/t/rpl_anel.test at line 4:
          At line 148: query 'let $_assert_result= `SELECT $_assert_cond_interp`' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
          {code}
          #* This error is obtained from {{mysql-test/include/rpl_init.inc}} file, when invoking {{./include/assert.inc}}.
          # Additionally fix errors in `rpl_init.inc` regarding the comments
          #* {{sed 's/.cfg/.cnf/'}}
          #* Verifying {{server_id}} is not by default but with using {{rpl_check_server_ids}} parameter.
          #* Add comment why extra connections {{server_\[i,..,N\]_1}} are needed, since there is no usage of env variables {{\[MASTER,SLAVE\]_PORT1}} except in {{rpl_show_slave_hosts.test}}.
          Task of this MDEV (and related commits) should be:
          # Make {{rpl_check_server_ids}} work again.
          # Remove extra connections namely {{server_\[1,2,..\]_1}}, that were created during initalization in {{rpl_init.inc}}, recreated in {{rpl_reconnect.inc}} and removed in {{rpl_end.inc}}.
          They are dead connections, not used anywhere in {{rpl}} suite.
          # Cosmetic fixes
          #* Fix errors in `rpl_init.inc` regarding the comments
          #** {{sed 's/.cfg/.cnf/'}}
          #** Verifying {{server_id}} is not by default but with using {{rpl_check_server_ids}} parameter.
          #** Add comment why extra connections {{server_\[i,..,N\]_1}} are needed, since there is no usage of env variables {{\[MASTER,SLAVE\]_PORT1}} except in {{rpl_show_slave_hosts.test}}.
          #* Cleanup type,style cleanup

          # For the first part, consider the test case with configuration options
          #* Config {{rpl_anel.cnf}}
          {code:noformat}
          !include ../my.cnf
          {code}
          #* Test case {{rpl_anel.test}}
          {code:noformat}
          --let $rpl_debug= 1
          --let $rpl_check_server_ids= 1
          --source include/master-slave.inc
          SELECT 1;

          # End of tests
          --source include/rpl_end.inc

          {code}
          #* When setting {{rpl_check_server_ids}} parsing error is raised
          {code:noformat}
          ---- Check that @@server_id is distinct for all servers ----
          ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
          .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
          # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond=''
          # debug: interpolated_cond=''

          CURRENT_TEST: rpl.rpl_anel
          mysqltest: In included file "./include/assert.inc":
          included from ./include/rpl_init.inc at line 209:
          included from ./include/master-slave.inc at line 39:
          included from /home/anel/GitHub/mariadb/server/src/10.11/mysql-test/suite/rpl/t/rpl_anel.test at line 4:
          At line 148: query 'let $_assert_result= `SELECT $_assert_cond_interp`' failed: ER_PARSE_ERROR (1064): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
          {code}
          #* This error is obtained from {{mysql-test/include/rpl_init.inc}} file, when invoking {{./include/assert.inc}}.
          #* As proof of working feature attach the test file with {{rpl_debug}} enabled, since currently {{result}} file cannot be saved with {{rpl_debug}} that is storing the {{PORT}} numbers, that are failing in buildbot.
          • With suggested patch we get the desired output; that means using rpl_check_server_ids as an argument in test now works:

            ---- Check that @@server_id is distinct for all servers ----
            ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
            .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
            # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond='[SELECT @@server_id AS i, i, 1] != 2'
            # debug: old connection, sub-statement='SELECT @@server_id AS i, i, 1'
            # debug: result of sub-statement='1'
            # debug: interpolated_cond='1 != 2'
            # debug: result='1'
            [connection server_1]
            ..==== END include/assert.inc [Servers 2 and 1 should have different @@server_id] ====
            .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1'
            

          • Full result file is in the attachment of this task.
          anel Anel Husakovic added a comment - With suggested patch we get the desired output; that means using rpl_check_server_ids as an argument in test now works: ---- Check that @@server_id is distinct for all servers ---- ..==== BEGIN include/assert.inc [Servers 2 and 1 should have different @@server_id] ==== .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1' # debug: assert_text='Servers 2 and 1 should have different @@server_id' assert_cond='[SELECT @@server_id AS i, i, 1] != 2' # debug: old connection, sub-statement='SELECT @@server_id AS i, i, 1' # debug: result of sub-statement='1' # debug: interpolated_cond='1 != 2' # debug: result='1' [connection server_1] ..==== END include/assert.inc [Servers 2 and 1 should have different @@server_id] ==== .. con='server_1' warn='1' qlog='1' rlog='1' aborterr='1' Full result file is in the attachment of this task.
          anel Anel Husakovic made changes -
          Attachment rpl_init_test_assert.test [ 71991 ]
          Attachment rpl_init_test_assert.cnf [ 71992 ]
          Attachment rpl_init_test_assert.result [ 71993 ]
          anel Anel Husakovic made changes -
          Fix Version/s 10.4.32 [ 29300 ]
          Fix Version/s 10.5.23 [ 29012 ]
          Fix Version/s 10.6.16 [ 29014 ]
          Fix Version/s 10.10.7 [ 29018 ]
          Fix Version/s 10.11.6 [ 29020 ]
          Fix Version/s 10.4 [ 22408 ]
          Resolution Fixed [ 1 ]
          Status In Progress [ 3 ] Closed [ 6 ]
          julien.fritsch Julien Fritsch made changes -
          Fix Version/s 11.1.3 [ 29023 ]

          People

            anel Anel Husakovic
            anel Anel Husakovic
            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.