Opened 3 years ago

Closed 3 years ago

#686 closed defect (fixed)

CellDomain is using lexicographical comparison of int indexes

Reported by: pcampalani Owned by: pcampalani
Priority: critical Milestone: 9.0.x
Component: petascope Version: development
Keywords: celldomain order min max Cc: dmisev, vmerticariu, mdumitru
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 Changed 3 years ago by pcampalani

  • Status changed from new to accepted

comment:2 Changed 3 years ago by pcampalani

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 Changed 3 years ago by dmisev

  • Resolution set to fixed
  • Status changed from accepted to closed
Note: See TracTickets for help on using tickets.