1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Online alter: set read_set early, before row reads

also

* don't modify write_set
* backup/restore rpl_write_set
This commit is contained in:
Sergei Golubchik
2022-05-31 22:06:27 +02:00
parent df0771c6a2
commit 32c3d775e9
2 changed files with 29 additions and 4 deletions

View File

@@ -7272,14 +7272,17 @@ static int binlog_log_row_online_alter(TABLE* table,
trans_register_ha(thd, true, binlog_hton, 0);
}
// We need to log all columns for the case if alter table changes primary key.
table->use_all_columns();
bitmap_set_all(table->rpl_write_set);
// We need to log all columns for the case if alter table changes primary key
DBUG_ASSERT(!before_record || bitmap_is_set_all(table->read_set));
MY_BITMAP *old_rpl_write_set= table->rpl_write_set;
table->rpl_write_set= &table->s->all_set;
int error= (*log_func)(thd, table, table->s->online_alter_binlog,
table->online_alter_cache, has_trans,
before_record, after_record);
table->rpl_write_set= old_rpl_write_set;
return unlikely(error) ? HA_ERR_RBR_LOGGING_FAILED : 0;
}
#endif // HAVE_REPLICATION