[MDEV-13751] Interrupted SELECT fails with 1030: 'Got error 1 "Operation not permitted" from storage engine MyISAM' Created: 2017-09-07  Updated: 2023-09-19  Resolved: 2017-09-18

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - MyISAM
Affects Version/s: 10.2
Fix Version/s: 10.2.9

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-32201 join_init_read_record() wrongly issue... Confirmed

 Description   

Note: In the test case below, the event can be replaced by SET max_statement_time=1. I'm keeping the event because it allows to run the test on different versions of MariaDB and MySQL.

CREATE TABLE t (i INT AUTO_INCREMENT, c VARCHAR(1), KEY(i), KEY(c,i)) ENGINE=MyISAM;
INSERT INTO t (c) VALUES ('a'),('b'),('c'),('d');
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
INSERT INTO t (c) SELECT c FROM t;
 
--let $conid = `SELECT CONNECTION_ID()`
 
eval CREATE EVENT ev ON SCHEDULE EVERY 1 SECOND DO KILL QUERY $conid;
SET GLOBAL event_scheduler = ON;
 
--let $run = 20
--disable_result_log
while ($run)
{
  --error ER_QUERY_INTERRUPTED
  SELECT 1 FROM t AS alias1, t AS alias2, t AS alias3
  WHERE alias1.c = alias2.c OR alias1.i <= 1
  ;
  --dec $run
}
 
DROP TABLE t;
SET GLOBAL event_scheduler = DEFAULT;
DROP EVENT ev;

mysqltest: At line 29: query 'SELECT 1 FROM t AS alias1, t AS alias2, t AS alias3
WHERE alias1.c = alias2.c OR alias1.i <= 1
' failed with wrong errno 1030: 'Got error 1 "Operation not permitted" from storage engine MyISAM', instead of 1317...

It looks like the problem appeared in 10.2 tree with this commit:

commit 2cfc450bf78c2d951729d1a0e8f731c0d987b1d5
Author: Igor Babaev <igor@askmonty.org>
Date:   Tue Feb 9 12:35:59 2016 -0800
 
    This is the consolidated patch for mdev-8646:
    "Re-factor the code for post-join operations".

Could not reproduce on 10.1, MySQL 5.6, MySQL 5.7.


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