Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-1531

SqlValidatorException when boolean operators are used with NULL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • None
    • 1.11.0
    • None
    • None

    Description

      SqlValidatorException when we use boolean AND, OR operators with null.

      0: jdbc:calcite:localhost> SELECT (CASE WHEN true or null then 1 else 0 end) from (VALUES(1));
      2016-12-06 17:12:47,622 [main] ERROR - org.apache.calcite.sql.validate.SqlValidatorException: Illegal use of 'NULL'
      2016-12-06 17:12:47,623 [main] ERROR - org.apache.calcite.runtime.CalciteContextException: From line 1, column 27 to line 1, column 30: Illegal use of 'NULL'
      Error: Error while executing SQL "SELECT (CASE WHEN true or null then 1 else 0 end) from (VALUES(1))": From line 1, column 27 to line 1, column 30: Illegal use of 'NULL' (state=,code=0)
      

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            sharnyk Serhii Harnyk
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: