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

          alebacq antoine created issue -
          toddstoffel Todd Stoffel (Inactive) made changes -
          Field Original Value New Value
          Rank Ranked higher
          toddstoffel Todd Stoffel (Inactive) made changes -
          Rank Ranked higher
          LinuxJedi Andrew Hutchings (Inactive) made changes -
          Fix Version/s 1.2.6 [ 23734 ]
          drrtuy Roman made changes -
          Status Open [ 1 ] Confirmed [ 10101 ]
          gdorman Gregory Dorman (Inactive) made changes -
          Assignee Roman [ drrtuy ]
          David.Hall David Hall (Inactive) made changes -
          Fix Version/s 1.4.4 [ 24039 ]
          David.Hall David Hall (Inactive) made changes -
          Assignee Roman [ drrtuy ] David Hall [ david.hall ]
          David.Hall David Hall (Inactive) made changes -
          Assignee David Hall [ david.hall ] Jose Rojas [ jrojas ]
          David.Hall David Hall (Inactive) made changes -
          Sprint 2020-3 [ 383 ]
          jrojas Jose Rojas (Inactive) made changes -
          Status Confirmed [ 10101 ] In Progress [ 3 ]
          jrojas Jose Rojas (Inactive) made changes -
          Assignee Jose Rojas [ jrojas ] Roman [ drrtuy ]
          jrojas Jose Rojas (Inactive) made changes -
          Assignee Roman [ drrtuy ] Jose Rojas [ jrojas ]
          jrojas Jose Rojas (Inactive) made changes -
          Assignee Jose Rojas [ jrojas ] Roman [ drrtuy ]
          Status In Progress [ 3 ] In Review [ 10002 ]
          David.Hall David Hall (Inactive) made changes -
          Fix Version/s 1.2.6 [ 23734 ]
          David.Hall David Hall (Inactive) made changes -
          Sprint 2020-3 [ 383 ] 2020-3, 2020-4 [ 383, 392 ]
          toddstoffel Todd Stoffel (Inactive) made changes -
          Rank Ranked higher
          toddstoffel Todd Stoffel (Inactive) made changes -
          Team ColumnStore Team
          drrtuy Roman made changes -
          Status In Review [ 10002 ] In Testing [ 10301 ]
          drrtuy Roman made changes -
          Assignee Roman [ drrtuy ] Daniel Lee [ dleeyh ]
          David.Hall David Hall (Inactive) made changes -
          Sprint 2020-3, 2020-4 [ 383, 392 ] 2020-3, 2020-4, 2020-5 [ 383, 392, 396 ]
          David.Hall David Hall (Inactive) made changes -
          Sprint 2020-3, 2020-4, 2020-5 [ 383, 392, 396 ] 2020-3, 2020-4 [ 383, 392 ]
          David.Hall David Hall (Inactive) made changes -
          Sprint 2020-3, 2020-4 [ 383, 392 ] 2020-3, 2020-4, 2020-5 [ 383, 392, 396 ]
          dleeyh Daniel Lee (Inactive) made changes -
          issue.field.resolutiondate 2020-03-25 15:26:53.0 2020-03-25 15:26:53.202
          dleeyh Daniel Lee (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status In Testing [ 10301 ] Closed [ 6 ]
          drrtuy Roman made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Stalled [ 10000 ]
          drrtuy Roman made changes -
          Status Stalled [ 10000 ] Confirmed [ 10101 ]
          drrtuy Roman made changes -
          Assignee Daniel Lee [ dleeyh ] Roman [ drrtuy ]
          drrtuy Roman made changes -
          Status Confirmed [ 10101 ] In Review [ 10002 ]
          drrtuy Roman made changes -
          Status In Review [ 10002 ] In Testing [ 10301 ]
          drrtuy Roman made changes -
          Assignee Roman [ drrtuy ] Daniel Lee [ dleeyh ]
          dleeyh Daniel Lee (Inactive) made changes -
          issue.field.resolutiondate 2020-03-26 16:25:24.0 2020-03-26 16:25:24.603
          dleeyh Daniel Lee (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status In Testing [ 10301 ] Closed [ 6 ]

          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.