dynamobi/dynamobi — Issue #823: [FRG-47] casting of decimals in a case statement fails if not exactly matching P,S
Author: dynamobi-build
Created: 2011-12-30 03:51:03+00:00
State: open
Labels: FRG, Statement Processing

[reporter="schoi", created="Thu, 16 Feb 2006 18:46:31 -0500 (GMT-05:00)"]
Repro:

----------

create schema s;

set schema 's';

create table n1 (d decimal(2,1) primary key, d2 decimal(2,1));

insert into n1 values(1.2, null);

select d2, (case when d2 is null then 0.0 else d end) from n1;

+-----+---------+

| D2 | EXPR$1 |

+-----+---------+

| | 0.0 |

+-----+---------+

select d2, (case when d2 is null then 0 else d end) from n1;

output:

-------------

Error: CALL castA(s8,s4) not registered (at line:col 0:-1860292672 to 13:29, characters 0 to 335) (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: CALL castA(s8,s4) not registered (at line:col 0:-1860292672 to 13:29, characters 0 to 335)

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)