[MDEV-31957] Concurrent ALTER and ANALYZE collecting statistics can result in stale statistical data Created: 2023-08-18  Updated: 2024-01-03  Resolved: 2024-01-03

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.4, 10.5, 10.6, 10.10, 10.11, 11.0, 11.1
Fix Version/s: 10.6.16, 10.10.7, 10.11.6, 11.0.4, 11.1.3, 11.2.2

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Michael Widenius
Resolution: Fixed Votes: 1
Labels: None

Issue Links:
Relates
relates to MDEV-30983 ALTER TABLE times out, but does not r... Closed
relates to MDEV-29693 ANALYZE TABLE still flushes table def... Closed

 Description   

Test case from Monty:

--source include/have_sequence.inc
CREATE TABLE t (a INT, b VARCHAR(128));
INSERT INTO t SELECT seq, CONCAT('s',seq) FROM seq_1_to_100;
--connect (con1,localhost,root,,)
--send ALTER TABLE t MODIFY b BLOB
--connection default
ANALYZE TABLE t PERSISTENT FOR ALL;
--connection con1
--reap
ANALYZE TABLE t PERSISTENT FOR ALL;
--connection default
--disconnect con1
select db_name,table_name,column_name from mysql.column_stats;
drop table t;

10.4 900c4d69

select db_name,table_name,column_name from mysql.column_stats;
db_name	table_name	column_name
test	t	a
test	t	b

The column b shouldn't be there, as the statistics aren't collected for blobs.



 Comments   
Comment by Sergei Petrunia [ 2023-09-26 ]

The latest fix is ok to push.

Comment by Elena Stepanova [ 2023-09-26 ]

It is still in testing though, issues have been and are being discussed outside JIRA.

Comment by Elena Stepanova [ 2023-10-09 ]

The exchange of information regarding intermediate issues was happening on slack.

The last test run on be4b1fd502981f93dff6b976ea59f5fce690b2fc didn't reveal any problems specific to the change, so it can be pushed into 10.6 main.

Comment by Nikita Malyavin [ 2024-01-02 ]

the commits are in the mainline, shouldnt the ticket be closed?

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