• unknown's avatar
    Fix LP BUG#680038 · 2fa5df5f
    unknown authored
    Analysis:
    Single-row subqueries are not considered expensive and are
    evaluated both during EXPLAIN in to detect errors like
    "Subquery returns more than 1 row", and during optimization to
    perform constant optimization.
    
    The cause for the failed ASSERT is in JOIN::join_free, where we set
      bool full= (!select_lex->uncacheable && !thd->lex->describe);
    Thus for EXPLAIN statements full == FALSE, and as a result the call to
    JOIN::cleanup doesn't call JOIN_TAB::cleanup which should have
    called table->disable_keyread().
    
    Solution:
    Consider all kinds of subquery predicates as expensive.
    2fa5df5f
subselect4.result 19.2 KB