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

Method add_node

sql/sql_explain.cc:106–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104
105
106void Explain_query::add_node(Explain_node *node)
107{
108 uint select_id;
109 operations++;
110 if (node->get_type() == Explain_node::EXPLAIN_UNION)
111 {
112 Explain_union *u= (Explain_union*)node;
113 select_id= u->get_select_id();
114 if (unions.elements() <= select_id)
115 unions.resize(MY_MAX(select_id+1, unions.elements()*2), NULL);
116
117 Explain_union *old_node;
118 if ((old_node= get_union(select_id)))
119 delete old_node;
120
121 unions.at(select_id)= u;
122 }
123 else
124 {
125 Explain_select *sel= (Explain_select*)node;
126 if (sel->select_id == FAKE_SELECT_LEX_ID)
127 {
128 DBUG_ASSERT(0); // this is a "fake select" from a UNION.
129 }
130 else
131 {
132 select_id= sel->select_id;
133 Explain_select *old_node;
134
135 if (selects.elements() <= select_id)
136 selects.resize(MY_MAX(select_id+1, selects.elements()*2), NULL);
137
138 if ((old_node= get_select(select_id)))
139 delete old_node;
140
141 selects.at(select_id)= sel;
142 }
143 }
144}
145
146
147void Explain_query::add_insert_plan(Explain_insert *insert_plan_arg)

Callers 3

save_union_explainMethod · 0.80

Calls 5

get_typeMethod · 0.45
get_select_idMethod · 0.45
elementsMethod · 0.45
resizeMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected