1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Fixed bug mdev-11820.

The fields st_select_lex::cond_pushed_into_where and
st_select_lex::cond_pushed_into_having should be re-initialized
for the unit specifying a derived table at every re-execution
of the query that uses this derived table, because the result
of condition pushdown may be different for different executions.
This commit is contained in:
Igor Babaev
2017-01-24 13:11:26 -08:00
parent 35760c0000
commit 423b7da36f
3 changed files with 148 additions and 0 deletions

View File

@ -1099,6 +1099,11 @@ bool mysql_derived_reinit(THD *thd, LEX *lex, TABLE_LIST *derived)
unit->types.empty();
/* for derived tables & PS (which can't be reset by Item_subselect) */
unit->reinit_exec_mechanism();
for (st_select_lex *sl= unit->first_select(); sl; sl= sl->next_select())
{
sl->cond_pushed_into_where= NULL;
sl->cond_pushed_into_having= NULL;
}
unit->set_thd(thd);
DBUG_RETURN(FALSE);
}