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

Database names with dashes are not properly escaped when disabling events

    XMLWordPrintable

Details

    • MXS-SPRINT-244

    Description

      Steps to recreate:

      • On a replica configuration create a database on the primary node with a dash in the name

        CREATE DATABASE `my-database`;
        

      • Create an event within that database

        USE `my-database`
        CREATE DEFINER = root@'localhost' EVENT myevent ON SCHEDULE EVERY 1 YEAR DO SELECT sleep(1);
        

      • Attempt a switchover to the replica:

        maxctrl call command mariadbmon Monitor1 switchover server2
        

      The following error is thrown:

      {
          "links": {
              "self": "http://127.0.0.1:8989/v1/maxscale/modules/mariadbmon/switchover/"
          },
          "meta": {
              "errors": [
                  {
                      "detail": "Could not alter event 'my-database.myevent' on server 'server1': Query 'ALTER DEFINER = root@'localhost' EVENT my-database.myevent DISABLE ON SLAVE;' failed on 'server1': 'No database selected' (1046)."
                  },
                  {
                      "detail": "Failed to disable events on 'server1'."
                  },
                  {
                      "detail": "Switchover server1 -> server2 failed."
                  }
              ]
          }
      }
      

      Attachments

        Activity

          People

            esa.korhonen Esa Korhonen
            Ali.maria Alasdair Haswell
            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.