MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / ~sp_head

Method ~sp_head

sql/sp_head.cc:258–291  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256
257
258sp_head::~sp_head()
259{
260 LEX *lex;
261 sp_instr *i;
262
263 // Parsing of SP-body must have been already finished.
264 DBUG_ASSERT(!m_parser_data.is_parsing_sp_body());
265
266 for (uint ip = 0 ; (i = get_instr(ip)) ; ip++)
267 delete i;
268
269 delete m_root_parsing_ctx;
270
271 free_items();
272
273 /*
274 If we have non-empty LEX stack then we just came out of parser with
275 error. Now we should delete all auxiliary LEXes and restore original
276 THD::lex. It is safe to not update LEX::ptr because further query
277 string parsing and execution will be stopped anyway.
278 */
279 while ((lex= (LEX *) m_parser_data.pop_lex()))
280 {
281 THD *thd= lex->thd;
282 thd->lex->sphead= NULL;
283 lex_end(thd->lex);
284 delete thd->lex;
285 thd->lex= lex;
286 }
287
288 my_hash_free(&m_sptabs);
289
290 delete m_next_cached_sp;
291}
292
293bool sp_head::reset_lex(THD *thd)
294{

Callers

nothing calls this directly

Calls 5

free_itemsFunction · 0.85
lex_endFunction · 0.85
my_hash_freeFunction · 0.85
is_parsing_sp_bodyMethod · 0.80
pop_lexMethod · 0.80

Tested by

no test coverage detected