Details

    • New Feature
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 12.1
    • Tests

    Description

      Goal

      the goal is to remove all these INSTR/REPLACE/SUBSTR/etc that replication tests are using to figure out the topology. The ultimate goal is: mysqltest should only send those commands to the server that constitute a test case, not anything it needs internally for itself.

      Options

      bash-like substitutions

      • ${var}
      • ${parameter:offset:length}
      • ${#parameter}
      • ${parameter/pattern/string/flags} — same as in replace_regex
      • perhaps ${parameterˆ}, ${parameterˆˆ}, ${parameter,}, ${parameter,,}
      • or ${parameter@function}, like ${a@U}, ${a@qs} or even ${a@uppercase}, ${a@shellquote}
      • $( expression ) see MDEV-36107

      also, repetition

      • ${parameter*N}

      and recursive expansion:

      • ${${var}}

      The problem — it's difficult to extend. There is a syntax for SUBSTR(), but if we'd like to add INSTR() we'd need to invent another combination of punctuation characters inside curly braces. E.g. ${parameter%substring} It's difficult to remember and there are only so many punctuation characters.

      functions — this is currently the preferred approach

      $( instr($a, "foo") ) or, more complex, $( substr($a, 1, instr($a, "/") )

      this is more extendable that bash syntax. Function names should be the same as in SQL to not force users to learn a new language

      cmake-like generator expressions

      $<instr:$a:foo>, or, more complex, $<substr:$a:1:$<instr:$a:/>>

      also more extendable than bash. Naturally string substitutions. Looks very weird.

      Attachments

        Issue Links

          Activity

            ParadoxV5 Jimmy Hú added a comment -

            Are we certain that we don’t want to just switch to a scripting-based framework (Perl, Python, Ruby, etc.)?

            ParadoxV5 Jimmy Hú added a comment - Are we certain that we don’t want to just switch to a scripting-based framework (Perl, Python, Ruby, etc.)?

            We don't want to rewrite all existing tests. And mysqltest language is not supposed be a general purpose scripting language. It's main goal is "debuggability" of test cases, and using a general purpose language works directly against it

            serg Sergei Golubchik added a comment - We don't want to rewrite all existing tests. And mysqltest language is not supposed be a general purpose scripting language. It's main goal is "debuggability" of test cases, and using a general purpose language works directly against it

            People

              Unassigned Unassigned
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.