Certain permanent transformations (like in2exists), if they fail, may leave the LEX in an inconsistent state. They should call the following function, so that this LEX is not reused by another execution. @todo If lex_start () were a member function of LEX, the "broken" argument could always be "true" and thus could be removed. */
| 2426 | argument could always be "true" and thus could be removed. |
| 2427 | */ |
| 2428 | void mark_broken(bool broken= true) |
| 2429 | { |
| 2430 | if (broken) |
| 2431 | { |
| 2432 | /* |
| 2433 | "OPEN <cursor>" cannot be re-prepared if the cursor uses no tables |
| 2434 | ("SELECT FROM DUAL"). Indeed in that case cursor_query is left empty |
| 2435 | in constructions of sp_instr_cpush, and thus |
| 2436 | sp_lex_instr::parse_expr() cannot re-prepare. So we mark the statement |
| 2437 | as broken only if tables are used. |
| 2438 | */ |
| 2439 | if (is_metadata_used()) |
| 2440 | m_broken= true; |
| 2441 | } |
| 2442 | else |
| 2443 | m_broken= false; |
| 2444 | } |
| 2445 | |
| 2446 | sp_pcontext *get_sp_current_parsing_ctx() |
| 2447 | { return sp_current_parsing_ctx; } |