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

Simplification of IS NULL checks are incorrectly assuming that CAST-s are possible

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.18.0
    • Fix Version/s: 1.19.0
    • Component/s: None

      Description

      Example:

      with ax(s) as (values ('xxx'),(cast(null as character varying)))
      select cast(s as int) IS NULL from ax;
      

      returns a result set; which evaluates
      however 'xxx' is not a valid integer; so an error should be recieved instead

      Another class of almost the same issue:

      select cast('xxx' as int) IS NULL;
      

      is also problematic; in that case the not nullability is deduced from the fact that the literal's type is not nullable

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kgyrtkirk Zoltan Haindrich
                Reporter:
                kgyrtkirk Zoltan Haindrich
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h