dynamobi/dynamobi — Issue #754: [FRG-116] java calc generates incorrect code for complex case statements
Author: dynamobi-build
Created: 2011-12-30 03:47:04+00:00
State: open
Labels: FRG, Java Calc Codegen

[reporter="jpham", created="Sat, 29 Apr 2006 12:44:56 -0500 (GMT-05:00)"]
alter system set "calcVirtualMachine"='CALCVM_JAVA';

create schema s;

set schema 's';

-- we don't rescale value here

values case when true then 123 else 10.5 end;

+---------+

| EXPR$0 |

+---------+

| 12.3 |

+---------+

-- this one doesn't compile

values case when true then 10.35 else 1.5e3 end;

0: jdbc:farrago:> Error: org.codehaus.janino.util.TunnelException: org.codehaus.janino.util.TunnelException: File /home/jpham/lu/farrago/./classes/net/sf/farrago/dynamic/stmt54873/ExecutableStmt.java, Line 95, Column 37: Cannot compare types "net.sf.farrago.dynamic.stmt54873.ExecutableStmt$Oj_inner_0" and "double" (state=,code=0)

-- fennel codegen is ok

alter system set "calcVirtualMachine"='CALCVM_FENNEL';

values case when true then 123 else 10.5 end;

+---------+

| EXPR$0 |

+---------+

| 123.0 |

+---------+

values case when true then 10.35 else 1.5e3 end;

+---------+

| EXPR$0 |

+---------+

| 10.35 |

+---------+