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

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            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.

            {code:sql}
            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;
            {code}

            {noformat}
            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...
            {noformat}

            It looks like the problem appeared in 10.2 tree with this commit:
            {noformat}
            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".
            {noformat}

            Could not reproduce on 10.1, MySQL 5.6, MySQL 5.7.
            _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._

            {code:sql}
            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;
            {code}

            {noformat}
            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...
            {noformat}

            It looks like the problem appeared in 10.2 tree with this commit:
            {noformat}
            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".
            {noformat}

            Could not reproduce on 10.1, MySQL 5.6, MySQL 5.7.
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] Stalled [ 10000 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2.9 [ 22611 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status Stalled [ 10000 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 82436 ] MariaDB v4 [ 152780 ]
            vlad.lesin Vladislav Lesin made changes -

            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.