Commit graph

6 commits

Author SHA1 Message Date
Sergei Golubchik
6ce20fb2b9 MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
fix the *other* fill_record() too, arrgh!
2016-06-28 12:54:01 +02:00
Sergei Golubchik
23903255d8 MDEV-9629 Disappearing PRI from Key column after creating a trigger
when creating shadow nullable fields, preserve all
original field flags (because we swap flags
back and forth in not_null_fields_have_null_values())
2016-03-19 19:40:33 +01:00
Sergei Golubchik
57905d18d6 MDEV-9535 Trigger doing "SET NEW.auctionStart = NOW();" on a timestamp kills MariaDB server
when doing set_field_to_new_field (from switch_to_nullable_trigger_fields())
make sure that the field we're about to change actually belongs
to the right table (otherwise we cannot dereference new_field[]
array as the wrong table might have more fields than
new_field[] has elements)
2016-02-23 10:54:34 +01:00
Sergei Golubchik
0fcd0ee34e MDEV-9500 Bug after upgrade to 10.1.10 (and 10.1.11)
Case: table with a NOT NULL field, BEFORE UPDATE trigger,
and UPDATE with a subquery that uses GROUP BY on that
NOT NULL field, and needs a temporary table for it.

Because of the BEFORE trigger, the field becomes nullable
temporarily. But its Item_field (used in GROUP BY) doesn't.
When working with the temptable some code looked at
item->maybe_null, some - at field->null_ptr.
The fix: make Item_field nullable when its field is.

This triggers an assert. The group key size is calculated
before the item is made nullable, so the group key doesn't
have a null byte. The fix: make fields/items nullable
before the group key size is calculated.
2016-02-23 10:53:53 +01:00
Sergei Golubchik
5da7c346c7 MDEV-9428 NO_AUTO_VALUE_ON_ZERO is ignored when a trigger before insert is defined
Don't compare "field == table->next_number_field" because the field
can be special nullable field copy created by the trigger.
Compare field_index values instead.
2016-01-25 22:57:54 +01:00
Sergei Golubchik
0686c34d22 MDEV-8605 MariaDB not use DEFAULT value even when inserted NULL for NOT NULLABLE column
NOT NULL constraint must be checked *after* the BEFORE triggers.
That is for INSERT and UPDATE statements even NOT NULL fields
must be able to store a NULL temporarily at least while
BEFORE INSERT/UPDATE triggers are running.
2015-12-21 21:30:54 +01:00