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

Method mark_broken

sql/sql_lex.h:2428–2444  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

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; }

Callers 1

lex_startFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected