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

Method create_unit

sql/sql_lex.cc:6542–6563  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6540}
6541
6542SELECT_LEX_UNIT *
6543LEX::create_unit(SELECT_LEX *first_sel)
6544{
6545 SELECT_LEX_UNIT *unit;
6546 DBUG_ENTER("LEX::create_unit");
6547
6548 unit = first_sel->master_unit();
6549
6550 if (!unit && !(unit= alloc_unit()))
6551 DBUG_RETURN(NULL);
6552
6553 unit->register_select_chain(first_sel);
6554 /* TODO: Why this condition? Explain in comment */
6555 if (first_sel->next_select())
6556 {
6557 unit->reset_distinct();
6558 DBUG_ASSERT(!unit->fake_select_lex);
6559 if (unit->add_fake_select_lex(thd))
6560 DBUG_RETURN(NULL);
6561 }
6562 DBUG_RETURN(unit);
6563}
6564
6565SELECT_LEX_UNIT *
6566SELECT_LEX::attach_selects_chain(SELECT_LEX *first_sel,

Callers 1

Calls 5

master_unitMethod · 0.80
register_select_chainMethod · 0.80
next_selectMethod · 0.80
reset_distinctMethod · 0.80
add_fake_select_lexMethod · 0.80

Tested by

no test coverage detected