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

Method create_tmp_table

sql/select_handler.cc:68–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67
68TABLE *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
106bool select_handler::prepare()

Callers

nothing calls this directly

Calls 6

create_tmp_tableFunction · 0.85
first_selectMethod · 0.80
next_selectMethod · 0.80
master_unitMethod · 0.80
join_union_item_typesMethod · 0.80
initMethod · 0.45

Tested by

no test coverage detected