[MDEV-8573] Temporary Tables break replication in MIXED binlog_format Created: 2015-08-07  Updated: 2019-07-09  Resolved: 2019-07-02

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Temporary, Replication
Affects Version/s: 10.0.20, 10.0, 10.1
Fix Version/s: 10.0.36, 10.1.35, 10.2.17, 10.3.9

Type: Bug Priority: Major
Reporter: Derek Downey Assignee: Sujatha Sivakumar (Inactive)
Resolution: Duplicate Votes: 1
Labels: replication
Environment:

CentOS 6.4


Attachments: Text File mariadb10.0_output.txt     File mysql-bin.000004     Text File mysql56_output.txt    

 Description   

We have run into a scenario where replication breaks on slaves when using MIXED replication and temporary tables.

After a session is switched to ROW due to temporary tables existing, all subsequent events for the session should be in ROW. DDL statements affecting Temporary Tables in ROW format should not be logged.

Test Case

SET @@global.binlog_format=MIXED;
connect;
create temporary table ptest1(i int); // This switched session to ROW until temporary table is removed
select current_user(); // This switches session MIXED to ROW, and since a temp table exists, all other statements are logged as ROW.
create temporary table ptest2(i int);
create index i on ptest2(i);

Expected behavior
Create index on temporary table is not logged to binlog, since the session should follow ROW logging rules.

Actual behavior
On mariadb 10.0.20, create index is logged and breaks replication on slave
On mysql 5.6.26 and 5.6.14, create index is not logged.

Attaching output from both mysql 5.6 and mariadb 10.0.20 attached, and the binlog from mariadb test.



 Comments   
Comment by Elena Stepanova [ 2015-08-07 ]

Thanks for the report.

Comment by Sujatha Sivakumar (Inactive) [ 2019-07-02 ]

The issue has been fixed as part of MDEV-9266. Hence marking it as duplicate.

Generated at Thu Feb 08 07:28:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.