Closed dynamobi-build closed 12 years ago
[author="jvs", created="Thu, 9 Feb 2006 16:30:31 -0500 (GMT-05:00)"]
I put in a fix for the sarg problem (I wasn't preserving the scaled numeric type correctly). But now I get an assertion from ReduceDecimalsRule; Volcano is complaining because it didn't preserve nullability (compare $3 with $f3):
0: jdbc:farrago:> select coldec from t where coldec < 2;
Error: java.lang.AssertionError: Type mismatch:
rowtype of new rel:
RecordType(CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL $0, DECIMAL(2, 1) $1, CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL $2, DECIMAL(2, 1) NOT NULL $3) NOT NULL
rowtype of set:
RecordType(CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL $f0, DECIMAL(2, 1) $f1, CHAR(1) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL $f2, DECIMAL(2, 1) $f3) NOT NULL (state=,code=0)
0
[author="jvs", created="Thu, 9 Feb 2006 16:31:01 -0500 (GMT-05:00)"] Sarg fix is in eigenchange 5390.
[author="jpham", created="Wed, 15 Feb 2006 11:42:57 -0500 (GMT-05:00)"] this seems to be fixed by 5467
[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)