Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#2067 closed defect (fixed)

min/max do not consider null values properly

Reported by: Dimitar Misev Owned by: ahambasan
Priority: major Milestone: 9.8
Component: qlparser Version: 9.7
Keywords: Cc: Vlad Merticariu
Complexity: Medium

Description

The attached test script produces the following output:

N = NULL = 10

-------------------------------------------------------
case 1 - area [0:0, 0:9]:
  slice 1: [N,N,N,N,N,1,1,1,1,1]
  slice 2: [ , , , , , , , , , ],2,2,2,2,2,2,2,2,2,2

max of slice 1 and 2:   10,10,10,10,10,10,10,10,10,10
min of slice 1 and 2:   10,10,10,10,10, 1, 1, 1, 1, 1
  + of slice 1 and 2:   10,10,10,10,10,10,10,10,10,10

-------------------------------------------------------
case 2 - area [0:0, 0:9]:
  slice 1: [N,N,N,N,N,1,1,1,1,1]
  slice 2: [ , , ,3,3,3,3,3, , ],2,2,2,2,2,2,2,2,2,2

max of slice 1 and 2:   0,0,0,10,10,3,3,3,0,0
min of slice 1 and 2:   0,0,0, 3, 3,1,1,1,0,0
  + of slice 1 and 2:   0,0,0,10,10,4,4,4,0,0

-------------------------------------------------------
case 3 - area [0:0, 2:11]:
  slice 1: N,N,[N,N,N,1,1,1,1,1, , ]
  slice 2:  , ,[ ,3,3,3,3,3, , ,2,2],2,2,2,2,2,2,2,2

max of slice 1 and 2:   0,10,10,3,3,3,0,0,0,0
min of slice 1 and 2:   0, 3, 3,1,1,1,0,0,0,0
  + of slice 1 and 2:   0,10,10,4,4,4,0,0,0,0

Both max and min should produce the same results when one of the operands is null, more particularly "if at least one of the operands of a cell operation is null then the overall result of this cell operation is null" (cf. documentation). However, in all cases above the null values seem to be treated as normal values, so min and max are different when a null value is present.

Attachments (1)

reproduce.sh (2.6 KB ) - added by Dimitar Misev 5 years ago.

Download all attachments as: .zip

Change History (3)

by Dimitar Misev, 5 years ago

Attachment: reproduce.sh added

comment:1 by Dimitar Misev, 5 years ago

Resolution: fixed
Status: newclosed

Just to confirm, can you post the output of the script now with the patch applied?

comment:2 by ahambasan, 5 years ago

N = NULL = 10

-------------------------------------------------------
case 1 - area [0:0, 0:9]:
  slice 1: [N,N,N,N,N,1,1,1,1,1]
  slice 2: [ , , , , , , , , , ],2,2,2,2,2,2,2,2,2,2

max of slice 1 and 2:   10,10,10,10,10,10,10,10,10,10
min of slice 1 and 2:   10,10,10,10,10,10,10,10,10,10
  + of slice 1 and 2:   10,10,10,10,10,10,10,10,10,10

-------------------------------------------------------
case 2 - area [0:0, 0:9]:
  slice 1: [N,N,N,N,N,1,1,1,1,1]
  slice 2: [ , , ,3,3,3,3,3, , ],2,2,2,2,2,2,2,2,2,2

max of slice 1 and 2:   0,0,0,10,10,3,3,3,0,0
min of slice 1 and 2:   0,0,0,10,10,1,1,1,0,0
  + of slice 1 and 2:   0,0,0,10,10,4,4,4,0,0

-------------------------------------------------------
case 3 - area [0:0, 2:11]:
  slice 1: N,N,[N,N,N,1,1,1,1,1, , ]
  slice 2:  , ,[ ,3,3,3,3,3, , ,2,2],2,2,2,2,2,2,2,2

max of slice 1 and 2:   0,10,10,3,3,3,0,0,0,0
min of slice 1 and 2:   0,10,10,1,1,1,0,0,0,0
  + of slice 1 and 2:   0,10,10,4,4,4,0,0,0,0
Note: See TracTickets for help on using tickets.