Skip to content

Order by for big (>34 digits) int128 values is broken when index on that field is used. #7133

@AlexPeshkoff

Description

@AlexPeshkoff

Due to use of DECFLOAT(34) representation of numeric really big int128 values have same key in index. That is not dangerous when working with bitmaps on index (not more then small slowdown) but can be easily seen when index is used in ORDER BY:

create table biTest(dat int128);
insert into biTest values(12345678901234567890123456789012345678);
insert into biTest values(12345678901234567890123456789012345679);
insert into biTest values(12345678901234567890123456789012345677);
commit;
create index it on biTest(dat);
commit;

-- wrong order
select dat from biTest order by dat;

                                      DAT 

=============================================
12345678901234567890123456789012345678
12345678901234567890123456789012345679
12345678901234567890123456789012345677

alter index it inactive;
-- correct order
select dat from biTest order by dat;

                                      DAT 

=============================================
12345678901234567890123456789012345677
12345678901234567890123456789012345678
12345678901234567890123456789012345679

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions