mirror of
https://github.com/MariaDB/server.git
synced 2025-08-07 00:04:31 +03:00
[MDEV-6877] Removed unnecesary bitmap in binlog_write_row
The bitmap is now deduced from the table's read and write set.
This commit is contained in:
@@ -5675,23 +5675,11 @@ static int binlog_log_row(TABLE* table,
|
|||||||
|
|
||||||
if (check_table_binlog_row_based(thd, table))
|
if (check_table_binlog_row_based(thd, table))
|
||||||
{
|
{
|
||||||
MY_BITMAP cols;
|
|
||||||
/* Potential buffer on the stack for the bitmap */
|
|
||||||
uint32 bitbuf[BITMAP_STACKBUF_SIZE/sizeof(uint32)];
|
|
||||||
uint n_fields= table->s->fields;
|
|
||||||
my_bool use_bitbuf= n_fields <= sizeof(bitbuf)*8;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If there are no table maps written to the binary log, this is
|
If there are no table maps written to the binary log, this is
|
||||||
the first row handled in this statement. In that case, we need
|
the first row handled in this statement. In that case, we need
|
||||||
to write table maps for all locked tables to the binary log.
|
to write table maps for all locked tables to the binary log.
|
||||||
*/
|
*/
|
||||||
if (likely(!(error= my_bitmap_init(&cols,
|
|
||||||
use_bitbuf ? bitbuf : NULL,
|
|
||||||
(n_fields + 7) & ~7UL,
|
|
||||||
FALSE))))
|
|
||||||
{
|
|
||||||
bitmap_set_all(&cols);
|
|
||||||
if (likely(!(error= write_locked_table_maps(thd))))
|
if (likely(!(error= write_locked_table_maps(thd))))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -5706,9 +5694,6 @@ static int binlog_log_row(TABLE* table,
|
|||||||
table->file->has_transactions();
|
table->file->has_transactions();
|
||||||
error= (*log_func)(thd, table, has_trans, before_record, after_record);
|
error= (*log_func)(thd, table, has_trans, before_record, after_record);
|
||||||
}
|
}
|
||||||
if (!use_bitbuf)
|
|
||||||
my_bitmap_free(&cols);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return error ? HA_ERR_RBR_LOGGING_FAILED : 0;
|
return error ? HA_ERR_RBR_LOGGING_FAILED : 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user