<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="1024058">
  <date_last_updated>2012-07-12 20:51:20.280238+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/1024058</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~prohaska7</bug_owner_link>
    <milestone_link>https://api.launchpad.net/1.0/maria/+milestone/5.5</milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/1024058/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/1024058/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/1024058</bug_web_link>
  <owner>rich prohaska</owner>
  <assignee>Sergei</assignee>
  <milestone_title>Maria 5.5</milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>mysqld XA crash in replication slave</title>
  <status>New</status>
  <importance>Critical</importance>
  <created>2012-07-12 19:56:53.405845+00:00</created>
  <description>
<![CDATA[We found a simple XA transaction that crashes MySQL 5.5 replication.   This simple transaction merely inserts into InnoDB and TokuDB tables.  The bug was caused by a flaw in the logging code exposed by the transaction’s use of two XA storage engines (TokuDB and InnoDB)  and was fixed in the TokuDB 6.0.1 release.

Here are some details.  Suppose that a database contains the following tables.
create table t1 (a int) engine=InnoDB
create table t2 (a int) engine=TokuDB

The following transaction
begin
insert into t1 values (1)
insert into t2 values (2)
commit
causes the replication slave to crash.

The crash occurs when mysqld tries to dereference a NULL pointer.

#4  0x000000000088e203 in MYSQL_BIN_LOG::log_and_order (this=0x14b8640, thd=0x7f7758000af0, xid=161, all=true, need_prepare_ordered=false, need_commit_ordered=true) at /home/mariadb-5.5.25/sql/log.cc:7491
7491	  cache_mngr->using_xa= TRUE;
(gdb) p cache_mngr
$1 = (binlog_cache_mngr *) 0x0

the bug is fixed on lp:~prohaska7/5.5-xa-rpl-crash-fix

also, see mariadb developers email chain.]]>  </description>
  <activities>
    <activity datechanged="2012-07-12T19:56:53.405845+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>rich prohaska</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2012-07-12T20:50:32.614861+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[5.5]]>      </newvalue>
      <whatchanged>maria: milestone</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-07-12T20:51:05.351089+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[Critical]]>      </newvalue>
      <whatchanged>maria: importance</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
    <activity datechanged="2012-07-12T20:51:18.544479+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Sergei (sergii)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Elena Stepanova</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/maria/+bug/1024058/comments/0" datecreated="2012-07-12T19:56:53.405845+00:00">
      <person>rich prohaska</person>
      <subject>
<![CDATA[mysqld XA crash in replication slave]]>      </subject>
      <content>
<![CDATA[We found a simple XA transaction that crashes MySQL 5.5 replication.   This simple transaction merely inserts into InnoDB and TokuDB tables.  The bug was caused by a flaw in the logging code exposed by the transaction’s use of two XA storage engines (TokuDB and InnoDB)  and was fixed in the TokuDB 6.0.1 release.

Here are some details.  Suppose that a database contains the following tables.
create table t1 (a int) engine=InnoDB
create table t2 (a int) engine=TokuDB

The following transaction
begin
insert into t1 values (1)
insert into t2 values (2)
commit
causes the replication slave to crash.

The crash occurs when mysqld tries to dereference a NULL pointer.

#4  0x000000000088e203 in MYSQL_BIN_LOG::log_and_order (this=0x14b8640, thd=0x7f7758000af0, xid=161, all=true, need_prepare_ordered=false, need_commit_ordered=true) at /home/mariadb-5.5.25/sql/log.cc:7491
7491	  cache_mngr->using_xa= TRUE;
(gdb) p cache_mngr
$1 = (binlog_cache_mngr *) 0x0

the bug is fixed on lp:~prohaska7/5.5-xa-rpl-crash-fix

also, see mariadb developers email chain.]]>      </content>
    </comment>
  </comments>
</launchpad-bug>
