dynamobi/dynamobi — Issue #311: [LDB-9] cannot insert into column of numeric type
Author: dynamobi-build
Created: 2011-12-30 02:28:48+00:00
State: open
Labels: LDB

[reporter="schoi", created="Thu, 19 Jan 2006 10:40:59 -0500 (GMT-05:00)"]
Repro steps:

create schema s;

set schema 's';

create table t (coldec decimal(2,1));

insert into t values(1.2);

==> Error: java.lang.AssertionError: Internal error: Cannot add expression of different type to set:

set type is RecordType(DECIMAL(2, 1) NOT NULL EXPR$0) NOT NULL

expression type is RecordType(DECIMAL(2, 1) EXPR$0) NOT NULL

set is com.disruptivetech.farrago.volcano.RelSet@e8f8c5

expression is ProjectRel.NONE(child=Subset#1.NONE,EXPR$0=CAST($0):DECIMAL(2, 1)) (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: java.lang.AssertionError: Internal error: Cannot add expression of different type to set:

set type is RecordType(DECIMAL(2, 1) NOT NULL EXPR$0) NOT NULL

expression type is RecordType(DECIMAL(2, 1) EXPR$0) NOT NULL

set is com.disruptivetech.farrago.volcano.RelSet@e8f8c5

expression is ProjectRel.NONE(child=Subset#1.NONE,EXPR$0=CAST($0):DECIMAL(2, 1))

at org.eigenbase.util.Util.newInternal(Util.java:846)

at com.disruptivetech.farrago.volcano.RelSet.failType(RelSet.java:279)

at com.disruptivetech.farrago.volcano.RelSet.addInternal(RelSet.java:190)

at com.disruptivetech.farrago.volcano.RelSubset.add(RelSubset.java:211)

at com.disruptivetech.farrago.volcano.RelSet.add(RelSet.java:133)

at com.disruptivetech.farrago.volcano.VolcanoPlanner.reregister(VolcanoPlanner.java:831)

at com.disruptivetech.farrago.volcano.RelSet.mergeWith(RelSet.java:228)

at com.disruptivetech.farrago.volcano.VolcanoPlanner.merge(VolcanoPlanner.java:990)

at com.disruptivetech.farrago.volcano.VolcanoPlanner.registerSubset(VolcanoPlanner.java:1237)

at com.disruptivetech.farrago.volcano.VolcanoPlanner.registerImpl(VolcanoPlanner.java:1126)

at com.disruptivetech.farrago.volcano.VolcanoPlanner.register(VolcanoPlanner.java:464)

at com.disruptivetech.farrago.volcano.VolcanoRuleCall.transformTo(VolcanoRuleCall.java:96)

at org.eigenbase.rel.ReduceDecimalsRule.onMatch(ReduceDecimalsRule.java:117)

at com.disruptivetech.farrago.volcano.VolcanoRuleCall.onMatch(VolcanoRuleCall.java:135)

at com.disruptivetech.farrago.volcano.VolcanoPlanner.findBestExp(VolcanoPlanner.java:413)

at org.eigenbase.oj.stmt.OJPreparingStmt.optimize(OJPreparingStmt.java:281)

at net.sf.farrago.query.FarragoPreparingStmt.optimize(FarragoPreparingStmt.java:592)

at org.eigenbase.oj.stmt.OJPreparingStmt.prepareSql(OJPreparingStmt.java:251)

at net.sf.farrago.query.FarragoPreparingStmt.prepare(FarragoPreparingStmt.java:238)

at net.sf.farrago.db.FarragoDatabase$2.initializeEntry(FarragoDatabase.java:630)

at net.sf.farrago.util.FarragoObjectCache.pin(FarragoObjectCache.java:157)

at net.sf.farrago.db.FarragoDatabase.prepareStmtImpl(FarragoDatabase.java:640)

at net.sf.farrago.db.FarragoDatabase.prepareStmt(FarragoDatabase.java:520)

at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:768)

at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:719)

at net.sf.farrago.db.FarragoDbStmtContext.prepare(FarragoDbStmtContext.java:151)

at net.sf.farrago.jdbc.engine.FarragoJdbcEngineStatement.execute(FarragoJdbcEngineStatement.java:104)

Note that it works on Farrago.