Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-4237

INNER JOIN returns incorrect results

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 8.12
    • Fix Version/s: 9.0, 8.7.6, 8.12.5, 8.7.7.6_2, 8.13.5
    • Component/s: Query Engine
    • Labels:
      None
    • Environment:

      teiid-8.12-Beta1 on Red Hat JBoss Enterprise Application Platform - Version 6.3.0.GA

    • Steps to Reproduce:
      Hide

      Run the following query on teiid and mysql:

      select avg(t1.a) from 
          (select 3 as a, 3 as b union all
          select 1 as a, 1 as b union all
          select 3 as a, 3 as b) as t1 
      join (select 1 as a, 1 as b union all
          select 1 as a, 1 as b union all
          select 2 as a, 2 as b union all
          select 2 as a, 2 as b union all
          select 3 as a, 3 as b union all
          select 3 as a, 3 as b) as t2 on t1.a=t2.a
      

      and compare gotten results.

      Show
      Run the following query on teiid and mysql: select avg (t1.a) from ( select 3 as a, 3 as b union all select 1 as a, 1 as b union all select 3 as a, 3 as b) as t1 join ( select 1 as a, 1 as b union all select 1 as a, 1 as b union all select 2 as a, 2 as b union all select 2 as a, 2 as b union all select 3 as a, 3 as b union all select 3 as a, 3 as b) as t2 on t1.a=t2.a and compare gotten results.
    • Bugzilla Update:
      Perform

      Description

      Running the following query:

      select avg(t1.a) from 
      	(select 3 as a, 3 as b union all
      	select 1 as a, 1 as b union all
      	select 3 as a, 3 as b) as t1 
      join (select 1 as a, 1 as b union all
      	select 1 as a, 1 as b union all
      	select 2 as a, 2 as b union all
      	select 2 as a, 2 as b union all
      	select 3 as a, 3 as b union all
      	select 3 as a, 3 as b) as t2 on t1.a=t2.a
      

      on teiid causes incorrect result: 2 in comparing with mysql which returns 2.333.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                shawkins Steven Hawkins
                Reporter:
                dalex005 dalex dalex
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: