| 66 | |
| 67 | |
| 68 | TABLE *select_handler::create_tmp_table(THD *thd) |
| 69 | { |
| 70 | List<Item> types; |
| 71 | TMP_TABLE_PARAM tmp_table_param; |
| 72 | DBUG_ENTER("select_handler::create_tmp_table"); |
| 73 | |
| 74 | SELECT_LEX_UNIT *unit= nullptr; |
| 75 | uint unit_parts_count= 0; |
| 76 | |
| 77 | if (lex_unit) |
| 78 | { |
| 79 | unit= lex_unit; |
| 80 | SELECT_LEX *sl= unit->first_select(); |
| 81 | while (sl) |
| 82 | { |
| 83 | unit_parts_count++; |
| 84 | sl= sl->next_select(); |
| 85 | } |
| 86 | } |
| 87 | else |
| 88 | { |
| 89 | unit= select_lex->master_unit(); |
| 90 | unit_parts_count= 1; |
| 91 | } |
| 92 | |
| 93 | if (unit->join_union_item_types(thd, types, unit_parts_count)) |
| 94 | DBUG_RETURN(NULL); |
| 95 | |
| 96 | tmp_table_param.init(); |
| 97 | tmp_table_param.field_count= tmp_table_param.func_count= types.elements; |
| 98 | TABLE *table= ::create_tmp_table(thd, &tmp_table_param, types, |
| 99 | (ORDER *) 0, false, 0, |
| 100 | TMP_TABLE_ALL_COLUMNS, 1, |
| 101 | &empty_clex_str, true, false); |
| 102 | DBUG_RETURN(table); |
| 103 | } |
| 104 | |
| 105 | |
| 106 | bool select_handler::prepare() |
nothing calls this directly
no test coverage detected