Commit 5d00bf6d authored by unknown's avatar unknown

after review fix

parent 6d9ad5db
...@@ -982,7 +982,7 @@ JOIN::optimize() ...@@ -982,7 +982,7 @@ JOIN::optimize()
} }
} }
if (select_lex->master_unit()->dependent) if (select_lex->master_unit()->uncacheable)
{ {
if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN)))) if (!(tmp_join= (JOIN*)thd->alloc(sizeof(JOIN))))
DBUG_RETURN(-1); DBUG_RETURN(-1);
...@@ -1053,11 +1053,11 @@ JOIN::reinit() ...@@ -1053,11 +1053,11 @@ JOIN::reinit()
bool bool
JOIN::save_join_tab() JOIN::save_join_tab()
{ {
if (!join_tab_save && select_lex->master_unit()->dependent) if (!join_tab_save && select_lex->master_unit()->uncacheable)
{ {
if (!(join_tab_save= (JOIN_TAB*) thd->alloc(sizeof(JOIN_TAB) * tables))) if (!(join_tab_save= (JOIN_TAB*)thd->memdup((gptr) join_tab,
sizeof(JOIN_TAB) * tables)))
return 1; return 1;
memcpy(join_tab_save, join_tab, sizeof(JOIN_TAB) * tables);
} }
return 0; return 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