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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 10.10.2.0, 10.11.1.1
    • 10.10.2.1, 10.11.1.1
    • SQL
    • None
    • Repro attached
    • 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-2a.diff
          2 kB
          Knut Anders Hatlen
        2. d6577-1a.diff
          5 kB
          Knut Anders Hatlen

        Issue Links

          Activity

            People

              knutanders Knut Anders Hatlen
              knutanders Knut Anders Hatlen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: