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

Docu bug in ANALYZE TABLE

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • N/A
    • N/A
    • Documentation
    • None
    • Linux, n.a.

    Description

      Documentation states syntax for ANALYZE TABLE command as follows:

      ANALYZE [NO_WRITE_TO_BINLOG | LOCAL] TABLE tbl_name [,tbl_name ...]
      [PERSISTENT FOR [ALL|COLUMNS ([col_name [,col_name ...]])]
      [INDEXES ([index_name [,index_name ...]])]]

      https://mariadb.com/kb/en/analyze-table/

      According to my interpretation ALL 4 statements should be syntactically correct:

      SQL> ANALYZE TABLE test;
      1 row in set (0.257 sec)

      SQL> ANALYZE TABLE test PERSISTENT FOR ALL;
      2 rows in set (9.283 sec)

      SQL> ANALYZE TABLE test PERSISTENT FOR COLUMNS (id, data, ts);
      ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1

      SQL> ANALYZE TABLE test PERSISTENT FOR COLUMNS (id, data, ts) INDEXES (data);
      2 rows in set (10.617 sec)

      Query 3 is not. This is either an docu bug or an implementation bug.

      [] is optional {} is mandatory?

      Further it would be great to have some examples on the page because it is much easier to get to a goal by example instead of reading cryptic syntax diagrams.

      Attachments

        Activity

          People

            greenman Ian Gilfillan
            oli Oli Sennhauser
            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.