git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jira] [Created] (CALCITE-2292) !!! Query result is wrong when table is implemented with FilterableTable and the sql has multiple where conditions


cnzhujie created CALCITE-2292:
---------------------------------

             Summary: !!! Query result is wrong when table is implemented with FilterableTable and the sql has multiple where conditions
                 Key: CALCITE-2292
                 URL: https://issues.apache.org/jira/browse/CALCITE-2292
             Project: Calcite
          Issue Type: Bug
          Components: core
    Affects Versions: 1.16.0
         Environment: version 1.16.0
            Reporter: cnzhujie
            Assignee: Julian Hyde
         Attachments: image-2018-05-01-23-20-57-853.png

you can reappearance this bug in test case `org.apache.calcite.test.CsvTest#testFilterableSelect`.

 

Try execute this sql:
{code:java}
sql("filterable-model", "select name from EMPS where name not like '%F%' and name like '%e%'").ok();
{code}
The code generate in method `org.apache.calcite.interpreter.JaninoRexCompiler#compile`

!image-2018-05-01-23-20-57-853.png!
{code:java}
{
final Object[] current = context.values;
final String inp1_ = current[1] == null ? (String) null : current[1].toString();
outputValues[0] = (inp1_ == null || org.apache.calcite.runtime.SqlFunctions.like(inp1_, "%e%")) && !(inp1_ != null && org.apache.calcite.runtime.SqlFunctions.like(inp1_, "%F%")) ? (inp1_ == null || inp1_ != null ? (Boolean) null : Boolean.TRUE) : Boolean.FALSE;
}

{code}
This bug can be reappearanced in 1.17.0-SNAPSHOT、1.16.0、1.13.0

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)



( ! ) Warning: include(msgfooter.php): failed to open stream: No such file or directory in /var/www/git/apache-calcite-development/msg03374.html on line 112
Call Stack
#TimeMemoryFunctionLocation
10.0006364792{main}( ).../msg03374.html:0

( ! ) Warning: include(): Failed opening 'msgfooter.php' for inclusion (include_path='.:/var/www/git') in /var/www/git/apache-calcite-development/msg03374.html on line 112
Call Stack
#TimeMemoryFunctionLocation
10.0006364792{main}( ).../msg03374.html:0