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

crash in filesort() with simple ordered delete

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.1.5
    • Fix Version/s: 10.1.6
    • Labels:
      None
    • Environment:
      Win x64

      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;
      

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            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.
            
            Show
            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.
            Hide
            psergey 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.
            Show
            psergey 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.

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                sbester1 sbester1
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: