Uploaded image for project: 'Phoenix'
  1. Phoenix
  2. PHOENIX-3014

SELECT DISTINCT pk ORDER BY pk DESC gives the wrong results with salted tables

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.8.0
    • Labels:
      None

      Description

      create table T(pk1 varchar not null, pk2 varchar not null, constraint pk primary key(pk1, pk2)) SALT_BUCKETS=8;
      upsert into T values('1','1');
      upsert into T values('1','2');
      upsert into T values('2','1');
      select /*+ RANGE_SCAN */ distinct(pk1) from T order by pk1 desc;
      +------+
      | PK1  |
      +------+
      | 1    |
      | 2    |
      | 1    |
      select distinct(pk1) from T order by pk1 desc;
      +------+
      | PK1  |
      +------+
      | 1    |
      | 2    |
      | 1    |
      +------+
      

        Attachments

        1. PHOENIX-3014_untested.patch
          3 kB
          James Taylor
        2. 3014-v2.txt
          4 kB
          Lars Hofhansl

          Activity

            People

            • Assignee:
              jamestaylor James Taylor
              Reporter:
              lhofhansl Lars Hofhansl
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: