Browse Source
MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
MDEV-19761 Before Trigger not processed for Not Null Columns if no explicit value and no DEFAULT
it's incorrect to zero out table->triggers->extra_null_bitmap before a statement, because if insert uses an explicit field list and omits a field that has no default value, the field should get NULL implicitly. So extra_null_bitmap should have 1s for all fields that have no defaults * create extra_null_bitmap_init and initialize it as above * copy extra_null_bitmap_init to extra_null_bitmap for inserts * still zero out extra_null_bitmap for updates/deletes where all fields definitely have a value * make not_null_fields_have_null_values() to send ER_NO_DEFAULT_FOR_FIELD for fields with no default and no value, otherwise creation of a trigger with an empty body would change the error messagepull/3721/head
15 changed files with 127 additions and 74 deletions
-
2mysql-test/main/trigger_no_defaults-11698.result
-
2mysql-test/main/trigger_no_defaults-11698.test
-
25mysql-test/main/trigger_null-8605.result
-
25mysql-test/main/trigger_null-8605.test
-
2sql/field.h
-
8sql/field_conv.cc
-
9sql/sql_base.cc
-
4sql/sql_delete.cc
-
26sql/sql_insert.cc
-
7sql/sql_insert.h
-
9sql/sql_load.cc
-
9sql/sql_trigger.cc
-
18sql/sql_trigger.h
-
4sql/sql_update.cc
-
51sql/table.cc
Write
Preview
Loading…
Cancel
Save
Reference in new issue