summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorTatiana A. Nurnberg <azundris@mysql.com>2010-03-29 03:32:30 +0100
committerTatiana A. Nurnberg <azundris@mysql.com>2010-03-29 03:32:30 +0100
commit28e95ba535e175dc696fe7a739736ae9bf2a2b36 (patch)
tree6d2d62ce4463efb41a7a237232d44360c9cce500 /sql/sql_class.cc
parent454c003a5c5a31a8d59ba4ab54d3b3a90a609752 (diff)
downloadmariadb-git-28e95ba535e175dc696fe7a739736ae9bf2a2b36.tar.gz
Bug#48525: trigger changes "Column 'id' cannot be null" behaviour
CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL; UPDATE...SET...NULL on NOT NULL fields behaved differently after a trigger. Now distinguishes between IGNORE and ERROR_FOR_NULL and save/restores check-field options. mysql-test/r/trigger.result: Show that UPDATE...SET...NULL on NOT NULL columns doesn't behave differently when run after a trigger. mysql-test/t/trigger.test: Show that UPDATE...SET...NULL on NOT NULL columns doesn't behave differently when run after a trigger. sql/field_conv.cc: CHECK_FIELD_IGNORE was treated as CHECK_FIELD_ERROR_FOR_NULL. Distinguish between the two. sql/sp_head.cc: Raise error as needed. sql/sql_class.cc: Save and restore check-fields options. sql/sql_class.h: Make room so we can save check-fields options. sql/sql_insert.cc: Raise error as needed.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 673fc9b78e6..266064f9f08 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -3100,6 +3100,7 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
}
#endif
+ backup->count_cuted_fields= count_cuted_fields;
backup->options= options;
backup->in_sub_stmt= in_sub_stmt;
backup->enable_slow_log= enable_slow_log;
@@ -3137,6 +3138,7 @@ void THD::reset_sub_statement_state(Sub_statement_state *backup,
void THD::restore_sub_statement_state(Sub_statement_state *backup)
{
+ DBUG_ENTER("THD::restore_sub_statement_state");
#ifndef EMBEDDED_LIBRARY
/* BUG#33029, if we are replicating from a buggy master, restore
auto_inc_intervals_forced so that the top statement can use the
@@ -3163,6 +3165,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
/* ha_release_savepoint() never returns error. */
(void)ha_release_savepoint(this, sv);
}
+ count_cuted_fields= backup->count_cuted_fields;
transaction.savepoints= backup->savepoints;
options= backup->options;
in_sub_stmt= backup->in_sub_stmt;
@@ -3192,6 +3195,7 @@ void THD::restore_sub_statement_state(Sub_statement_state *backup)
*/
examined_row_count+= backup->examined_row_count;
cuted_fields+= backup->cuted_fields;
+ DBUG_VOID_RETURN;
}