• Sergei Golubchik's avatar
    MDEV-9500 Bug after upgrade to 10.1.10 (and 10.1.11) · 0fcd0ee3
    Sergei Golubchik authored
    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.
    0fcd0ee3
trigger_null-8605.test 10 KB