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.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.0.2.1, 10.1.3.1, 10.2.2.0, 10.3.1.4
    • Fix Version/s: 10.1.3.2, 10.2.2.1, 10.3.1.4
    • Component/s: SQL
    • Labels:
      None
    • Issue & fix info:
      Release Note Needed

      Description

      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.

        Attachments

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

          Issue Links

            Activity

              People

              • Assignee:
                army A B
                Reporter:
                bryanpendleton Bryan Pendleton
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: