Commit 8fbdc760 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-28967 Assertion `marked_for_write_or_computed()' failed in...

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.
parent f562f773
......@@ -608,3 +608,22 @@ NULL
connection default;
drop table t1;
set debug_sync= reset;
#
# MDEV-28967 Assertion `marked_for_write_or_computed()' failed in Field_new_decimal::store_value / online_alter_read_from_binlog`
#
create table t1 (a decimal(8,2), b varchar(8));
insert into t1 (b) values ('x');
set debug_sync= 'now wait_for downgraded';
connection con2;
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
alter table t1 force, algorithm=copy, lock=none;
connection default;
insert t1 (b) values ('k');
insert t1 (b) values ('m');
set debug_sync= 'now signal goforit';
connection con2;
drop table t1;
set debug_sync= reset;
#
# End of 11.2 tests
#
......@@ -742,3 +742,31 @@ select * from t1;
--connection default
drop table t1;
set debug_sync= reset;
--echo #
--echo # MDEV-28967 Assertion `marked_for_write_or_computed()' failed in Field_new_decimal::store_value / online_alter_read_from_binlog`
--echo #
create table t1 (a decimal(8,2), b varchar(8));
insert into t1 (b) values ('x');
--send set debug_sync= 'now wait_for downgraded'
--connection con2
set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
--send alter table t1 force, algorithm=copy, lock=none
--connection default
--reap
insert t1 (b) values ('k');
insert t1 (b) values ('m');
set debug_sync= 'now signal goforit';
--connection con2
--reap
drop table t1;
set debug_sync= reset;
--echo #
--echo # End of 11.2 tests
--echo #
......@@ -11993,6 +11993,8 @@ copy_data_between_tables(THD *thd, TABLE *from, TABLE *to,
rli.relay_log.description_event_for_exec=
new Format_description_log_event(4);
// We'll be filling from->record[0] from row events
bitmap_set_all(from->write_set);
// We restore bitmaps, because update event is going to mess up with them.
to->default_column_bitmaps();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment