| 662 | */ |
| 663 | |
| 664 | TABLE_LIST *TABLE_LIST::new_nested_join(MEM_ROOT *allocator, |
| 665 | const char *alias, |
| 666 | TABLE_LIST *embedding, |
| 667 | List<TABLE_LIST> *belongs_to, |
| 668 | class st_select_lex *select) |
| 669 | { |
| 670 | DBUG_ASSERT(belongs_to && select); |
| 671 | |
| 672 | TABLE_LIST *const join_nest= |
| 673 | (TABLE_LIST *) alloc_root(allocator, ALIGN_SIZE(sizeof(TABLE_LIST))+ |
| 674 | sizeof(NESTED_JOIN)); |
| 675 | if (join_nest == NULL) |
| 676 | return NULL; |
| 677 | |
| 678 | memset(join_nest, 0, ALIGN_SIZE(sizeof(TABLE_LIST)) + sizeof(NESTED_JOIN)); |
| 679 | join_nest->nested_join= |
| 680 | (NESTED_JOIN *) ((uchar *)join_nest + ALIGN_SIZE(sizeof(TABLE_LIST))); |
| 681 | |
| 682 | join_nest->db= (char *)""; |
| 683 | join_nest->db_length= 0; |
| 684 | join_nest->table_name= (char *)""; |
| 685 | join_nest->table_name_length= 0; |
| 686 | join_nest->alias= (char *)alias; |
| 687 | |
| 688 | join_nest->embedding= embedding; |
| 689 | join_nest->join_list= belongs_to; |
| 690 | join_nest->select_lex= select; |
| 691 | |
| 692 | join_nest->nested_join->join_list.empty(); |
| 693 | |
| 694 | return join_nest; |
| 695 | } |
| 696 | |
| 697 | /* |
| 698 | setup fields of placeholder of merged VIEW |
nothing calls this directly
no test coverage detected