Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-13751

Interrupted SELECT fails with 1030: 'Got error 1 "Operation not permitted" from storage engine MyISAM'

Details

    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.

      Attachments

        Issue Links

          Activity

            There are no comments yet on this issue.

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.