Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
N/A
-
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.