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

Client compatible delimiter for mysqltest

    XMLWordPrintable

Details

    Description

      It's very annoying that the DELIMITER command has a different syntax in the client and in mysqltest:

      • Client:

        DELIMITER $$
        BEGIN NOT ATOMIC
          SELECT 1;
        END;
        $$
        DELIMITER ;
        

      • mysqltest:

        DELIMITER $$;
        BEGIN NOT ATOMIC
          SELECT 1;
        END;
        $$
        DELIMITER ;$$
        

      We want to unify "mysqltest" and "mariadb" so any script can be pasted to either of them without modifications.

      Originally, there was a proposal to support both styles and to make it possible to choose between the two styles by introducing new switches:

      • A new command to specify the delimiter style in a *.test file:

        --delimiter=client
        --delimiter=mysqltest
        

        with mysqltest being default (the current behavior).

      • Add a command line option to mysqltest to specify the default delimiter behavior:

        mysqltest --delimiter=client
        

      • Add a way to define delimiter style per the entire suite. This can probably be done by putting a my.cnf file into the suite directory:

        [mysqltest]
        delimiter=client
        

      After discussion with the team (nikitamalyavin, serg, bar) we decided that having switches to choose between DELIMITER style would be over-engineering. Let's have the new behaviour hard-coded.

      So non of these switches are needed.

      We'll do the following:

      1. Change mysqltest so instead of this style:

      DELIMITER $$;
      BEGIN NOT ATOMIC
        SELECT 1;
      END;
      $$
      DELIMITER ;$$
      

      it only understands just this style, compatible to the "mariadb" command line client:

      DELIMITER $$
      BEGIN NOT ATOMIC
        SELECT 1;
      END;
      $$
      DELIMITER ;
      

      2. Instead of adding the switches, we just fix all test result files *.result accordingly, to use the new DELIMITER style.

      This change in the task means less programming on the step N1, but some time on the step N2.

      A quick estimation in MariaDB-10.9 sources gives 10658 matches in 641 test files:

      $ ag -i --stats-only delimiter mysql-test/
      10658 matches
      641 files contained matches
      14818 files searched
      

      But it seems most of them can most likely be changed using a simple script.

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            6 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.