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

Order By with IFNULL and SELECT crashes server

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 10.1.17, 10.1.18, 10.1.19
    • Fix Version/s: 5.5.54, 10.0.29, 10.1.20, 10.2.3
    • Component/s: Optimizer
    • Labels:
      None
    • Environment:
      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

            Assignee:
            Unassigned
            Reporter:
            b.brey Bas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Git Integration