[MDEV-18063] "Index for table .. is corrupt; try to repair it" in error log after failed attempt to add index on persistent column Created: 2018-12-22  Updated: 2023-07-28  Resolved: 2023-07-28

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - MyISAM, Virtual Columns
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: not-10.2, not-10.3, not-10.4

Issue Links:
Relates
relates to MDEV-17619 Error 126 "Index file is crashed" or ... Closed

 Description   

CREATE TABLE t1 ( 
  pk BIGINT AUTO_INCREMENT,
  f1 CHAR(15),
  f2 INT,
  v1 CHAR(10) AS (f1) VIRTUAL,
  v2 INT AS (f2) PERSISTENT,
  PRIMARY KEY(pk)
) ENGINE=MyISAM;
 
SET SQL_MODE= 'STRICT_TRANS_TABLES';
 
INSERT INTO t1 (f1,f2) VALUES
  ('0001',1),('01000100',7),('00011',9),('110100011100',1),
  (NULL,76),('000100101',1),('011011111',0),('01010',3),
  ('001001111',8),('01110',4),('0110000011000',1),('101110001110100',4),
  ('0101100',5),('0000010001110',1),('101111011100000',9),('00',0),
  ('1101000100100',6),(NULL,0),('0',8),('1',8),
  ('0',1),('001011100',6),('0111',93),('00001000110111',0),('11110',6),
  ('111000010',4),('10101101101110',5),('10',5),('00011101001',29),
  ('1',8),('111001',9),('01111',2),('100011011111100',4),
  ('1100',8),('101011011110110',1),('10010100101',4),(NULL,244),
  (NULL,1),('0100',109),('11000',8),('0000111',5),
  ('1111100000',9),('0010001',9),('01111111000000',1),('011100100',5),
  ('100101',2),('0',6),('01000001101101',9),('001110000101',3),
  ('1001',0),('10011101000110',0),(NULL,4),('00',8),
  ('01',1),('1',5),('101111101011',1),('1010111010',110),
  ('11010001001',9),(NULL,8),('11110111',1),('0',8),
  ('1111',2),(NULL,71),('11000101',9),('0111111011',61),
  ('0',6),('10110011',0),('101010',7),(NULL,7),
  ('00111',7),('0',35),('10000101',7),(NULL,9),
  ('000000001010',0),(NULL,2),('10111101000',1),(NULL,6),
  ('0101000010101',5),('01111000100010',5),('0',3),('01100',2),
  (NULL,6),('0011110',9),('010011',17),('1001',2),
  ('01010000110',1),('011000',8),(NULL,9),('010000011',2),
  ('111110100100000',8),('10000',0),('0000111110',9),('1101111',4),
  ('010110',23),('00110',4),('1',1),('011000110',0),
  ('101110',8),('0001010111100',1),('011101',6);
 
--error 0,ER_DATA_TOO_LONG
ALTER TABLE t1 ADD KEY (v2);
 
# Cleanup
DROP TABLE t1;

10.2 dc2856ad6

2018-12-22 17:26:35 139905558898432 [ERROR] mysqld: Index for table './test/#sql-1730_4.MYI' is corrupt; try to repair it
^ Found warnings in /data/bld/10.2/mysql-test/var/log/mysqld.1.err

Not reproducible on 10.3, 10.4.



 Comments   
Comment by Elena Stepanova [ 2019-07-27 ]

The failure stopped happening on 10.2 after this commit:

commit 69abd43703fcf68c4cf1056bf5bd56c690de5b4e
Author: Sergei Golubchik
Date:   Sun Mar 10 18:55:35 2019 +0100
 
    MDEV-17070 Table corruption or Assertion `table->file->stats.records > 0 || error' or Assertion `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())' failed upon actions on temporary table

5.5 and 10.1 remain affected.

Comment by Elena Stepanova [ 2023-07-28 ]

10.1 is EOL

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