| 6516 | |
| 6517 | |
| 6518 | SELECT_LEX *LEX::alloc_select(bool select) |
| 6519 | { |
| 6520 | SELECT_LEX *select_lex; |
| 6521 | DBUG_ENTER("LEX::alloc_select"); |
| 6522 | if (!(select_lex= new (thd->mem_root) SELECT_LEX())) |
| 6523 | DBUG_RETURN(NULL); |
| 6524 | DBUG_PRINT("info", ("Allocate select: %p #%u statement lex: %p", |
| 6525 | select_lex, thd->lex->stmt_lex->current_select_number, |
| 6526 | thd->lex->stmt_lex)); |
| 6527 | /* |
| 6528 | TODO: move following init to constructor when we get rid of builtin |
| 6529 | select |
| 6530 | */ |
| 6531 | select_lex->select_number= ++thd->lex->stmt_lex->current_select_number; |
| 6532 | select_lex->parent_lex= this; /* Used in init_query. */ |
| 6533 | select_lex->init_query(); |
| 6534 | if (select) |
| 6535 | select_lex->init_select(); |
| 6536 | select_lex->nest_level_base= &this->unit; |
| 6537 | select_lex->include_global((st_select_lex_node**)&all_selects_list); |
| 6538 | select_lex->context.resolve_in_select_list= TRUE; |
| 6539 | DBUG_RETURN(select_lex); |
| 6540 | } |
| 6541 | |
| 6542 | SELECT_LEX_UNIT * |
| 6543 | LEX::create_unit(SELECT_LEX *first_sel) |
nothing calls this directly
no test coverage detected