Commit 804c69ab authored by unknown's avatar unknown

Fix set_limit to be uniform with all calls.

Fix of set_limit in case of an error (actually impossible case but better it will be right)
parent 6e9b06d9
...@@ -750,7 +750,7 @@ bool mysql_derived_optimize(THD *thd, LEX *lex, TABLE_LIST *derived) ...@@ -750,7 +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->set_limit(unit->global_parameters);
unit->optimized= TRUE; unit->optimized= TRUE;
if ((res= join->optimize())) if ((res= join->optimize()))
goto err; goto err;
...@@ -865,7 +865,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived) ...@@ -865,7 +865,7 @@ bool mysql_derived_fill(THD *thd, LEX *lex, TABLE_LIST *derived)
} }
else else
{ {
unit->set_limit(first_select); unit->set_limit(unit->global_parameters);
if (unit->select_limit_cnt == HA_POS_ERROR) if (unit->select_limit_cnt == HA_POS_ERROR)
first_select->options&= ~OPTION_FOUND_ROWS; first_select->options&= ~OPTION_FOUND_ROWS;
......
...@@ -2847,7 +2847,7 @@ void st_select_lex_unit::set_limit(st_select_lex *sl) ...@@ -2847,7 +2847,7 @@ void st_select_lex_unit::set_limit(st_select_lex *sl)
DBUG_ASSERT(fix_fields_successful); DBUG_ASSERT(fix_fields_successful);
} }
val= fix_fields_successful ? item->val_uint() : HA_POS_ERROR; val= fix_fields_successful ? item->val_uint() : 0;
} }
else else
val= ULL(0); val= ULL(0);
......
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