diff options
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 11fa6ab20fa..b263fb22c0e 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -286,6 +286,7 @@ sp_head::execute(THD *thd) if (ctx) ctx->clear_handler(); + thd->query_error= 0; do { sp_instr *i; @@ -318,10 +319,11 @@ sp_head::execute(THD *thd) continue; } } - } while (ret == 0 && !thd->killed); + } while (ret == 0 && !thd->killed && !thd->query_error); - DBUG_PRINT("info", ("ret=%d killed=%d", ret, thd->killed)); - if (thd->killed) + DBUG_PRINT("info", ("ret=%d killed=%d query_error=%d", + ret, thd->killed, thd->query_error)); + if (thd->killed || thd->query_error) ret= -1; /* If the DB has changed, the pointer has changed too, but the original thd->db will then have been freed */ @@ -1032,7 +1034,7 @@ sp_instr_copen::execute(THD *thd, uint *nextp) res= -1; else res= exec_stmt(thd, lex); - c->post_open(thd, (res == 0 ? TRUE : FALSE)); + c->post_open(thd, (lex ? TRUE : FALSE)); } *nextp= m_ip+1; |