Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#592 closed defect (fixed)

Cast to bool in RasQL

Reported by: Piero Campalani Owned by: Veranika Liaukevich
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 by Piero Campalani, 10 years ago

Priority: majorminor

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

comment:2 by Dimitar Misev, 10 years ago

Complexity: HardMedium
Component: undecidedqlparser
Milestone: Future9.0.x
Owner: changed from Dimitar Misev to Veranika Liaukevich
Status: newassigned

comment:3 by Veranika Liaukevich, 10 years ago

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

comment:4 by Dimitar Misev, 10 years ago

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

comment:5 by Dimitar Misev, 10 years ago

Can be closed, right?

comment:6 by Veranika Liaukevich, 10 years ago

Resolution: fixed
Status: assignedclosed

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 by Dimitar Misev, 10 years ago

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

Note: See TracTickets for help on using tickets.