LucidDB / luciddb

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

[FRG-55] type mismatch error when inserting into a nullable decimal column a casted decimal value #815

Closed dynamobi-build closed 12 years ago

dynamobi-build commented 12 years ago

[reporter="schoi", created="Thu, 23 Feb 2006 16:36:40 -0500 (GMT-05:00)"] repro:
-----------
create table decT (d decimal primary key, d2 decimal);

insert into decT values(cast (2.99 as integer), cast (2.99 as integer)); -- okay
insert into decT values(cast (3.99 as double), cast (2.99 as double)); -- okay
insert into decT values(cast (4.99 as decimal), cast (2.99 as decimal));

output:
-------------
Error: java.lang.AssertionError: Type mismatch:
rowtype of new rel:
RecordType(DECIMAL(19, 0) NOT NULL EXPR$0, DECIMAL(19, 0) EXPR$1) NOT NULL
rowtype of set:
RecordType(DECIMAL(19, 0) NOT NULL EXPR$0, DECIMAL(19, 0) NOT NULL EXPR$1) NOT NULL (state=,code=0)
net.sf.farrago.util.FarragoUtil$FarragoSqlException: java.lang.AssertionError: Type mismatch:
rowtype of new rel:
RecordType(DECIMAL(19, 0) NOT NULL EXPR$0, DECIMAL(19, 0) EXPR$1) NOT NULL
rowtype of set:
RecordType(DECIMAL(19, 0) NOT NULL EXPR$0, DECIMAL(19, 0) NOT NULL EXPR$1) NOT NULL
        at org.eigenbase.relopt.RelOptUtil.equal(RelOptUtil.java:870)
        at com.disruptivetech.farrago.volcano.RelSubset.add(RelSubset.java:209)
        at com.disruptivetech.farrago.volcano.RelSet.add(RelSet.java:133)
        at com.disruptivetech.farrago.volcano.VolcanoPlanner.reregister(VolcanoPlanner.java:848)
        at com.disruptivetech.farrago.volcano.RelSet.mergeWith(RelSet.java:231)
        at com.disruptivetech.farrago.volcano.VolcanoPlanner.merge(VolcanoPlanner.java:1007)
        at com.disruptivetech.farrago.volcano.VolcanoPlanner.registerSubset(VolcanoPlanner.java:1257)
        at com.disruptivetech.farrago.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1143)
        at com.disruptivetech.farrago.volcano.VolcanoPlanner.register(VolcanoPlanner.java:481)
        at com.disruptivetech.farrago.volcano.VolcanoRuleCall.transformTo(VolcanoRuleCall.java:88)
        at org.eigenbase.rel.ReduceDecimalsRule.onMatch(ReduceDecimalsRule.java:174)

dynamobi-build commented 12 years ago

[author="jpham", created="Sat, 29 Apr 2006 12:35:57 -0500 (GMT-05:00)"] fixed in lu 6456