Opened 10 years ago

Closed 10 years ago

#686 closed defect (fixed)

CellDomain is using lexicographical comparison of int indexes

Reported by: Piero Campalani Owned by: Piero Campalani
Priority: critical Milestone: 9.0.x
Component: petascope Version: development
Keywords: celldomain order min max Cc: Dimitar Misev, Vlad Merticariu, Alex Dumitru
Complexity: Easy

Description

WCPS CellDomain constructor takes min/max bounds as Strings and compare min<max order by means of the String's compareTo method, which is based on Unicode chars.

Numerical comparison must be used instead.

This is a sever bug, which can inhibit queries like:

for c in ( eobstest ) 
return encode( 
  c[ Long:"CRS:1"(26:138) ],
"csv")

==> Invalid cell domain element: lower bound 26 cannot be larger than upper bound 138

(Adding Alex/Vlad in Cc to confirm this is not the case in WCPS 2.0 implementation).

Change History (3)

comment:1 by Piero Campalani, 10 years ago

Status: newaccepted

comment:2 by Piero Campalani, 10 years ago

Strings in CellDomainElements were rightly introduced to fix #335, hence allowing more flexible subsets to slip through RasQL: algebric operations and iterator variables.

Since RasQL would throw a proper exception when the lower bound of the subset is greater than the upper bound, we can safely remove this duplicate guard from Java.

$ rasql -q "select m[10:1,0:1] from mr as m" --out hex
==> rasdaman error 389: Execution error 389 in line 1, column 12, near token :: 
No interval (in case of fixed bounds, the upper one can not be smaller than the lower one).

comment:3 by Dimitar Misev, 10 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.