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

Comparisson on RVC are still incorrect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • None

    Description

      See PHOENIX-3383

      create table test(k1 integer not null, k2 integer not null, k3 integer not null, v integer, constraint pk primary key (k1, k2 desc, k3));
      
      upsert into test values(1,1,1,2);
      upsert into test values(1,2,1,2);
      upsert into test values(1,3,1,2);
      upsert into test values(1,4,1,2);
      
      select * from test where (k1, k2, k3) = (1,2,1) order by k1, k2 desc, k3;
      +-----+-----+-----+----+
      | K1  | K2  | K3  | V  |
      +-----+-----+-----+----+
      | 1   | 2   | 1   | 2  |
      +-----+-----+-----+----+
      
      select * from test where (k1, k2, k3) > (1,2,1) order by k1, k2 desc, k3;
      +-----+-----+-----+----+
      | K1  | K2  | K3  | V  |
      +-----+-----+-----+----+
      | 1   | 4   | 1   | 2  |
      | 1   | 3   | 1   | 2  |
      | 1   | 2   | 1   | 2  |
      | 1   | 1   | 1   | 2  |
      +-----+-----+-----+----+
      
      select * from test where (k1, k2, k3) < (1,2,1) order by k1, k2 desc, k3;
      +-----+-----+-----+----+
      | K1  | K2  | K3  | V  |
      +-----+-----+-----+----+
      | 1   | 4   | 1   | 2  |
      | 1   | 3   | 1   | 2  |
      | 1   | 2   | 1   | 2  |
      | 1   | 1   | 1   | 2  |
      +-----+-----+-----+----+
      

      Looks like in this case each > or < comparison will simply return all rows. This does not happen when the second key part is not descending.

      Edit: > and < return all rows with the same first key part (k1)

      Attachments

        1. PHOENIX-4976-test.txt
          2 kB
          Lars Hofhansl

        Issue Links

          Activity

            People

              Unassigned Unassigned
              larsh Lars Hofhansl
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: