=== modified file 'sql/item_subselect.cc' --- sql/item_subselect.cc 2013-02-26 12:08:54 +0000 +++ sql/item_subselect.cc 2013-05-03 14:46:59 +0000 @@ -1491,8 +1491,10 @@ for (SELECT_LEX* lex= select_lex->master_unit()->first_select(); lex != NULL && lex->master_unit() == select_lex->master_unit(); lex= lex->next_select()) - if (lex->item_list.head()->maybe_null) + if (lex->item_list.head()->maybe_null) { subquery_maybe_null= true; + break; + } /* If this is an ALL/ANY single-value subquery predicate, try to rewrite