| 6749 | |
| 6750 | |
| 6751 | SELECT_LEX *LEX::create_priority_nest(SELECT_LEX *first_in_nest, SELECT_LEX *attach_to) |
| 6752 | { |
| 6753 | DBUG_ENTER("LEX::create_priority_nest"); |
| 6754 | DBUG_ASSERT(first_in_nest->first_nested); |
| 6755 | enum sub_select_type wr_unit_type= first_in_nest->get_linkage(); |
| 6756 | bool wr_distinct= first_in_nest->distinct; |
| 6757 | if (attach_to) |
| 6758 | attach_to->cut_next(); |
| 6759 | SELECT_LEX *wrapper= wrap_select_chain_into_derived(first_in_nest); |
| 6760 | if (wrapper) |
| 6761 | { |
| 6762 | first_in_nest->first_nested= NULL; |
| 6763 | wrapper->set_linkage_and_distinct(wr_unit_type, wr_distinct); |
| 6764 | if (attach_to) |
| 6765 | { |
| 6766 | wrapper->first_nested= attach_to->first_nested; |
| 6767 | wrapper->set_master_unit(attach_to->master_unit()); |
| 6768 | attach_to->link_neighbour(wrapper); |
| 6769 | } |
| 6770 | else |
| 6771 | { |
| 6772 | wrapper->first_nested= wrapper; |
| 6773 | } |
| 6774 | } |
| 6775 | DBUG_RETURN(wrapper); |
| 6776 | } |
| 6777 | |
| 6778 | |
| 6779 | /** |
nothing calls this directly
no test coverage detected