mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
MDEV-15243 Crash with virtual fields and row based binary logging
The cause of this was several different bugs: - When using binary logging with binlog_row_image=FULL the all bits in read_set was set, which caused a different (wrong) pattern for marking vcol_set. - TABLE::mark_virtual_columns_for_write() didn't in all cases mark vcol_set with the vcol_field. - TABLE::update_virtual_fields() has to update all vcol fields on REPLACE if binary logging with FULL is used. - VCOL_UPDATE_INDEXED should update all vcol fields part of an index that was not updated by VCOL_UPDATE_FOR_READ - max_row_length() calculated length of NULL and not used fields. This didn't cause any crash, but used more memory than needed.
This commit is contained in:
@ -6567,15 +6567,17 @@ int THD::binlog_delete_row(TABLE* table, bool is_trans,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
Remove from read_set spurious columns. The write_set has been
|
||||
handled before in table->mark_columns_needed_for_update.
|
||||
*/
|
||||
|
||||
void THD::binlog_prepare_row_images(TABLE *table)
|
||||
{
|
||||
DBUG_ENTER("THD::binlog_prepare_row_images");
|
||||
/**
|
||||
Remove from read_set spurious columns. The write_set has been
|
||||
handled before in table->mark_columns_needed_for_update.
|
||||
*/
|
||||
|
||||
DBUG_PRINT_BITSET("debug", "table->read_set (before preparing): %s", table->read_set);
|
||||
DBUG_PRINT_BITSET("debug", "table->read_set (before preparing): %s",
|
||||
table->read_set);
|
||||
THD *thd= table->in_use;
|
||||
|
||||
/**
|
||||
@ -6593,7 +6595,7 @@ void THD::binlog_prepare_row_images(TABLE *table)
|
||||
*/
|
||||
DBUG_ASSERT(table->read_set != &table->tmp_set);
|
||||
|
||||
switch(thd->variables.binlog_row_image)
|
||||
switch (thd->variables.binlog_row_image)
|
||||
{
|
||||
case BINLOG_ROW_IMAGE_MINIMAL:
|
||||
/* MINIMAL: Mark only PK */
|
||||
@ -6623,7 +6625,8 @@ void THD::binlog_prepare_row_images(TABLE *table)
|
||||
table->write_set);
|
||||
}
|
||||
|
||||
DBUG_PRINT_BITSET("debug", "table->read_set (after preparing): %s", table->read_set);
|
||||
DBUG_PRINT_BITSET("debug", "table->read_set (after preparing): %s",
|
||||
table->read_set);
|
||||
DBUG_VOID_RETURN;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user