mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-20403 Assertion 0' or Assertion
btr_validate_index(index, 0)' failed in row_upd_sec_index_entry or error code 126: Index is corrupted upon UPDATE with TIMESTAMP..ON UPDATE
Three issues here: * ON UPDATE DEFAULT NOW columns were updated after generated columns were computed - this broke indexed virtual columns * ON UPDATE DEFAULT NOW columns were updated after BEFORE triggers, so triggers didn't see the correct NEW value * in case of a multi-update generated columns were also updated after BEFORE triggers
This commit is contained in:
@ -8071,9 +8071,13 @@ fill_record(THD *thd, TABLE *table_arg, List<Item> &fields, List<Item> &values,
|
||||
rfield->set_explicit_default(value);
|
||||
}
|
||||
|
||||
if (!update && table_arg->default_field &&
|
||||
table_arg->update_default_fields(ignore_errors))
|
||||
goto err;
|
||||
if (update)
|
||||
table_arg->evaluate_update_default_function();
|
||||
else
|
||||
if (table_arg->default_field &&
|
||||
table_arg->update_default_fields(ignore_errors))
|
||||
goto err;
|
||||
|
||||
/* Update virtual fields */
|
||||
if (table_arg->vfield &&
|
||||
table_arg->update_virtual_fields(table_arg->file, VCOL_UPDATE_FOR_WRITE))
|
||||
|
Reference in New Issue
Block a user