| 1395 | */ |
| 1396 | |
| 1397 | static |
| 1398 | bool mysql_derived_reinit(THD *thd, LEX *lex, TABLE_LIST *derived) |
| 1399 | { |
| 1400 | DBUG_ENTER("mysql_derived_reinit"); |
| 1401 | DBUG_PRINT("enter", ("Alias: '%s' Unit: %p", |
| 1402 | (derived->alias.str ? derived->alias.str : "<NULL>"), |
| 1403 | derived->get_unit())); |
| 1404 | st_select_lex_unit *unit= derived->get_unit(); |
| 1405 | |
| 1406 | if (derived->original_names_source) |
| 1407 | unit->first_select()->set_item_list_names(derived->original_names); |
| 1408 | |
| 1409 | // reset item names to that saved after wildcard expansion in JOIN::prepare |
| 1410 | for(st_select_lex *sl= unit->first_select(); sl; sl= sl->next_select()) |
| 1411 | sl->restore_item_list_names(); |
| 1412 | |
| 1413 | derived->merged_for_insert= FALSE; |
| 1414 | unit->unclean(); |
| 1415 | unit->types.empty(); |
| 1416 | /* for derived tables & PS (which can't be reset by Item_subselect) */ |
| 1417 | unit->reinit_exec_mechanism(); |
| 1418 | unit->set_thd(thd); |
| 1419 | DBUG_RETURN(FALSE); |
| 1420 | } |
| 1421 | |
| 1422 | |
| 1423 | /* |
nothing calls this directly
no test coverage detected