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

Improve mysqltest language

    XMLWordPrintable

    Details

      Description

      mysqltest has a lot of historical problems:

      • ad hoc parser, weird limitations
      • commands added as needed with no view over the total language structure
      • historical code issues (e.g. casts that become unnecessary ~10 years ago)
        etc

      A lot can be done to improve it.

      Ideas

      to simplify writing tests

      • control structures, else in if, break and continue in while, for (or foreach) loop
      • proper expression support in let, if, etc
      • letenv command to set environment variables instead of having let do it.
      • ${var} and ${${var}} variable expansion
      • rich enough expressions to make resorting to sql unnecessary in most cases
        • in particular, see rpl_init.inc
      • remove unused and redundant commands (e.g. system vs exec, query_vertical vs vertical_results ONCE)
      • remove complex commands that do many sql statements under the hood, if they can be scripted, e.g. sync_slave_with_master
      • scoped variables
      • parameters for the source command
      • remove dead code
      • returning values from perl command (in some easier way than writing a new file and sourcing it)
        • e.g. stderr is stored in $perl ?
      • running many test files on one server connection. They are supposed to be independent, so for performance reasons we can avoid restarting mysqltest for them

      to simplify debugging

      • make `echo` automatically print `#` at the start of every line (optionally, don't do it if it's explicitly specified — for backward compatibility)
      • make most commands print itself to the log.
        • os and file operations, like exec/remove_file, etc, should strip MYSQL_VAR_DIR from paths.
      • remove over-verbose treatment of rpl test failures (already done in 64dd3969481)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              serg Sergei Golubchik
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated: