~maria-captains/maria/5.3

Viewing all changes in revision 3535.

  • Committer: timour at askmonty
  • Date: 2012-05-30 16:10:18 UTC
  • Revision ID: timour@askmonty.org-20120530161018-kgsiqesmnohtnbc6
Fix for bug lp:1006231

Analysis:

When a subquery that needs a temp table is executed during
the prepare or optimize phase of the outer query, at the end
of the subquery execution all the JOIN_TABs of the subquery
are replaced by a new JOIN_TAB that selects from the temp table.
However that temp table has no corresponding TABLE_LIST.
Once EXPLAIN execution reaches its last phase, it tries to print
the names of the subquery tables through its TABLE_LISTs, but in
the case of this bug there is no such TABLE_LIST (it is NULL),
hence a crash.

Solution:
The fix is to block subquery evaluation inside
Item_func_like::fix_fields and Item_func_like::select_optimize()
using the Item::is_expensive() test.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: