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
Attachments
Issue Links
- is duplicated by
-
PHOENIX-4841 Filters that uses RVC with pk columns where with DESC sort order don't work correctly
- Closed
- is related to
-
PHOENIX-3383 Comparison between descending row keys used in RVC is reverse
- Closed