Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-6577

Quantified comparison returns wrong result in CASE, COALESCE, IN and BETWEEN

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.10.2.0, 10.11.1.1
    • Fix Version/s: 10.10.2.1, 10.11.1.1
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Repro attached
    • Bug behavior facts:
      Regression, Wrong query result

      Description

      I'm seeing this on head of trunk:

      ij> select c, c = all (values 'Y'), case when c = all (values 'Y') then true else false end from (values 'Y', 'N') v(c);
      C|2    |3    
      -------------
      Y|true |false
      N|false|true 
      
      2 rows selected
      

      Column 2 and column 3 should have the same value, but something seems to go wrong when the quantified comparison is used in a CASE expression.

      I'm seeing the expected result on 10.10.2.0, though:

      ij> select c, c = all (values 'Y'), case when c = all (values 'Y') then true else false end from (values 'Y', 'N') v(c);
      C|2    |3    
      -------------
      Y|true |true 
      N|false|false
      
      2 rows selected
      

        Attachments

        1. d6577-1a.diff
          5 kB
          Knut Anders Hatlen
        2. d6577-2a.diff
          2 kB
          Knut Anders Hatlen

          Issue Links

            Activity

              People

              • Assignee:
                knutanders Knut Anders Hatlen
                Reporter:
                knutanders Knut Anders Hatlen
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: