• unknown's avatar
    Fix bug lp:858148. · 2bed41d4
    unknown authored
    Analysis:
    The crash is a result of the same cause as all similar
    bugs (lp:827416, lp:718763, lp:778413, lp:806943,
    lp:611690). The general pattern is that some optimization
    requires the evaluation of some condition (e.g. the WHERE
    clause), and this condition contains a subquery, such that
    the subquery itself requires a temporary table for its
    execution. During the subquery execution the original
    tables in the FROM clause are replaced by the temporary
    table needed for the final GROUP or ORDER operation. All
    this happens during optimization of the outer query. Later
    when EXPLAIN is run for the subquery, explain attempts to
    print the name of the tables in the FROM clause, but it
    finds there a temporary table without a corresponding
    TABLE_LIST object. The attempt to print the name of a
    NULL table list results in a crash.
    
    Solution:
    This patch extends the fix to bug lp:702301, and dissalows
    constant substitution of aggregate functions if the filter
    condition used to check MIN/MAX keys is an expensive condition.
    2bed41d4
subselect_innodb.test 9.02 KB