dynamobi/dynamobi — Issue #822: [FRG-48] cannot set a numeric value in a case statement for a column of real datatype
Author: dynamobi-build
Created: 2011-12-30 03:50:58+00:00
State: open
Labels: FRG

[reporter="schoi", created="Thu, 16 Feb 2006 19:00:45 -0500 (GMT-05:00)"]
Like FRG-47 but with columns of "real" datatype, and this time, cannot insert any numeric values.

Repro:

----------

create schema s;

set schema 's';

create table rT (c1 real primary key, c2 real);

insert into rT values(0, null);

-- these work

select c2, (case when c2 is null then c2 else c2 end) from rT;

select c2, (case when c2 is null then null else c2 end) from rT;

-- these fail (notice different errors)

select c2, (case when c2 is null then 0 else c2 end) from rT;

-----------

Error: CALL castA(d,s4) not registered (at line:col 192:192 to 10:29, characters 0 to 162) (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: CALL castA(d,s4) not registered (at line:col 192:192 to 10:29, characters 0 to 162)

at net.sf.farrago.resource.FarragoResource$_Def0.ex(FarragoResource.java:1187)

at net.sf.farrago.fennel.FennelDbHandle.handleNativeException(FennelDbHandle.java:321)

at net.sf.farrago.fennel.FennelDbHandle.executeCmd(FennelDbHandle.java:252)

at net.sf.farrago.runtime.FarragoRuntimeContext.prepareStreamGraph(FarragoRuntimeContext.java:542)

at net.sf.farrago.runtime.FarragoRuntimeContext.access$200(FarragoRuntimeContext.java:58)

at net.sf.farrago.runtime.FarragoRuntimeContext$1.initializeEntry(FarragoRuntimeContext.java:433)

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

at net.sf.farrago.runtime.FarragoRuntimeContext.loadFennelPlan(FarragoRuntimeContext.java:453)

at net.sf.farrago.query.FarragoExecutableJavaStmt.execute(FarragoExecutableJavaStmt.java:114)

at net.sf.farrago.db.FarragoDbStmtContext.execute(FarragoDbStmtContext.java:272)

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

select c2, (case when c2 is null then 0.0 else c2 end) from rT;

-----------

Error: Calculator program compilation assertion error: Type Mismatch. Tried to MOVE s8 into a d (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: Calculator program compilation assertion error: Type Mismatch. Tried to MOVE s8 into a d

at net.sf.farrago.resource.FarragoResource$_Def0.ex(FarragoResource.java:1187)

at com.disruptivetech.farrago.calc.CalcProgramBuilder.compilationAssert(CalcProgramBuilder.java:301)

at com.disruptivetech.farrago.calc.CalcProgramBuilder.addRef(CalcProgramBuilder.java:1108)

at com.disruptivetech.farrago.calc.RexToCalcTranslator.generateProgram(RexToCalcTranslator.java:496)

at com.disruptivetech.farrago.rel.FennelCalcRel.toStreamDef(FennelCalcRel.java:168)

at net.sf.farrago.query.FarragoRelImplementor.visitFennelChild(FarragoRelImplementor.java:93)

at net.sf.farrago.query.FennelToIteratorConverter.childToStreamDef(FennelToIteratorConverter.java:418)

at net.sf.farrago.query.FennelToIteratorConverter.implement(FennelToIteratorConverter.java:146)

at org.eigenbase.oj.rel.JavaRelImplementor.visitChildInternal(JavaRelImplementor.java:382)

at net.sf.farrago.query.FarragoRelImplementor.visitChildInternal(FarragoRelImplementor.java:108)

at org.eigenbase.oj.rel.JavaRelImplementor.visitChild(JavaRelImplementor.java:369)

at org.eigenbase.oj.rel.JavaRelImplementor.visitJavaChild(JavaRelImplementor.java:343)

at org.eigenbase.oj.rel.JavaRelImplementor.implementRoot(JavaRelImplementor.java:399)

at net.sf.farrago.query.FarragoRelImplementor.implementRoot(FarragoRelImplementor.java:238)

at org.eigenbase.oj.stmt.OJPreparingStmt.implement(OJPreparingStmt.java:301)

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

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

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

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

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

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

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

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

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

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