| 6540 | } |
| 6541 | |
| 6542 | SELECT_LEX_UNIT * |
| 6543 | LEX::create_unit(SELECT_LEX *first_sel) |
| 6544 | { |
| 6545 | SELECT_LEX_UNIT *unit; |
| 6546 | DBUG_ENTER("LEX::create_unit"); |
| 6547 | |
| 6548 | unit = first_sel->master_unit(); |
| 6549 | |
| 6550 | if (!unit && !(unit= alloc_unit())) |
| 6551 | DBUG_RETURN(NULL); |
| 6552 | |
| 6553 | unit->register_select_chain(first_sel); |
| 6554 | /* TODO: Why this condition? Explain in comment */ |
| 6555 | if (first_sel->next_select()) |
| 6556 | { |
| 6557 | unit->reset_distinct(); |
| 6558 | DBUG_ASSERT(!unit->fake_select_lex); |
| 6559 | if (unit->add_fake_select_lex(thd)) |
| 6560 | DBUG_RETURN(NULL); |
| 6561 | } |
| 6562 | DBUG_RETURN(unit); |
| 6563 | } |
| 6564 | |
| 6565 | SELECT_LEX_UNIT * |
| 6566 | SELECT_LEX::attach_selects_chain(SELECT_LEX *first_sel, |
no test coverage detected