dynamobi/dynamobi — Issue #670: [FRG-202] Interval multiplication and division with decimal and approx broken
Author: dynamobi-build
Created: 2011-12-30 03:42:28+00:00
State: open
Labels: FRG

[reporter="angel", created="Mon, 11 Sep 2006 23:23:45 -0500 (GMT-05:00)"]
Interval multiplication and division with integral types works okay.

Get AssertionError with decimals, and sometimes broken with approx types.

See testcases in SqlOperatorTests.testMultiplyOperator and testDivideOperator.

0: jdbc:farrago:> values interval '5' hour / 2;

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

| EXPR$0 |

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

| +02:30:00 |

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

1 row selected (1.775 seconds)

0: jdbc:farrago:> values interval '5' hour / 2.0;

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

net.sf.farrago.jdbc.FarragoJdbcUtil$FarragoSqlException: java.lang.AssertionError: null

at org.eigenbase.rel.ReduceDecimalsRule$BinaryArithmeticExpander.expand(ReduceDecimalsRule.java:911)

at org.eigenbase.rel.ReduceDecimalsRule$DecimalShuttle.rewriteCall(ReduceDecimalsRule.java:206)

at org.eigenbase.rel.ReduceDecimalsRule$DecimalShuttle.visitCall(ReduceDecimalsRule.java:160)

at org.eigenbase.rel.ReduceDecimalsRule$DecimalShuttle.visitCall(ReduceDecimalsRule.java:122)

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

at org.eigenbase.rex.RexProgramBuilder.add(RexProgramBuilder.java:577)

at org.eigenbase.rex.RexProgramBuilder.create(RexProgramBuilder.java:532)

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

at org.eigenbase.relopt.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:247)

at org.eigenbase.relopt.hep.HepPlanner.applyRule(HepPlanner.java:439)

at org.eigenbase.relopt.hep.HepPlanner.applyRules(HepPlanner.java:340)

at org.eigenbase.relopt.hep.HepPlanner.executeInstruction(HepPlanner.java:210)

at org.eigenbase.relopt.hep.HepInstruction$RuleInstance.execute(HepInstruction.java:136)

at org.eigenbase.relopt.hep.HepPlanner.executeProgram(HepPlanner.java:158)

at org.eigenbase.relopt.hep.HepPlanner.findBestExp(HepPlanner.java:144)

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

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

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

at net.sf.farrago.query.FarragoPreparingStmt.implement(FarragoPreparingStmt.java:331)

at net.sf.farrago.db.FarragoDatabase.implementStmt(FarragoDatabase.java:732)

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

at net.sf.farrago.query.FarragoReduceExpressionsRule$ReentrantValuesStmt.executeImpl(FarragoReduceExpressionsRule.java:283)

at net.sf.farrago.query.FarragoReentrantStmt.execute(FarragoReentrantStmt.java:91)

at net.sf.farrago.query.FarragoReduceExpressionsRule.onMatch(FarragoReduceExpressionsRule.java:108)

at org.eigenbase.relopt.AbstractRelOptPlanner.fireRule(AbstractRelOptPlanner.java:247)

at org.eigenbase.relopt.hep.HepPlanner.applyRule(HepPlanner.java:439)

at org.eigenbase.relopt.hep.HepPlanner.applyRules(HepPlanner.java:340)

at org.eigenbase.relopt.hep.HepPlanner.executeInstruction(HepPlanner.java:233)

at org.eigenbase.relopt.hep.HepInstruction$RuleClass.execute(HepInstruction.java:73)

at org.eigenbase.relopt.hep.HepPlanner.executeProgram(HepPlanner.java:158)

at org.eigenbase.relopt.hep.HepPlanner.findBestExp(HepPlanner.java:144)

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

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

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

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

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

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

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

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

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

at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:862)at net.sf.farrago.db.FarragoDbStmtContext.prepare(FarragoDbStmtContext.java:105)

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

at sqlline.SqlLine$Commands.execute(Unknown Source)

at sqlline.SqlLine$Commands.sql(Unknown Source)

at sqlline.SqlLine.dispatch(Unknown Source)

at sqlline.SqlLine.begin(Unknown Source)

at sqlline.SqlLine.mainWithInputRedirection(Unknown Source)

at sqlline.SqlLine.main(Unknown Source)

0