Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#592 closed defect (fixed)

Cast to bool in RasQL

Reported by: pcampalani Owned by: vliaukevich
Priority: minor Milestone: 9.0.x
Component: qlparser Version: development
Keywords: cast bool rasql Cc: mantovani@…
Complexity: Medium

Description

Casting to a boolean (scalar or marray) does not seem to work in RasQL: it seems to take the first byte instead of evaluating whether the number/cell is not 0:

$ rasql --user rasadmin --passwd rasadmin --out hex -q "select ((bool)((c) [3,50:52,151])) from eobstest AS c":
  Result object 1: 48 7b b1 

$ rasql --user rasadmin --passwd rasadmin --out hex -q "select (((c) [3,50:52,151])) from eobstest AS c"
  Result object 1: 48 fd 7b fc b1 fb 

With scalars, things work, although there is still a problem with the CSV encoding (#588).

$ rasql --user rasadmin --passwd rasadmin --out string -q "select ((bool)(100)) from eobstest AS c"
  Result element 1: t    <- OK

$ rasql --user rasadmin --passwd rasadmin --out string -q "select csv((bool)(100)) from eobstest AS c"
  Result object 1: {100} <- WRONG

Change History (7)

comment:1 Changed 4 years ago by pcampalani

  • Priority changed from major to minor

Lowering priority since WCPS queries can still allow non-CSV encoded scalar expressions.

comment:2 Changed 3 years ago by dmisev

  • Complexity changed from Hard to Medium
  • Component changed from undecided to qlparser
  • Milestone changed from Future to 9.0.x
  • Owner changed from dmisev to vliaukevich
  • Status changed from new to assigned

comment:3 Changed 3 years ago by vliaukevich

Do we want CSV converter return 0/1 for boolean values, or T/F, or t/f?

comment:4 Changed 3 years ago by dmisev

Let's set it to t/f, seems like this is what rasql outputs.

comment:5 Changed 3 years ago by dmisev

Can be closed, right?

comment:6 Changed 3 years ago by vliaukevich

  • Resolution set to fixed
  • Status changed from assigned to closed

Yes, it was fixed in changeset:c6523460dc and changeset:0310ad111.
Btw, I don't receive emails when patches are applied anymore. Was it done intentionally?

comment:7 Changed 3 years ago by dmisev

Me neither, I have to check what happened with that.

Note: See TracTickets for help on using tickets.