summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorAlexey Botchkov <holyfoot@askmonty.org>2015-11-17 00:42:18 +0400
committerAlexey Botchkov <holyfoot@askmonty.org>2015-11-17 22:09:42 +0400
commit836275bb203a47104eb7f28aa409924b91abc801 (patch)
treeb7ce5ad7a0159c300290af5d3590861c76a9fe3d /sql
parent905613f825f28f561072d6babd307a010de7cf86 (diff)
downloadmariadb-git-836275bb203a47104eb7f28aa409924b91abc801.tar.gz
MDEV-4829 BEFORE INSERT triggers dont issue 1406 error.
Turn the 'abort_on_warning' on for assigning value to fields.
Diffstat (limited to 'sql')
-rw-r--r--sql/sp_head.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index a11796391d7..01e649bb746 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -3229,7 +3229,10 @@ sp_instr_set_trigger_field::execute(THD *thd, uint *nextp)
int
sp_instr_set_trigger_field::exec_core(THD *thd, uint *nextp)
{
+ bool sav_abort_on_warning= thd->abort_on_warning;
+ thd->abort_on_warning= thd->is_strict_mode() && !thd->lex->ignore;
const int res= (trigger_field->set_value(thd, &value) ? -1 : 0);
+ thd->abort_on_warning= sav_abort_on_warning;
*nextp = m_ip+1;
return res;
}