LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-205] TEST - cast from nullable DOUBLE to INT rounds rather than trucates #667

Open dynamobi-build opened 12 years ago

dynamobi-build commented 12 years ago

[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)

dynamobi-build commented 12 years ago

[author="boris", created="Tue, 12 Sep 2006 13:37:57 -0500 (GMT-05:00)"]
I assume John Pham will have a regression test checked in, so we should expand upon it, and/or think of other test holes of this type.

dynamobi-build commented 12 years ago

[author="elin", created="Tue, 19 Sep 2006 14:07:25 -0500 (GMT-05:00)"] Moving this over to you khahn.