| 11937 | |
| 11938 | |
| 11939 | TABLE_LIST *LEX::parsed_derived_table(SELECT_LEX_UNIT *unit, |
| 11940 | int for_system_time, |
| 11941 | LEX_CSTRING *alias, |
| 11942 | List<Lex_ident_sys> *column_names) |
| 11943 | { |
| 11944 | TABLE_LIST *res; |
| 11945 | derived_tables|= DERIVED_SUBQUERY; |
| 11946 | unit->first_select()->set_linkage(DERIVED_TABLE_TYPE); |
| 11947 | |
| 11948 | // Add the subtree of subquery to the current SELECT_LEX |
| 11949 | SELECT_LEX *curr_sel= select_stack_head(); |
| 11950 | DBUG_ASSERT(current_select == curr_sel || |
| 11951 | (curr_sel == NULL && current_select == &builtin_select)); |
| 11952 | |
| 11953 | Table_ident *ti= new (thd->mem_root) Table_ident(unit); |
| 11954 | if (ti == NULL) |
| 11955 | return NULL; |
| 11956 | if (!(res= curr_sel->add_table_to_list(thd, ti, alias, 0, |
| 11957 | TL_READ, MDL_SHARED_READ))) |
| 11958 | return NULL; |
| 11959 | if (for_system_time) |
| 11960 | { |
| 11961 | res->vers_conditions= vers_conditions; |
| 11962 | } |
| 11963 | |
| 11964 | if (column_names && column_names->elements > 0) |
| 11965 | { |
| 11966 | res->column_names= column_names; |
| 11967 | // pre-allocate space to save item_list names |
| 11968 | res->original_names= new (thd->mem_root) List<Lex_ident_sys>; |
| 11969 | for (uint i= 0; i < column_names->elements; i++) |
| 11970 | res->original_names->push_back( new Lex_ident_sys ); |
| 11971 | } |
| 11972 | return res; |
| 11973 | } |
| 11974 | |
| 11975 | bool LEX::parsed_create_view(SELECT_LEX_UNIT *unit, int check) |
| 11976 | { |
nothing calls this directly
no test coverage detected