LucidDB / luciddb

DEFUNCT: See README
https://github.com/LucidDB/luciddb
Apache License 2.0
53 stars 24 forks source link

[FRG-71] validator should catch usage of non-boolean column as operand to boolean operator #799

Closed dynamobi-build closed 12 years ago

dynamobi-build commented 12 years ago

[reporter="jvs", created="Tue, 14 Mar 2006 11:16:17 -0500 (GMT-05:00)"] Originally from FRG-69. The stack below shows the codegen error that results because the validator didn't catch t.b as an invalid operand to AND.

create schema sj;
set schema 'sj';

create table t(
    a int, b char(20), c varchar(20) not null,
    n varchar(128) not null primary key);
create index it_n on t(n);
create index it_bn on t(b, n);

insert into t values(1, 'vk_public', 'no match', 'SYS_BOOT');
insert into t values(2, 'vk_public', 'LocalSchema', 'SQLJ');
insert into t values(3, 'vk_public', 'LocalSchema', 'JDBC_METADATA');
insert into t values(4, null, 'LocalSchema', 'INFORMATION_SCHEMA');
insert into t values(5, null, 'LocalSchema', 'no match');

select t.*, s."name", s."visibility", s."mofClassName"
from t inner join sys_cwm."Relational"."Schema" s
on t.b and t.c = s."mofClassName";

and the stack:

Error: org.codehaus.janino.util.TunnelException: org.codehaus.janino.util.TunnelException: File /home/zfong/open/farrago/./classes/net/sf/farrago/dynamic/stmt19555/ExecutableStmt.java, Line 247, Column 46: No applicable constructor/method found for actual parameters "boolean, net.sf.farrago.dynamic.stmt19555.ExecutableStmt$Oj_inner_2, boolean, boolean"; candidates are: "void net.sf.farrago.type.runtime.NullablePrimitive$NullableBoolean.assignFromAnd3VL(boolean, boolean, boolean, boolean)" (state=,code=0)
net.sf.farrago.util.FarragoUtil$FarragoSqlException: org.codehaus.janino.util.TunnelException: org.codehaus.janino.util.TunnelException: File /home/zfong/open/farrago/./classes/net/sf/farrago/dynamic/stmt19555/ExecutableStmt.java, Line 247, Column 46: No applicable constructor/method found for actual parameters "boolean, net.sf.farrago.dynamic.stmt19555.ExecutableStmt$Oj_inner_2, boolean, boolean"; candidates are: "void net.sf.farrago.type.runtime.NullablePrimitive$NullableBoolean.assignFromAnd3VL(boolean, boolean, boolean, boolean)"
        at org.codehaus.janino.JavaSourceClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at org.eigenbase.javac.JaninoCompiler.compile(JaninoCompiler.java:79)
        at org.eigenbase.oj.stmt.OJPreparingStmt.compileClass(OJPreparingStmt.java:612)
        at org.eigenbase.oj.stmt.OJPreparingStmt.compile(OJPreparingStmt.java:534)
        at org.eigenbase.oj.stmt.OJPreparingStmt.compile(OJPreparingStmt.java:522)
        at org.eigenbase.oj.stmt.OJPreparingStmt.compileAndBind(OJPreparingStmt.java:118)
        at net.sf.farrago.query.FarragoPreparingStmt.compileAndBind(FarragoPreparingStmt.java:425)
        at org.eigenbase.oj.stmt.OJPreparingStmt.implement(OJPreparingStmt.java:304)
        at org.eigenbase.oj.stmt.OJPreparingStmt.prepareSql(OJPreparingStmt.java:256)
        at net.sf.farrago.query.FarragoPreparingStmt.prepare(FarragoPreparingStmt.java:238)
        at net.sf.farrago.db.FarragoDatabase$2.initializeEntry(FarragoDatabase.java:664)
        at net.sf.farrago.util.FarragoObjectCache.pin(FarragoObjectCache.java:157)
        at net.sf.farrago.db.FarragoDatabase.prepareStmtImpl(FarragoDatabase.java:674)
        at net.sf.farrago.db.FarragoDatabase.prepareStmt(FarragoDatabase.java:554)
        at net.sf.farrago.db.FarragoDbSession.prepareImpl(FarragoDbSession.java:810)
        at net.sf.farrago.db.FarragoDbSession.prepare(FarragoDbSession.java:761)
        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)

dynamobi-build commented 12 years ago

[author="jvs", created="Tue, 11 Nov 2008 12:10:43 -0500 (GMT-05:00)"] Fixed on //open/dev in eigenchange 11944. Problem was only with ON clause.