[MDEV-30094] Docu bug in ANALYZE TABLE Created: 2022-11-25  Updated: 2023-01-23  Resolved: 2023-01-23

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Oli Sennhauser Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: None
Environment:

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.



 Comments   
Comment by Ian Gilfillan [ 2023-01-23 ]

You are correct; query 3 revealed a documentation bug

Generated at Thu Feb 08 10:13:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.