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

crash in filesort() with simple ordered delete

Details

    Description

      Version: '10.1.5-MariaDB'  mariadb.org binary distribution
      [ERROR] mysqld got exception 0xc0000005 ;
      mysqld.exe!filesort()[filesort.cc:215]
      mysqld.exe!mysql_delete()[sql_delete.cc:507]
      mysqld.exe!mysql_execute_command()[sql_parse.cc:4041]
      mysqld.exe!mysql_parse()[sql_parse.cc:7178]
      mysqld.exe!dispatch_command()[sql_parse.cc:1473]
      mysqld.exe!do_command()[sql_parse.cc:1093]
      mysqld.exe!threadpool_process_request()[threadpool_common.cc:233]
      mysqld.exe!io_completion_callback()[threadpool_win.cc:568]

      How To Repeat:
      ---------------------
      Start server: mysqld.exe --no-defaults --console

      drop table if exists t1;
      create table t1(a int) engine=innodb;
      delete from t1 order by a;

      Attachments

        Activity

          sbester1 sbester1 created issue -

          Thanks for the report and the test case.

          The problem was introduced with the following revision:

          commit 4938b822634b173c0d7ef882f721b553b223fadd
          Author: Sergei Petrunia <psergey@askmonty.org>
          Date:   Sun Apr 12 04:48:42 2015 +0300
           
              MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP/ORDER BY
              
              Provide basic info about sorting/grouping done by the queries.

          elenst Elena Stepanova added a comment - Thanks for the report and the test case. The problem was introduced with the following revision: commit 4938b822634b173c0d7ef882f721b553b223fadd Author: Sergei Petrunia <psergey@askmonty.org> Date: Sun Apr 12 04:48:42 2015 +0300   MDEV-7836: ANALYZE FORMAT=JSON should provide info about GROUP/ORDER BY Provide basic info about sorting/grouping done by the queries.
          elenst Elena Stepanova made changes -
          Field Original Value New Value
          Fix Version/s 10.1 [ 16100 ]
          Assignee Sergei Petrunia [ psergey ]
          elenst Elena Stepanova made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]

          It crashes because of the following scenario:

          • DELETE code sees no WHERE clause and decides to call h->delete_all_rows().
          • We remember that in the query plan
          • ha_innobase::delete_all_rows() returns HA_ERR_NOT_IMPLEMENTED
          • execution proceeds to do regular row-by-row deletion. That includes doing filesort.
            However, we didn't set up the QEP to support sorting, so we crash.
          psergei Sergei Petrunia added a comment - It crashes because of the following scenario: DELETE code sees no WHERE clause and decides to call h->delete_all_rows(). We remember that in the query plan ha_innobase::delete_all_rows() returns HA_ERR_NOT_IMPLEMENTED execution proceeds to do regular row-by-row deletion. That includes doing filesort. However, we didn't set up the QEP to support sorting, so we crash.
          psergei Sergei Petrunia made changes -
          Fix Version/s 10.1.6 [ 19401 ]
          Fix Version/s 10.1 [ 16100 ]
          Resolution Fixed [ 1 ]
          Status Confirmed [ 10101 ] Closed [ 6 ]
          serg Sergei Golubchik made changes -
          Workflow MariaDB v3 [ 69858 ] MariaDB v4 [ 149246 ]

          People

            psergei Sergei Petrunia
            sbester1 sbester1
            Votes:
            0 Vote for this issue
            Watchers:
            5 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.