• Igor Babaev's avatar
    MDEV-25128 Wrong result from join with materialized semi-join and · 480a0671
    Igor Babaev authored
               splittable derived
    
    If one of joined tables of the processed query is a materialized derived
    table (or view or CTE) with GROUP BY clause then under some conditions it
    can be subject to split optimization. With this optimization new equalities
    are injected into the WHERE condition of the SELECT that specifies this
    derived table. The injected equalities are generated for all join orders
    with which the split optimization can employed. After the best join order
    has been chosen only certain of this equalities are really needed. The
    others can be safely removed. If it's not done and some of injected
    equalities involve expressions over semi-joins with look-up access then
    the query may return a wrong result set.
    This patch effectively removes equalities injected for split optimization
    that are needed only at the optimization stage and not needed for execution.
    
    Approved by serg@mariadb.com
    480a0671
derived_cond_pushdown.result 526 KB