[MDEV-26725] No meaningful error message upon failing ANALYZE .. PERSISTENT with some engines Created: 2021-09-29  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Optimizer, Storage Engine - Memory, Storage Engine - OQGRAPH
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.4, 10.5, 10.6

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: None


 Description   

I can't imagine anyone would need statistics for OQGraph, but in general it would be good to produce a more meaningful error message. I suppose it may be the case not only for OQGraph.

INSTALL SONAME 'ha_oqgraph';
 
CREATE OR REPLACE TABLE oq_backing (
  origid INT UNSIGNED NOT NULL, 
  destid INT UNSIGNED NOT NULL,  
  PRIMARY KEY (origid, destid), 
  KEY (destid)
);
 
INSERT INTO oq_backing(origid, destid) 
 VALUES (1,2), (2,3), (3,4), (4,5), (2,6), (5,6);
 
CREATE OR REPLACE TABLE t (
  latch VARCHAR(32) NULL,
  origid BIGINT UNSIGNED NULL,
  destid BIGINT UNSIGNED NULL,
  weight DOUBLE NULL,
  seq BIGINT UNSIGNED NULL,
  linkid BIGINT UNSIGNED NULL,
  KEY (latch, origid, destid) USING HASH,
  KEY (latch, destid, origid) USING HASH
) 
ENGINE=OQGRAPH 
data_table='oq_backing' origid='origid' destid='destid';
 
ANALYZE TABLE t PERSISTENT FOR ALL;

10.2 ceb40ef4

MariaDB [test]> ANALYZE TABLE t PERSISTENT FOR ALL;
+--------+---------+----------+------------------+
| Table  | Op      | Msg_type | Msg_text         |
+--------+---------+----------+------------------+
| test.t | analyze | status   | Operation failed |
+--------+---------+----------+------------------+
1 row in set (0.002 sec)



 Comments   
Comment by Elena Stepanova [ 2022-12-15 ]

Same for HEAP tables.

MariaDB [test]> CREATE TABLE t (a INT, KEY(a)) ENGINE=HEAP;
Query OK, 0 rows affected (0.022 sec)
 
MariaDB [test]> ANALYZE TABLE t PERSISTENT FOR ALL;
+--------+---------+----------+------------------+
| Table  | Op      | Msg_type | Msg_text         |
+--------+---------+----------+------------------+
| test.t | analyze | status   | Operation failed |
+--------+---------+----------+------------------+
1 row in set (0.001 sec)
 
MariaDB [test]> DROP TABLE t;

Generated at Thu Feb 08 09:47:28 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.