Commit 1d8efa66 authored by unknown's avatar unknown

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
parent e1ba1274
...@@ -1882,7 +1882,11 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event) ...@@ -1882,7 +1882,11 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, Log_event *commit_event)
rotate binlog, if necessary. rotate binlog, if necessary.
*/ */
if (commit_event->get_type_code() == XID_EVENT) 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 else
rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED); rotate_and_purge(RP_LOCK_LOG_IS_ALREADY_LOCKED);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment