dynamobi/dynamobi — Issue #833: [FRG-37] comparing decimal to (number) without casting results in java Assertion Error
Author: dynamobi-build
Created: 2011-12-30 03:51:42+00:00
State: open
Labels: FRG

[reporter="schoi", created="Tue, 7 Feb 2006 20:13:22 -0500 (GMT-05:00)"]
Repro:

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

insert into t values(1.2);

select coldec from t where coldec < 2;

-- this one works: "select coldec from t where coldec < cast(2 as integer);"

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

Error: java.lang.AssertionError: null (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: java.lang.AssertionError: null

at org.eigenbase.rex.RexBuilder.makeExactLiteral(RexBuilder.java:398)

at org.eigenbase.sarg.SargEndpoint.applyRounding(SargEndpoint.java:182)

at org.eigenbase.sarg.SargEndpoint.setFinite(SargEndpoint.java:149)

at org.eigenbase.sarg.SargMutableEndpoint.setFinite(SargMutableEndpoint.java:60)

at org.eigenbase.sarg.SargIntervalBase.setUpper(SargIntervalBase.java:157)

at org.eigenbase.sarg.SargIntervalExpr.setUpper(SargIntervalExpr.java:92)

at org.eigenbase.sarg.SargRexAnalyzer$ComparisonConvertlet.convert(SargRexAnalyzer.java:210)

at org.eigenbase.sarg.SargRexAnalyzer$NodeVisitor.visitCall(SargRexAnalyzer.java:306)

at org.eigenbase.rex.RexCall.accept(RexCall.java:201)

at org.eigenbase.sarg.SargRexAnalyzer.analyze(SargRexAnalyzer.java:134)

at com.lucidera.lcs.LcsIndexAccessRule.onMatch(LcsIndexAccessRule.java:90)

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

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

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

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

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

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)