[MDEV-17659] Error 175 "File too short; Expected more data in file" upon SELECT with re-opened temporary table after concurrent OPTIMIZE and DDL Created: 2018-11-10  Updated: 2021-04-26  Resolved: 2019-06-18

Status: Closed
Project: MariaDB Server
Component/s: Admin statements, Data Definition - Temporary, Storage Engine - Aria, Storage Engine - MyISAM
Affects Version/s: 10.2, 10.3, 10.4
Fix Version/s: 10.2.26, 10.3.17, 10.4.6

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

Issue Links:
Duplicate
duplicates MDEV-19055 Assertion `(_my_thread_var())->thr_er... Closed
Relates
relates to MDEV-17622 Assertion `block->type == PAGECACHE_E... Closed
relates to MDEV-17636 Assertion `pagecache->block_root[i].s... Closed
relates to MDEV-17622 Assertion `block->type == PAGECACHE_E... Closed

 Description   

Note: See also MDEV-17636, they share essential parts of the test case, might be related.

Note: Run the test cases with --repeat=N. They usually fail for me within 5 attempts, but it can vary on different machines and builds.

This one only fails with Aria:

CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=Aria;
 
--connect (con1,localhost,root,,test)
CREATE TEMPORARY TABLE tmp (pk INT)  ENGINE=Aria;
INSERT INTO tmp (pk) VALUES (NULL); 
SELECT * FROM tmp tx, tmp ty;
DELETE FROM tmp LIMIT 1;
 
--connection default
--send
  CREATE TABLE t2 SELECT * FROM t1;
 
--connection con1
OPTIMIZE TABLE tmp;
--connection default
--reap
 
--connection con1
INSERT INTO tmp VALUES (1);
SELECT * FROM tmp tx, tmp ty;
 
# Cleanup
--disconnect con1
--connection default
DROP TABLE t1, t2;

10.2 5cfb043d29

mysqltest: At line 20: query 'SELECT * FROM tmp tx, tmp ty' failed: 1030: Got error 175 "File too short; Expected more data in file" from storage engine Aria

2018-11-10 19:27:57 140306518107904 [ERROR] Got error 175 when reading table '/data/bld/10.2/mysql-test/var/tmp/mysqld.1/#sql445c_a_2'

This one fails both with Aria and MyISAM (slightly more complicated SELECTs), otherwise the same:

CREATE TABLE t1 (pk INT PRIMARY KEY);
 
--connect (con1,localhost,root,,test)
CREATE TEMPORARY TABLE tmp (pk INT);
INSERT INTO tmp (pk) VALUES (NULL); 
SELECT pk FROM t1 WHERE pk IN ( SELECT pk FROM tmp )
  UNION
SELECT pk FROM t1 WHERE pk IN ( SELECT pk FROM tmp );
DELETE FROM tmp LIMIT 1;
 
--connection default
--send
  CREATE TABLE t2 SELECT * FROM t1;
 
--connection con1
OPTIMIZE TABLE tmp;
--connection default
--reap
 
--connection con1
INSERT INTO tmp VALUES (1),(2);
DELETE FROM tmp LIMIT 1;
SELECT * FROM tmp tx, tmp ty;
 
# Cleanup
--disconnect con1
--connection default
DROP TABLE t1, t2;

10.2 5cfb043d29

mysqltest: At line 23: query 'SELECT * FROM tmp tx, tmp ty' failed: 1030: Got error 175 "File too short; Expected more data in file" from storage engine MyISAM

2018-11-10 19:28:34 140373883832064 [ERROR] Got error 175 when reading table '/data/bld/10.2/mysql-test/var/tmp/mysqld.1/#sql44b3_5_0'



 Comments   
Comment by Elena Stepanova [ 2019-05-18 ]

Still reproducible.

Comment by Michael Widenius [ 2019-06-18 ]

MDEV-19055 fixed this issue

Comment by Michael Widenius [ 2019-06-18 ]

Fixed as part of MDEV-19055

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