maria:bb-10.10-MDEV-29021

Last commit made on 2022-07-05
Get this branch:
git clone -b bb-10.10-MDEV-29021 https://git.launchpad.net/maria

Branch merges

Branch information

Name:
bb-10.10-MDEV-29021
Repository:
lp:maria

Recent commits

3e2d297... by Nikita Malyavin

MDEV-29013 ER_KEY_NOT_FOUND/lock timeout upon online alter with long unique

1. ER_KEY_NOT_FOUND
Some virtual columns were not updated because were not included in read_set
to the moment of calculation.

In Row_logs_event::do_apply_event some fields are excluded based on m_cols
value, the number of replicated rows.

We can't rely on this. Basically, we'd be satisfied, if all columns were
just set, at least for now.

2. ER_LOCK_WAIT_TIMEOUT
This is a long unique specific problem.

Sometimes, lookup_handler is created for to->file. To properly free it,
ha_reset should be called. It is usually done by calling
close_thread_table, but ALTER TABLE makes it differently. Hence, a single
ha_reset call is added to mysql_alter_table.

Also, the lifetime of lookup_handler is corrected: it's been allocated on
thd->mem_root, which in case of online alter
is event's mem_root, and can vary other ways.
It is changed to table->mem_root, which is more appropriate:
ha_reset is called only when table is closed, or in a few additional cases,
which correspond to a statement end. So memory leaks are unlikely here.

c1feb8c... by Nikita Malyavin

MDEV-29021 add test case from MDEV-29013

This test case was also fixed by adding update_virtual_columns.

73c4fd4... by Nikita Malyavin

Do not ignore sql_mode when replicating

Division by zero is a good example. sql_mode is basically ignored by
replication, see Bug#56662.

The behavior for ONLINE should remain the same as for non-ONLINE ALTER.

4d02be3... by Nikita Malyavin

Simplify rgi->get_table_data call

7551f18... by Nikita Malyavin

reorder RPL_TABLE_LIST fields for better packing

ce5cc8f... by Nikita Malyavin

MDEV-29021 ALTER TABLE fails when a stored virtual column is dropped+added

We shouldn't rely on `fill_extra_persistent_columns`, as it only updates
fields which have an index > cols->n_bits (replication bitmap width).

Normal update_virtual_fields+update_default_fields shoudl be done.

49ad875... by Sergei Golubchik

MDEV-28943 Online alter fails under LOCK TABLE with ER_ALTER_OPERATION_NOT_SUPPORTED_REASON

if ALTER TABLE ... LOCK=xxx is executed under LOCK TABLES,
ignore the LOCK clause, because ALTER should not downgrade
already taken EXCLUSIVE table lock to SHARED or NONE.

This commit preserves the existing behavior (LOCK was de facto ignored),
but makes it explicit.

4c50a0e... by Nikita Malyavin

MDEV-28930 ALTER TABLE Deadlocks with parallel TL_WRITE

ALTER ONLINE TABLE acquires table with TL_READ. Myisam normally acquires
TL_WRITE for DML, which makes it hang until table is freed.

We deadlock once ALTER upgrades its MDL lock.

Solution:
Unlock table earlier. We don't need to hold TL_READ once we finished
copying. Relay log replication requires no data locks on `from` table.

ba1cd2f... by Sergei Golubchik

MDEV-28967 Assertion `marked_for_write_or_computed()' failed in Field_new_decimal::store_value / online_alter_read_from_binlog`

in the catch-up phase of the online alter we apply row events,
they're unpacked into `from->record[0]` and then converted
to `to->record[0]`.

This needs all fields of `from` to be in the `write_set`.

Although practically `Field::unpack()` does not assert the `write_set`,
and `Field::reset()` - used when a field value is not present in the
after-image - also doesn't assert the `write_set` for many types,
`Field_new_decimal::reset()` does.

72dd93a... by Sergei Golubchik

remove redundant warnings in RBR and online alter

in RBR - only show warnings for values that are to be written into a
table, that is, only for the after-image. Don't show data conversion
warnings for the before-image.