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

Order By with IFNULL and SELECT crashes server

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 10.1.17, 10.1.18, 10.1.19
    • 5.5.54, 10.0.29, 10.1.20, 10.2.3
    • Optimizer
    • None
    • Centos 7.2.1, InnoDB

    Description

      We know this is normally not how to order by on a column but because our software generated this query we experienced crashes and could reproduce it.

      Reproduction

      create table testcrash (id int not null primary key, first_name varchar(255), last_name varchar(255));
       
      select testcrash.first_name, testcrash.last_name,
      ifnull((SELECT count(id) from testcrash where id = 0), 0) as data
       from testcrash 
      group by id
      order by IFNULL((SELECT count(id) from testcrash where id = 0), 0)
      LIMIT 0,25;
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            b.brey Bas
            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.