Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14779

using left join causes incorrect results with materialization and derived tables

Details

    • 5.5.59, 10.0.34

    Description

      SELECT t.SID, t.NAME,t.ID_NO,t.MOBILE,r.credit_status,t.amount,r.cust_active_amount,t.END_TIME,t.FILE_NAME
      FROM (select sid,name,id_no,recommend_id_no,mobile,amount,end_time,FILE_NAME from tc_white_list
      WHERE  recommend_id_no='ybr' ) t
        LEFT   JOIN (SELECT credit_status,id_no,cust_active_amount
                   from datacqsn.tc_credit_request WHERE sid in(SELECT max(sid)
                                                                from datacqsn.tc_credit_request where credit_status>'0' GROUP BY id_no)) r
          on t.ID_NO=r.id_no
      

      table t have two rows ,r have 0 rows ,result have no rows

      Attachments

        Issue Links

          Activity

            Transition Time In Source Status Execution Times
            Alice Sherepa made transition -
            Open Confirmed
            2d 6h 51m 1
            Sergei Golubchik made transition -
            Confirmed In Progress
            18d 3h 41m 1
            Varun Gupta (Inactive) made transition -
            In Progress In Review
            1d 4h 32m 1
            Sergei Petrunia made transition -
            In Review Stalled
            61d 17h 14m 1
            Varun Gupta (Inactive) made transition -
            Stalled Closed
            1d 16h 15m 1

            People

              varun Varun Gupta (Inactive)
              altercyx bela sand
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.