Commit 91ebf184 authored by Nikita Malyavin's avatar Nikita Malyavin

MDEV-19338 InnoDB: Failing assertion: !cursor->index->is_committed()

Call mark_columns_per_binlog_row_image before find_row() to set up table->vcol_set early,
so the virtual column value will be updated after record read (ha_rnd_pos/ha_index_next/etc)
by table->update_virtual_fields() call
parent 8a612314
include/master-slave.inc
[connection master]
connection master;
create table t1 (
id int auto_increment,
data varchar(32),
virt tinyint as (1),
primary key (id),
key virt (virt)
) engine=innodb default charset=utf8mb4;
insert into t1 (data) values ('broken');
update t1 set data='more broken';
connection slave;
select * from t1;
id data virt
1 more broken 1
connection master;
drop table t1;
connection slave;
include/rpl_end.inc
--source include/have_binlog_format_row.inc
--source include/master-slave.inc
--source include/have_innodb.inc
connection master;
create table t1 (
id int auto_increment,
data varchar(32),
virt tinyint as (1),
primary key (id),
key virt (virt)
) engine=innodb default charset=utf8mb4;
insert into t1 (data) values ('broken');
update t1 set data='more broken';
--sync_slave_with_master
select * from t1;
--connection master
drop table t1;
--sync_slave_with_master
--source include/rpl_end.inc
......@@ -13614,7 +13614,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
if (is_table_scan || is_index_scan)
issue_long_find_row_warning(get_general_type_code(), m_table->alias.c_ptr(),
is_index_scan, rgi);
table->default_column_bitmaps();
DBUG_RETURN(error);
}
......@@ -13928,6 +13927,12 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
#endif /* WSREP_PROC_INFO */
thd_proc_info(thd, message);
// Temporary fix to find out why it fails [/Matz]
memcpy(m_table->read_set->bitmap, m_cols.bitmap, (m_table->read_set->n_bits + 7) / 8);
memcpy(m_table->write_set->bitmap, m_cols_ai.bitmap, (m_table->write_set->n_bits + 7) / 8);
m_table->mark_columns_per_binlog_row_image();
int error= find_row(rgi);
if (error)
{
......@@ -13998,11 +14003,6 @@ Update_rows_log_event::do_exec_row(rpl_group_info *rgi)
goto err;
}
// Temporary fix to find out why it fails [/Matz]
memcpy(m_table->read_set->bitmap, m_cols.bitmap, (m_table->read_set->n_bits + 7) / 8);
memcpy(m_table->write_set->bitmap, m_cols_ai.bitmap, (m_table->write_set->n_bits + 7) / 8);
m_table->mark_columns_per_binlog_row_image();
error= m_table->file->ha_update_row(m_table->record[1], m_table->record[0]);
if (error == HA_ERR_RECORD_IS_THE_SAME)
error= 0;
......
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