From 83a326f28c1938d72583e62c6eda7c18d8a87b61 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 31 Mar 2006 11:48:08 +0200 Subject: [PATCH 1/2] BUG#18116: Changed of how mutex is handled for XA and rotating binlog sql/log.cc: thread_safe_increment is done as an atomic operation on some platforms and that does not respect the lock --- sql/log.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sql/log.cc b/sql/log.cc index 85e8c4dae2f..ba02c9ba082 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1882,7 +1882,11 @@ DBUG_skip_commit: rotate binlog, if necessary. */ if (commit_event->get_type_code() == XID_EVENT) - thread_safe_increment(prepared_xids, &LOCK_prep_xids); + { + pthread_mutex_lock(&LOCK_prep_xids); + prepared_xids++; + pthread_mutex_unlock(&LOCK_prep_xids); + } else rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); } From 9f7215d61b52d0b52ed744d0ce0eb5af9724b883 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 9 Apr 2006 13:27:53 +0300 Subject: [PATCH 2/2] BUG#18906 Test case rpl_temporary fails when using --vardir option env variable name is fixed. mysql-test/include/get_binlog_dump_thread_id.inc: Fixing to right env $var name. mysql-test/r/rpl_temporary.result: results --- mysql-test/include/get_binlog_dump_thread_id.inc | 4 +--- mysql-test/r/rpl_temporary.result | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/mysql-test/include/get_binlog_dump_thread_id.inc b/mysql-test/include/get_binlog_dump_thread_id.inc index 680807cc3c6..830a88b5db6 100644 --- a/mysql-test/include/get_binlog_dump_thread_id.inc +++ b/mysql-test/include/get_binlog_dump_thread_id.inc @@ -3,9 +3,7 @@ drop table if exists t999; --enable_warnings create temporary table t999 (f int); -### --replace_result $MYSQL_TEST_DIR "." #failed on solaris etc bug#18906 ---disable_query_log +--replace_result $MYSQLTEST_VARDIR "." eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/bl_dump_thread_id" into table t999; ---enable_query_log let $id = `select f from t999`; drop table t999; diff --git a/mysql-test/r/rpl_temporary.result b/mysql-test/r/rpl_temporary.result index 881504f49d0..12143561854 100644 --- a/mysql-test/r/rpl_temporary.result +++ b/mysql-test/r/rpl_temporary.result @@ -93,6 +93,7 @@ create temporary table t4 (f int); create table t5 (f int); drop table if exists t999; create temporary table t999 (f int); +LOAD DATA INFILE "./tmp/bl_dump_thread_id" into table t999; drop table t999; insert into t4 values (1); kill `select id from information_schema.processlist where command='Binlog Dump'`;