dynamobi/dynamobi — Issue #667: [FRG-205] TEST - cast from nullable DOUBLE to INT rounds rather than trucates
Author: dynamobi-build
Created: 2011-12-30 03:42:15+00:00
State: open
Labels: FRG, Java Calc Codegen

[reporter="jvs", created="Tue, 12 Sep 2006 13:36:26 -0500 (GMT-05:00)"]

Description of bug found:

0: jdbc:farrago:> !run test.sql

1/13 create schema anil;

No rows affected (0.076 seconds)

2/13

3/13 create table anil.t3(

i int not null primary key,

d1 double,

d2 double not null,

n1 numeric(10,2),

n2 numeric(10,2) not null

);

No rows affected (0.556 seconds)

4/13

5/13 insert into anil.t3 values (1, 9.6, 9.6, 9.6, 9.6);

1 row affected (0.722 seconds)

6/13

7/13 alter system set "calcVirtualMachine"='CALCVM_JAVA';

No rows affected (0.018 seconds)

8/13

9/13 select cast(d1 as int), cast(d2 as int), cast(n1 as int), cast(n2 as int)

from anil.t3;

+---------+---------+---------+---------+

| EXPR$0 | EXPR$1 | EXPR$2 | EXPR$3 |

+---------+---------+---------+---------+

| 9 | 10 | 10 | 10 |

+---------+---------+---------+---------+

1 row selected (0.322 seconds)

10/13

11/13alter system set "calcVirtualMachine"='CALCVM_FENNEL';

No rows affected (0.036 seconds)

12/13

13/13select cast(d1 as int), cast(d2 as int), cast(n1 as int), cast(n2 as int)

from anil.t3;

+---------+---------+---------+---------+

| EXPR$0 | EXPR$1 | EXPR$2 | EXPR$3 |

+---------+---------+---------+---------+

| 10 | 10 | 10 | 10 |

+---------+---------+---------+---------+

1 row selected (0.199 seconds)