Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-06-26 16:44:04+03:00, gkodinov@stripped +1 -0
Bug #28983: 'reset master' in multiple threads and innodb tables
asserts debug binary
We can't reliably check if the binary log is opened without
acquiring its mutex.
Fixed by making this check conditional and off by default.
sql/log.cc@stripped, 2007-06-26 16:44:03+03:00, gkodinov@stripped +20 -5
Bug #28983:
can't reliably check if bin_log is open outside of its mutex
diff -Nrup a/sql/log.cc b/sql/log.cc
--- a/sql/log.cc 2007-04-27 16:33:46 +03:00
+++ b/sql/log.cc 2007-06-26 16:44:03 +03:00
@@ -37,6 +37,16 @@ ulong sync_binlog_counter= 0;
static Muted_query_log_event invisible_commit;
+/*
+ Turn on to find the cases when we are registering unnecessary, doing
+ extra work.
+ It is not thread safe to check that outside of the binlog mutex.
+*/
+#ifdef FIND_BINLOG_ERRORS
+#define DBUG_ASSERT_BINLOG_OPEN DBUG_ASSERT(mysql_bin_log.is_open())
+#else
+#define DBUG_ASSERT_BINLOG_OPEN
+#endif
static bool test_if_number(const char *str,
long *res, bool allow_wildcards);
static bool binlog_init();
@@ -85,7 +95,8 @@ bool binlog_init()
static int binlog_close_connection(THD *thd)
{
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
- DBUG_ASSERT(mysql_bin_log.is_open() && !my_b_tell(trans_log));
+ DBUG_ASSERT_BINLOG_OPEN;
+ DBUG_ASSERT(!my_b_tell(trans_log));
close_cached_file(trans_log);
my_free((gptr)trans_log, MYF(0));
return 0;
@@ -126,7 +137,8 @@ static int binlog_commit(THD *thd, bool
{
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
DBUG_ENTER("binlog_commit");
- DBUG_ASSERT(mysql_bin_log.is_open() &&
+ DBUG_ASSERT_BINLOG_OPEN;
+ DBUG_ASSERT(
(all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))));
if (my_b_tell(trans_log) == 0)
@@ -155,7 +167,8 @@ static int binlog_rollback(THD *thd, boo
unnecessary, doing extra work. The cause should be found and eliminated
*/
DBUG_ASSERT(all || !(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)));
- DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log));
+ DBUG_ASSERT_BINLOG_OPEN;
+ DBUG_ASSERT(my_b_tell(trans_log));
/*
Update the binary log with a BEGIN/ROLLBACK block if we have
cached some queries and we updated some non-transactional
@@ -198,7 +211,8 @@ static int binlog_savepoint_set(THD *thd
{
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
DBUG_ENTER("binlog_savepoint_set");
- DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log));
+ DBUG_ASSERT_BINLOG_OPEN;
+ DBUG_ASSERT(my_b_tell(trans_log));
*(my_off_t *)sv= my_b_tell(trans_log);
/* Write it to the binary log */
@@ -210,7 +224,8 @@ static int binlog_savepoint_rollback(THD
{
IO_CACHE *trans_log= (IO_CACHE*)thd->ha_data[binlog_hton.slot];
DBUG_ENTER("binlog_savepoint_rollback");
- DBUG_ASSERT(mysql_bin_log.is_open() && my_b_tell(trans_log));
+ DBUG_ASSERT_BINLOG_OPEN;
+ DBUG_ASSERT(my_b_tell(trans_log));
/*
Write ROLLBACK TO SAVEPOINT to the binlog cache if we have updated some