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

Function create_virtual_tmp_table

sql/sql_select.h:2543–2568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2541*/
2542
2543inline Virtual_tmp_table *
2544create_virtual_tmp_table(THD *thd, List<Spvar_definition> &field_list)
2545{
2546 Virtual_tmp_table *table;
2547 if (!(table= new(thd) Virtual_tmp_table(thd)))
2548 return NULL;
2549
2550 /*
2551 If "simulate_create_virtual_tmp_table_out_of_memory" debug option
2552 is enabled, we now enable "simulate_out_of_memory". This effectively
2553 makes table->init() fail on OOM inside multi_alloc_root().
2554 This is done to test that ~Virtual_tmp_table() called from the "delete"
2555 below correctly handles OOM.
2556 */
2557 DBUG_EXECUTE_IF("simulate_create_virtual_tmp_table_out_of_memory",
2558 DBUG_SET("+d,simulate_out_of_memory"););
2559
2560 if (table->init(field_list.elements) ||
2561 table->add(field_list) ||
2562 table->open())
2563 {
2564 delete table;
2565 return NULL;
2566 }
2567 return table;
2568}
2569
2570
2571/**

Callers 6

create_fieldsMethod · 0.85
setupMethod · 0.85
row_create_fieldsMethod · 0.85
init_var_tableMethod · 0.85

Calls 3

initMethod · 0.45
addMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected