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

Wrong results with queries that use the JOIN ... ON syntax to join with views or other non-base table expressions.



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • SQL
    • None
    • Release Note Needed


      I think both select statements in the attached repro script should return 1 row, but in fact the first statement returns 1 row and the second returns zero rows.

      The only difference between the two statements is that the columns in the UNION view are listed in a different order (bvw vs. bvw2).

      This seems like a bug to me; the order of the columns in the view definition shouldn't matter, should it?

      As Army noted on the derby-dev list, the fact that this reproduces with 10.0 means that it is not caused by some of the 10.2 optimizer changes. Something else is going wrong.


        1. badQuery.log
          5 kB
          Bryan Pendleton
        2. d2526_v1.html
          19 kB
          A B
        3. d2526_v1.patch
          2 kB
          A B
        4. d2526_v2.patch
          9 kB
          A B
        5. d2526_v2.stat
          0.2 kB
          A B
        6. derby-2526.sql
          0.9 kB
          Bryan Pendleton
        7. DistinctTestNotes.txt
          3 kB
          Bryan Pendleton
        8. firstTryPatch.diff
          1 kB
          Bryan Pendleton
        9. goodQuery.log
          7 kB
          Bryan Pendleton
        10. releaseNote.html
          4 kB
          Myrna van Lunteren
        11. releaseNote.html
          4 kB
          A B
        12. TestDerby.java
          12 kB
          Katherine Marsden

        Issue Links



              army A B
              bryanpendleton Bryan Pendleton
              0 Vote for this issue
              0 Start watching this issue