mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Bug#19995 (Extreneous table maps generated for statements that do not generate rows):
Switched to writing out table maps for tables that are locked when the first row in a statement is seen. mysql-test/include/master-slave.inc: Moved code to reset master and slave into separate file. mysql-test/r/binlog_row_blackhole.result: Result change mysql-test/r/binlog_row_mix_innodb_myisam.result: Result change mysql-test/r/ndb_binlog_ignore_db.result: Result change mysql-test/r/rpl_ndb_charset.result: Result change mysql-test/r/rpl_row_basic_11bugs.result: Result change mysql-test/r/rpl_row_charset.result: Result change mysql-test/r/rpl_row_create_table.result: Result change mysql-test/t/rpl_row_basic_11bugs.test: Added test to check that no events are generated when no rows are changed. mysql-test/t/rpl_row_create_table.test: Master log position changed sql/handler.cc: Adding function write_locked_table_maps() that will write table maps for all tables locked for write. Using "table->in_use" instead of "current_thd" since tables are now locked when the function is called. Removing old code to write table map. sql/log_event.cc: Added assertion sql/sql_class.cc: Removing code to write "dummy termination event". sql/sql_class.h: Adding getter for binlog_table_maps. sql/sql_insert.cc: Setting thd->lock before calling write_record for the execution of CREATE-SELECT and INSERT-SELECT since they keep multiple locks in the air at the same time. mysql-test/include/master-slave-reset.inc: New BitKeeper file ``mysql-test/include/master-slave-reset.inc''
This commit is contained in:
@@ -2624,31 +2624,6 @@ int THD::binlog_flush_pending_rows_event(bool stmt_end)
|
||||
|
||||
error= mysql_bin_log.flush_and_set_pending_rows_event(this, 0);
|
||||
}
|
||||
else if (stmt_end && binlog_table_maps > 0)
|
||||
{ /* there is no pending event at this point */
|
||||
/*
|
||||
If pending is null and we are going to end the statement, we
|
||||
have to write an extra, empty, binrow event so that the slave
|
||||
knows to discard the tables it has received. Otherwise, the
|
||||
table maps written this far will be included in the table maps
|
||||
for the following statement.
|
||||
|
||||
TODO: Remove the need for a dummy event altogether. It can be
|
||||
fixed if we can write table maps to a memory buffer before
|
||||
writing the first binrow event. We can then flush and clear the
|
||||
memory buffer with table map events before writing the first
|
||||
binrow event. In the event of a crash, nothing is lost since
|
||||
the table maps are only needed if there are binrow events.
|
||||
*/
|
||||
|
||||
Rows_log_event *ev=
|
||||
new Write_rows_log_event(this, 0, ~0UL, 0, FALSE);
|
||||
ev->set_flags(Rows_log_event::STMT_END_F);
|
||||
binlog_set_pending_rows_event(ev);
|
||||
|
||||
error= mysql_bin_log.flush_and_set_pending_rows_event(this, 0);
|
||||
binlog_table_maps= 0;
|
||||
}
|
||||
|
||||
DBUG_RETURN(error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user