Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-3485

ORDER BY no longer working in some queries

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • 1.2.5
    • 1.4.4
    • ?
    • None
    • debian 9
    • 2020-3, 2020-4, 2020-5

    Description

      bug not present in 1.1.7 and definitely present in 1.2.5

      order by is not correctly processed for trivial queries

      let's say we want to compute sales for region 'x' and 'y', for each of 3 business units 1,2 and 3 like this:

      bu x y
      1 10 12
      2 11 11
      3 12 10

      when applying an order by clause, 'order by bu' or 'order by x' work but 'order by y' is ignored

      drop table if exists t;
      create table t(a int, b varchar(10), c decimal(7,2)) engine=columnstore;
      insert into t(a,b,c) values 
      (1,'x',10),(2,'x',11), (3, 'x', 12),
      (1,'y',12),(2,'y',11), (3, 'y', 10);
       
      -- order by column bu or x work fine
      select
      a as bu, 
      sum(case when b='x' then c else null end) as 'x',
      sum(case when b='y' then c else null end) as 'y'
      from t
      group by bu
      order by bu  /* or order by x */
      ;
       
      -- order by column y produces a random ordering of rows
      select
      a as bu, 
      sum(case when b='x' then c else null end) as 'x',
      sum(case when b='y' then c else null end) as 'y'
      from t
      group by bu
      order by y asc
      ;
      

      Attachments

        Activity

          Transition Time In Source Status Execution Times
          Roman made transition -
          Open Confirmed
          88d 19h 1
          Jose Rojas (Inactive) made transition -
          Confirmed In Progress
          83d 5h 41m 1
          Jose Rojas (Inactive) made transition -
          In Progress In Review
          2d 7h 48m 1
          Roman made transition -
          Closed Stalled
          13h 21m 1
          Roman made transition -
          Stalled Confirmed
          4s 1
          Roman made transition -
          Confirmed In Review
          8s 1
          Roman made transition -
          In Review In Testing
          14d 13h 34m 2
          Daniel Lee (Inactive) made transition -
          In Testing Closed
          12d 15h 34m 2

          People

            dleeyh Daniel Lee (Inactive)
            alebacq antoine
            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.