| 256 | |
| 257 | |
| 258 | sp_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 | |
| 293 | bool sp_head::reset_lex(THD *thd) |
| 294 | { |
nothing calls this directly
no test coverage detected