summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2018-05-23 22:42:29 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2018-05-24 18:55:12 +0300
commit4cd2a0eb56010ea1e8d2601151ca0d25834deb7e (patch)
tree26a8796c479a3fb8d7a873491e475c80031e0016 /sql/sql_class.cc
parent1c8c6bcd6f984d05d6f68d332b1e79c801e02003 (diff)
downloadmariadb-git-4cd2a0eb56010ea1e8d2601151ca0d25834deb7e.tar.gz
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.
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 23eda5ead77..577007dad38 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -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;
}