Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
In contexts where boolean values can be null, we need to convert them to java.lang.Boolean. Query
select case when deptno = 10 then null else true end from (values (10), (20)) as t(deptno)
gives
Caused by: org.codehaus.commons.compiler.CompileException: Line 25, Column 104: Incompatible expression types "java.lang.Boolean" and "boolean" at org.codehaus.janino.UnitCompiler.compileError(UnitCompiler.java:10064) at org.codehaus.janino.UnitCompiler.compileGet2(UnitCompiler.java:3643) at org.codehaus.janino.UnitCompiler.access$6600(UnitCompiler.java:181) at org.codehaus.janino.UnitCompiler$10.visitConditionalExpression(UnitCompiler.java:3268)
from compiling the generated code
public Object current() { return net.hydromatic.optiq.runtime.SqlFunctions.toInt(inputEnumerator.current()) == 10 ? (Boolean) null : true; }