Bug #84441 Xids for DDL are not logged in the binlog
Submitted: 9 Jan 2017 4:12 Modified: 31 Jan 2017 5:17
Reporter: Agustín G Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Utilities: Binlog Events Severity:S3 (Non-critical)
Version:5.7.15 OS:Any
Assigned to: CPU Architecture:Any

[9 Jan 2017 4:12] Agustín G
Description:
For some reason, DDL events are not logged in the mysql binlog files. If this is intended, it should be better documented (maybe here: https://dev.mysql.com/doc/internals/en/event-data-for-specific-event-types.html ?).

How to repeat:
Enable GTID and binary logging in a 5.7.15 master server.

mysql> CREATE SCHEMA xid;
mysql> CREATE TABLE xid.table1 (id int primary key);
mysql> INSERT INTO xid.table1 VALUES (1);
mysql> CREATE TABLE xid.table2 (id int primary key);
mysql> INSERT INTO xid.table2 VALUES (1);

None of the create table statements will show an Xid value in the binary log:

shell> mysqlbinlog --verbose mysql-bin.000001 | grep -i xid
...

or

mysql> SHOW BINLOG EVENTS IN 'mysql-bin.000001';
...

I tried adding the create table between a 'begin ... commit' block, but it didn't add an Xid, either.

Suggested fix:
Document on why it's not possible to add an associated Xid value to DDLs; or add them to the binary logs, if it's possible.

Thanks!
[31 Jan 2017 5:17] Bogdan Kecman
Thanks for the report, our documentation team is informed and bug is verified

best regards
Bogdan