MCPcopy Create free account
hub / github.com/MariaDB/server / parsed_derived_table

Method parsed_derived_table

sql/sql_lex.cc:11939–11973  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11937
11938
11939TABLE_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
11975bool LEX::parsed_create_view(SELECT_LEX_UNIT *unit, int check)
11976{

Callers

nothing calls this directly

Calls 4

set_linkageMethod · 0.80
first_selectMethod · 0.80
add_table_to_listMethod · 0.80
push_backMethod · 0.45

Tested by

no test coverage detected