Bug #104451 All "DROP TABLE" binlog events marked with flag LOG_EVENT_THREAD_SPECIFIC_F
Submitted: 29 Jul 2021 7:40 Modified: 29 Jul 2021 8:43
Reporter: Sergey Zhuravlev Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.7.34, 5.7.35, 8.0.26 OS:Any
Assigned to: CPU Architecture:Any

[29 Jul 2021 7:40] Sergey Zhuravlev
Description:
The documentation describes LOG_EVENT_THREAD_SPECIFIC_F flag this way:
"event is thread specific (CREATE TEMPORARY TABLE ...)"

After MySQL 5.7.26 this flag is turned on in all "DROP TABLE" events.
This happened after commit
https://github.com/mysql/mysql-server/commit/94499c2deba495c0b8d9729856d480c732c2475a

It brokes my custom replication implementation.

How to repeat:
docker run --rm --name mysql-zhur -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD=1 percona:5.7.34 --binlog-format=row --binlog-rows-query-log-events --enforce-gtid-consistency --gtid-mode=ON --log-bin=binlog --log-slave-updates --master-info-repository=TABLE --server-id 123

mysql -u root -h 127.0.0.1 --port 3306 -e 'create database x; use x; create table rrr (i int); drop table rrr;'
docker exec -ti  mysql-zhur mysqlbinlog -vvv -H --base64-output=decode-rows /var/lib/mysql/binlog.000003
.....
#210729  7:35:31 server id 123  end_log_pos 676 CRC32 0xecf7b1e1
# Position  Timestamp   Type   Master ID        Size      Master Pos    Flags
#      236 43 5a 02 61   02   7b 00 00 00   6e 00 00 00   a4 02 00 00   04 00
#      249 02 00 00 00 00 00 00 00  01 00 00 1e 00 00 00 00 |................|
#      259 00 00 01 20 00 a0 55 00  00 00 00 06 03 73 74 64 |......U......std|
#      269 04 21 00 21 00 08 00 0c  01 78 00 78 00 44 52 4f |.........x.x.DRO|
#      279 50 20 54 41 42 4c 45 20  60 72 72 72 60 20 2f 2a |P.TABLE..rrr....|
#      289 20 67 65 6e 65 72 61 74  65 64 20 62 79 20 73 65 |.generated.by.se|
#      299 72 76 65 72 20 2a 2f e1  b1 f7 ec                |rver.......|
#       Query   thread_id=2     exec_time=0     error_code=0
.....
Flags 0400 means that LOG_EVENT_THREAD_SPECIFIC_F is turned on.

Suggested fix:
Turn on this flag only for TEMPORARY TABLE events
[29 Jul 2021 8:43] MySQL Verification Team
Hello Sergey,

Thank you for the report.

regards,
Umesh