diff options
author | kroki@mysql.com <> | 2006-04-19 14:27:59 +0400 |
---|---|---|
committer | kroki@mysql.com <> | 2006-04-19 14:27:59 +0400 |
commit | c51fb60b0b8edca03adacc5ff54a838b2e72d7e3 (patch) | |
tree | 744a90fcf305f1a15c9a0b8fb392d1c224684fbc /sql/sp_head.cc | |
parent | b5863b39879632559b563562b8b58f4516ac0697 (diff) | |
download | mariadb-git-c51fb60b0b8edca03adacc5ff54a838b2e72d7e3.tar.gz |
Bug#6951: Triggers/Traditional: SET @ result wrong
While executing a trigger, we have to set thd->abort_on_warning to the value
it had at trigger creation time.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r-- | sql/sp_head.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc index 15d621b1d6d..c5f5d8a787e 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -935,6 +935,7 @@ sp_head::execute(THD *thd) bool err_status= FALSE; uint ip= 0; ulong save_sql_mode; + bool save_abort_on_warning; Query_arena *old_arena; /* per-instruction arena */ MEM_ROOT execute_mem_root; @@ -995,6 +996,10 @@ sp_head::execute(THD *thd) thd->derived_tables= 0; save_sql_mode= thd->variables.sql_mode; thd->variables.sql_mode= m_sql_mode; + save_abort_on_warning= thd->abort_on_warning; + thd->abort_on_warning= + (m_sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)); + /* It is also more efficient to save/restore current thd->lex once when do it in each instruction @@ -1127,6 +1132,7 @@ sp_head::execute(THD *thd) DBUG_ASSERT(!thd->derived_tables); thd->derived_tables= old_derived_tables; thd->variables.sql_mode= save_sql_mode; + thd->abort_on_warning= save_abort_on_warning; thd->stmt_arena= old_arena; state= EXECUTED; |