summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-01-19 19:36:14 +0300
committerAlexander Nozdrin <alik@sun.com>2010-01-19 19:36:14 +0300
commita6667f8577b0830f27dfbafb48561c23aee08ebd (patch)
tree688c26274e23ab44604f2f276f6a5c78e49241bf /sql/sp_head.cc
parent40271e4f5edacc6fe90ed74a087e5ff25daea899 (diff)
parent0835775b7c3b074332800ee92112d68b28cec083 (diff)
downloadmariadb-git-a6667f8577b0830f27dfbafb48561c23aee08ebd.tar.gz
Manual merge from mysql-trunk-merge.
Conflicts: - configure.in - include/m_string.h - mysql-test/extra/rpl_tests/rpl_row_func003.test - mysql-test/r/mysqlbinlog.result - mysql-test/r/union.result - mysql-test/suite/binlog/r/binlog_killed_simulate.result - mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/r/rpl_loaddata_fatal.result - mysql-test/suite/rpl/r/rpl_loaddata_map.result - mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result - mysql-test/suite/rpl/r/rpl_stm_log.result - mysql-test/suite/rpl/t/rpl_optimize.test - mysql-test/t/mysqlbinlog.test - mysql-test/t/union.test - sql/rpl_utility.h - sql/sql_union.cc - strings/Makefile.am
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 9996a237cb4..8d06003e2e4 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -2799,8 +2799,15 @@ sp_lex_keeper::reset_lex_and_exec_core(THD *thd, uint *nextp,
m_lex->mark_as_requiring_prelocking(NULL);
}
thd->rollback_item_tree_changes();
- /* Update the state of the active arena. */
- thd->stmt_arena->state= Query_arena::EXECUTED;
+ /*
+ Update the state of the active arena if no errors on
+ open_tables stage.
+ */
+ if (!res || !thd->is_error() ||
+ (thd->stmt_da->sql_errno() != ER_CANT_REOPEN_TABLE &&
+ thd->stmt_da->sql_errno() != ER_NO_SUCH_TABLE &&
+ thd->stmt_da->sql_errno() != ER_UPDATE_TABLE_USED))
+ thd->stmt_arena->state= Query_arena::EXECUTED;
/*
Merge here with the saved parent's values