• Sergei Petrunia's avatar
    MDEV-26337: subquery with groupby and ROLLUP returns incorrect results on LEFT... · c04adce8
    Sergei Petrunia authored
    MDEV-26337: subquery with groupby and ROLLUP returns incorrect results on LEFT JOIN on INDEXED values
    
    Disable LATERAL DERIVED optimization for subqueries that have WITH ROLLUP.
    
    This bug could affect queries with grouping derived tables / views / CTEs
    with ROLLUP. The bug could manifest itself if the corresponding
    materialized derived tables are subject to split optimization.
    
    The current implementation of the split optimization produces rows
    from the derived table in an arbitrary order. So these rows must be
    accumulated in another temporary table and sorted according to the
    used GROUP BY clause in order to be able to generate the additional
    ROLLUP rows.
    
    This patch prohibits to use split optimization for grouping derived
    tables / views / CTEs with ROLLUP.
    c04adce8
derived_split_innodb.test 5.91 KB