dynamobi/dynamobi — Issue #805: [FRG-65] NULLIF with a parameter count other than 2 causes assertion failure
Author: dynamobi-build
Created: 2011-12-30 03:49:55+00:00
State: open
Labels: FRG, SQL Validator

[reporter="jvs", created="Wed, 8 Mar 2006 19:26:03 -0500 (GMT-05:00)"]
Should be a validation error instead (NULLIF takes exactly two parameters).

0: jdbc:farrago:> select nullif() from sales.depts;

Error: java.lang.AssertionError: Internal error: Invalid arg count: NULLIF() (state=,code=0)

net.sf.farrago.util.FarragoUtil$FarragoSqlException: java.lang.AssertionError: Internal error: Invalid arg count: NULLIF()

at org.eigenbase.util.Util.newInternal(Util.java:820)

at org.eigenbase.sql.fun.SqlNullifFunction.rewriteCall(SqlNullifFunction.java:50)

at org.eigenbase.sql.validate.SqlValidatorImpl.performUnconditionalRewrites(SqlValidatorImpl.java:622)

at org.eigenbase.sql.validate.SqlValidatorImpl.performUnconditionalRewrites(SqlValidatorImpl.java:627)

at org.eigenbase.sql.validate.SqlValidatorImpl.performUnconditionalRewrites(SqlValidatorImpl.java:599)

at org.eigenbase.sql.validate.SqlValidatorImpl.validateScopedExpression(SqlValidatorImpl.java:440)

at org.eigenbase.sql.validate.SqlValidatorImpl.validate(SqlValidatorImpl.java:273)

at net.sf.farrago.query.FarragoSqlValidator.validate(FarragoSqlValidator.java:62)

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

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

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

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

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

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

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