| 11669 | |
| 11670 | |
| 11671 | SELECT_LEX_UNIT *LEX::parsed_select_expr_cont(SELECT_LEX_UNIT *unit, |
| 11672 | SELECT_LEX *s2, |
| 11673 | enum sub_select_type unit_type, |
| 11674 | bool distinct, bool oracle) |
| 11675 | { |
| 11676 | DBUG_ASSERT(!s2->next_select()); |
| 11677 | SELECT_LEX *sel1= s2; |
| 11678 | SELECT_LEX *last= unit->pre_last_parse->next_select(); |
| 11679 | |
| 11680 | int cmp= oracle? 0 : cmp_unit_op(unit_type, last->get_linkage()); |
| 11681 | if (cmp == 0) |
| 11682 | { |
| 11683 | sel1->first_nested= last->first_nested; |
| 11684 | } |
| 11685 | else if (cmp > 0) |
| 11686 | { |
| 11687 | last->first_nested= unit->pre_last_parse; |
| 11688 | sel1->first_nested= last; |
| 11689 | } |
| 11690 | else /* cmp < 0 */ |
| 11691 | { |
| 11692 | SELECT_LEX *first_in_nest= last->first_nested; |
| 11693 | if (first_in_nest->first_nested != first_in_nest) |
| 11694 | { |
| 11695 | /* There is a priority jump starting from first_in_nest */ |
| 11696 | if ((last= create_priority_nest(first_in_nest, |
| 11697 | first_in_nest->first_nested)) == NULL) |
| 11698 | return NULL; |
| 11699 | unit->fix_distinct(); |
| 11700 | } |
| 11701 | sel1->first_nested= last->first_nested; |
| 11702 | } |
| 11703 | last->link_neighbour(sel1); |
| 11704 | sel1->set_master_unit(unit); |
| 11705 | unit->uncacheable|= sel1->uncacheable; |
| 11706 | sel1->set_linkage_and_distinct(unit_type, distinct); |
| 11707 | unit->pre_last_parse= last; |
| 11708 | return unit; |
| 11709 | } |
| 11710 | |
| 11711 | |
| 11712 | /** |
nothing calls this directly
no test coverage detected