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

Query classification sometimes treats table names as constants

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 6.4.3, 22.08.2
    • 22.08.3
    • QueryClassifier
    • None
    • Docker image: mariadb/maxscale:22.08

    Description

      Depending on the length of the query, the tail of the table name is interpreted as a constant number and is replaced by a question mark.

      Here's an example that shows the problem:

      $ for ((i=1;i<45;i++)); do bin/maxctrl api get "maxscale/query_classifier/classify?sql=DROP TABLE IF EXISTS $(yes a|head -n $i|tr -d '\n')1585" data.attributes.canonical; done
      "DROP TABLE IF EXISTS a1585"
      "DROP TABLE IF EXISTS aa1585"
      "DROP TABLE IF EXISTS aaa1585"
      "DROP TABLE IF EXISTS aaaa1585"
      "DROP TABLE IF EXISTS aaaaa1585"
      "DROP TABLE IF EXISTS aaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaa158?"
      "DROP TABLE IF EXISTS aaaaaaaaa15?"
      "DROP TABLE IF EXISTS aaaaaaaaaa1?"
      "DROP TABLE IF EXISTS aaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa158?"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa15?"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1?"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      "DROP TABLE IF EXISTS aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1585"
      

      The expected output is that none of the canonical forms have question marks in them.

      Attachments

        Activity

          People

            nantti Niclas Antti
            markus makela markus makela
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.