[MDEV-32129] analyze table persistent for column (list) inconsistency Created: 2023-09-07  Updated: 2023-09-08  Resolved: 2023-09-08

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

Type: Bug Priority: Minor
Reporter: Rex Johnston Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-32117 PERSISTENT FOR clause is applied to a... Open

 Description   

create table t1 (c1 int, c2 int, c3 int);
create table t2 (c4 int, c5 int, c6 int);

MariaDB [test]> analyze table t1 persistent for all, t2 persistent for columns (c4,c5) indexes();
+---------+---------+----------+-----------------------------------------+
| Table   | Op      | Msg_type | Msg_text                                |
+---------+---------+----------+-----------------------------------------+
| test.t1 | analyze | status   | Engine-independent statistics collected |
| test.t1 | analyze | error    | Invalid argument                        |
| test.t2 | analyze | status   | Engine-independent statistics collected |
| test.t2 | analyze | status   | OK                                      |
+---------+---------+----------+-----------------------------------------+
4 rows in set (0.038 sec)

invalid argument is caused by the search for column(s) c4,c5 in table t1;

It should either work as expected or produce a syntax error, from
https://mariadb.com/kb/en/analyze-table/

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

only one PERSISTENT clause is allowed.



 Comments   
Comment by Rex Johnston [ 2023-09-08 ]

duplicate of MDEV-32117

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