Commit 4fa282db authored by Igor Babaev's avatar Igor Babaev

Fixed the failure of sp.test reported in the issue MDEV-86.

parent 8b278b44
...@@ -750,6 +750,7 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived) ...@@ -750,6 +750,7 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived)
if (!derived->is_merged_derived()) if (!derived->is_merged_derived())
{ {
JOIN *join= first_select->join; JOIN *join= first_select->join;
unit->set_limit(first_select);
unit->optimized= TRUE; unit->optimized= TRUE;
if ((res= join->optimize())) if ((res= join->optimize()))
goto err; goto err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment