dynamobi/dynamobi — Issue #815: [FRG-55] type mismatch error when inserting into a nullable decimal column a casted decimal value
Author: dynamobi-build
Created: 2011-12-30 03:50:18+00:00
State: open
Labels: FRG

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