Uploaded image for project: 'MariaDB MaxScale'
  1. MariaDB MaxScale
  2. MXS-580

Adding extended regular expressions support for QLA Filter

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0
    • Component/s: qlafilter
    • Labels:
      None

      Description

      Adding extended regular expressions support to the QLA Filter would allow more useful operators like "|" that will match either of its arguments, for example "update|delete" will match either "update" or "delete" query statements.

      The changes to implement this seem pretty straight forward:

      --- a/server/modules/filter/qlafilter.c
      +++ b/server/modules/filter/qlafilter.c
      @@ -227,7 +227,7 @@ createInstance(char **options, FILTER_PARAMETER **params)
               }
               my_instance->sessions = 0;
               if (my_instance->match &&
      -            regcomp(&my_instance->re, my_instance->match, REG_ICASE))
      +            regcomp(&my_instance->re, my_instance->match, REG_EXTENDED | REG_ICASE))
               {
                   MXS_ERROR("qlafilter: Invalid regular expression '%s'"
                             " for the match parameter.\n",
      @@ -243,7 +243,7 @@ createInstance(char **options, FILTER_PARAMETER **params)
               }
               if (my_instance->nomatch &&
                   regcomp(&my_instance->nore, my_instance->nomatch,
      -                    REG_ICASE))
      +                    REG_EXTENDED | REG_ICASE))
               {
                   MXS_ERROR("qlafilter: Invalid regular expression '%s'"
                             " for the nomatch paramter.",

        Attachments

          Activity

            People

            Assignee:
            markus makela markus makela
            Reporter:
            dalonsoetc Diego Alonso
            Votes:
            0 Vote for this issue
            Watchers:
            2 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.